-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making contributions smoother #20
Comments
Cons of Gitbook
|
Pros of Gitbook
|
Thank you sooooo much for the thorough evaluation, @kousu . This is amazing. All the arguments you have raised make sense. Do you have suggestions of alternative products (keeping in mind the specs that we are after, ie, "easy" editing)? I would like to hear some feedback from the rest of the team also. |
Alternative(s) to GitbookI think we should start with the constraint that we keep this repo alive and use the Github editor for editing the wiki. Then we only have the one set of accounts and permissions to manage. their editor isn't live or WYSIWYG but it has Preview one click away: We should make sure to leave this repo unprotected so everyone in the lab can edit without having to go through PRs. (but people can still use PRs if they want feedback). Then, as for reading and using it, I have two ideas: Just use GithubI think in the short term we could go replace our A record with a HTTP 301 redirect and/or an HTML AestheticsThe default Github markdown renderer is fine IMO. It renders text and images and it's elegant enough. We can't control it or put our logo in the corner, but in a pinch it's serviceable. Primary Table of ContentsInstead of a sidebar, it just has a directory hierarchy: This isn't great but it's also not the worst, especially since the folder names are sensible. Secondary Table of ContentsGithub has a per-page ToC generator, as of sometime last year: It doesn't render on pages that only have one heading: and it's a little bit unobvious, but it's there. Edit on GithubGithub, of course, has an edit button built in HostingHosting is built in because Github renders markdown files in its web UI by default. Instead, use SphinxWe use sphinx in all our other repos, e.g. https://github.com/spinalcordtoolbox/spinalcordtoolbox/tree/master/documentation/source renders to https://spinalcordtoolbox.com/, the same for shimming-toolbox.org/, https://axondeepseg.readthedocs.io/en/latest/, etc. We can use it here too. sphinx supports markdown (via a plugin) so we don't need much rewriting. Mostly we just need to add the sphinx config file, and also rewrite Gitbook's SUMMARY.md as sphinx AestheticsWe can control the look by picking a theme off https://sphinx-themes.org/ and adding custom CSS to it. Table of Contents (Primary and Secondary)I also looked around and found a sphinx theme that is almost identical to the Gitbook theme: https://sphinx-book-theme.readthedocs.io/. You can see, it has the same left/right primary/secondary ToC sidebar setup: I'm prototyping this theme right now on neuropoly-docs#ng/sphinx Edit on GithubThat theme comes with a working Edit on Github button: (in fact, most doc themes for sphinx or any other static site generator do this because it's such a common need; and doubly so for docs hosted on RTD, including https://spinalcordtoolbox.com/, because RTD overlays its own Edit button, though it's 3 clicks instead of 1: so if we pick a static site generator we don't need to fear about losing the Edit button HostingWe can either host the results with readthedocs as we do elsewhere or directly to github-pages; there's an example of the latter at https://github.com/serra/sphinx-with-markdown/blob/3a6df64976e5e9f55a24625c224071ebd916b9b2/.github/workflows/main.yml#L33 (and in this case I kind of prefer this option, even though yes, it means more Github lock-in; but it's just more self-contained). Pros of Readthedocs
Pros of Github pages
Cons of Github Pages
|
cool! where can we see it rendered? or do we need to build locally? |
ps: another cons of gitbook is the impossibiliy (for now) to embed objects like google calendars (is that possible with sphinx?) |
You need to build locally at the moment: it's still missing
give me 20 minutes though and I can probably knock off that first one, which is the main issue left. I'm not sure about embedding calendars! But sphinx is very widely used and flexible so surely there's a plugin somewhere for those sorts of use cases. |
I also think we should re-merge https://github.com/neuropoly/neuropoly-docs/ and https://github.com/neuropoly/neuropoly-internal-docs/. And maybe rename the latter section "Lab Manual"? They were only split up because the table of contents got too dense, I believe, but with e.g. most pages look like https://sphinx-book-theme.readthedocs.io/en/latest/customize/index.html but under This is done with this snippet: I haven't explored this at all yet but I think there's a 70% chance it will work out. |
@kousu there are a lot of considerations here which only you and me are seeing-- at the end we need to make a consensus decisions among the 30+ members of the lab-- problem: people don't follow this GH thread-- solution: can you pls sum up some points and present at our next lab meeting? (and slack to get ppl attention)-- thx |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Performance comparison: the "Team" page on Gitbook https://www.neuro.polymtl.ca/team takes almost 10MB and 14s and 56 HTTP calls to load. the sphinx version is 1MB, 8.15s in 39 calls: 1MB and 39 calls are still quite a lot!! Fully a quarter of the size is loading MathJax.js, which we do not and probably won't use. But it's obviously, well, 10x better in bandwidth and 50% better in speed. But 39 is still..quite a lot |
This comment has been minimized.
This comment has been minimized.
I've got a demo posted to https://wiki-sphinx-demo1.neuropoly.org/: It's hosted at Github Actions via https://github.com/kousu/neuropoly-docs-demo/tree/gh-pages. And it even has SSL: I'll try to get it hosted in this repo next. Hopefully I can do that without actually merging #21; I think merging it would confuse Gitbook and lead to sadness if we're not ready. Deploying to https://wiki-demo.neuropoly.org
|
I stumbled into one of the bugs I predicted with Gitbook's git importer:
I fixed it up manually by doing this for every broken link: in two patches; producing 8f9e723 then fd1834f. Together they made no changes to this repo at all; but something changed internally on Gitbook.com because now the links work again: |
Another export bug: table headers don't export correctly. Gitbook (and Markdown) have optional table headers (written but we're not using them anywhere: i.e. we have "Show table header" unchecked everywhere: however when exported, Gitbook ignores this checkbox and just exports the first row as a header anyway, placing the So the only safe way is to always keep the headers turned on. I bet that's how ended up with all those redundant "Name" rows on that page in the first place, maybe during the migration to their newest version they ran our repo in and out of their exporter a few times.... EDIT: I partially take this back: table headers are mandatory in Github-flavoured markdown. But Gitbook is still doing it wrong by exporting the first row of content as that header, in the case where you have headers hidden on its side. |
Gitbook released a new version with a lot of changes (without warning) that needed some quick action on our part to reset user permissions to get things working again. This has motivated some internal discussions about how to work with it.
In particular, the "Edit on Github" button is currently broken; it seems that it's supposed to be supported
but it's disabled for us for some reason; maybe because we were migrated instead of created fresh and are now in some sort of legacy mode.
More broadly, since the summer we've been in an uncomfortable limbo, maintaining our docs with two UIs: this repo, and with app.gitbook.io. The new Gitbook version is especially pushing its WYSIWYG editor, making it more like Notion.so or Google Docs and I think this is the best moment to summarize the tension and settle on one workflow.
The text was updated successfully, but these errors were encountered: