-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Port user guide to Sphinx + Markdown #220
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
CI will be broken for a while. I can use that Git commit message that skips CI (don't recall if it's different per CI check?), or subscribers to this issue can ignore it until it's squashed and ready for review. I rendered the existing Markdown files, but the menu and parsing of Markdown files need some adjusting. Here's what the index look like in both desktop & mobile viewports (pydata theme is responsive), and also the setup for (random example.) |
To build it, either Markdown comments fixed. Now let's think about these includes.... |
I think the Python version in the Netlify build needs to be updated. I don't have much experience managing Netlify, but their docs seem helpful. @mr-c I've created a user on Netlify with my GitHub. Do you know how can I access the config for the builds in this repository, please? |
Or better yet, just use readthedocs.org to do the rendering? |
Tested on RTD, built successfully, will look at adding the webhooks later, so I don't have to re-build it after each commit. https://common-workflow-languageuser-guide.readthedocs.io/en/latest/? |
For the RTD webhook, I'd need someone to grant me karma to the settings of the project. At the moment that option is not showing for my user. Ref: https://docs.readthedocs.io/en/stable/integrations.html As workaround I can just ask RTD to re-publish the docs manually. |
@kinow I upped your permissions; is that enough? |
I can see the Settings option now, but I think I'm still missing some permission. Here's my view of Settings on this repo, without Webhooks: Here's when I open one of my own repositories: I can fork and try to enable/use RTD on my branch for now if that's easier, @mr-c . Thanks! |
@kinow try again 🙂 |
Getting there! On Firefox for Android the nav tree takes up the first few screens when browsing any one of the episodes https://common-workflow-languageuser-guide.readthedocs.io/en/latest/_episodes/21-1st-workflow.html |
Ah, good catch! Let me add to the top comment so I don't forget to fix this one. Thanks @mr-c! |
BTW, ReadTheDocs shows the build commands, so we can copy it and run locally. The build process is normally super fast, so troubleshooting build errors is extremely easy 🙂 Happy with RTD so far. |
02439a5
to
6705d3a
Compare
In order to maintain the old links, I've moved the episode files from After moving the episodes, I've also updated the That forced me to read about the Sphinx It looks like it's hard to customize the navigation bar, or to use a template to dynamically create a menu out of a
@mr-c, @tetron should I try that, so that we have a Sphinx user guide with 100% of what we have in the user guide? Asking because if we won't use this Carpentries episodes, and instead will re-write the user guide, then this effort would then be in vain, I think. WDYT? |
Thanks for the progress update! Let's not try to recreate the same layout as the carpentries template, no. Keep it simple and functional for now |
49c3b6f
to
2be017b
Compare
2af38af
to
1a6056f
Compare
I think most of the current user guide has been ported to Sphinx now. I've squashed the changes, but I think it might be complicated to review as the PR has 119 files changed. Here's a summary of what's done or pending:
I created a RTD project, https://common-workflow-languageuser-guide.readthedocs.io/en/latest/, but we can rename it or create another one. I'm using it just to build & validate the changes (e.g. the version changer only works in RTD as locally browsers will block a request to fetch the JSON - CORS). I think we can continue using it, and now start modifying the contents? Any thoughts? cc @mr-c, @tetron Cheers |
_templates/layout.html
Outdated
<div class="container-xl"> | ||
<ul class="navbar-nav"> | ||
<li class="nav-end-item"> | ||
<a class="nav-link nav-external" href="#">TODO: add more links</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add a link to the generated CONTRIBUTING.md
here, and Cite and Contact as in the user guide. Or other links? WDYT?
Added a new item to the tasks list for checking how to build and preview it on RTD (as we are currently doing) and deploy to GitHub Pages 👍 I know we can simply use something like |
@mr-c I cannot push to this branch any more. Should I close and open it from another branch from my fork? Thanks! |
The last commit removes the version switchers at the top menu and at the right-sidebar. It also fixes a Markdown link in the “Tip” box on the main page 👍 |
@mr-c, @tetron, I'm reviewing some technical writing docs and looking at other guides, so had a video playing while I set up a test branch to experiment with GitHub Pages + Sphinx. The branch is here, with a single commit adding a workflow: https://github.com/kinow/user_guide/tree/now-with-gh-pages The workflow does the following:
I realized half-way through writing the workflow that the User Guide source is actually in our You can look at the result here: https://kinow.github.io/user_guide/ If you get a page that looks like a personal blog, it could be my blog cached in your browser (assuming you ever opened kinow.github.io). In which case, you can try to force-refresh the page, or add a Let me know if I should add this action to this pull request, or if we should do it later. And whether we should switch branches, etc (I had to manually point GH Pages to use -Bruno |
Rebased. Note that the Netlify build won't work as it is not configured for Sphinx (it's probably configured for Jekyll). |
@kinow thanks for the updates! https://kinow.github.io/user_guide/reference.html has some template errors But honestly, it is not really useful. Maybe better to remove from this version? https://kinow.github.io/user_guide//yaml/#yaml-guide has a link error Other than that, this looks almost ready to publish! |
Thanks for the review @mr-c ! Will update it in the morning (in ~8 hours) 👍 |
@mr-c I removed the Reference page, and then thought that YAML link would be quick to fix… I can confirm the Then I had a look, and there are links like that in lessons too 😥 My guesses now are
If it's a bug in MyST, we can probably work around it by defining a function for parsing links (that's doable in Sphinx, even when using something like MyST for parsing Markdown). Doing some detective work now 🔍 Thanks! |
References page and menu entries pointing to it (and another resource that's not used I think) removed 👍 |
…ments (syntax highlight)
Fixed reference links (the Finally, also fixed a couple typos, and added the syntax highlighting to commands. Note that we can use Pending now is fix the long menu that appears in responsive mode, when browsing lessons. Then push everything to my fork to get it deployed to GH Pages. Compare with Read The Docs, and then hand over to @mr-c 😬 @mr-c I think others have the same complaint/issue that we have here: pydata/pydata-sphinx-theme#726 Will continue in the morrow. |
@mr-c , I re-read the PyData sphinx theme docs, and from what I understood, there are three columns in the theme by default. The left sidebar contains, by default, the search and the list of pages in the same level of the currently visualized page (defined by a And the sidebar contains the section links (headings) within the page. Their docs use that format: https://pydata-sphinx-theme.readthedocs.io/en/latest/index.html In the Episodes page ( Then, in the meantime, I added the last commit that has a work around to hide the left sidebar when we open on mobile 😬 WDYT? That's definitely not perfect, but that should allow users to navigate the user guide without being too distracted by that long list. Mobile users will have to resort to clicking on Previous / Next, or toggling the menu and clicking on Episodes, but I guess that should be fine? If that's OK, then I believe this is ready for review. I've fixed all the Sphinx build errors today (we cannot use headings like RTD has built the latest commit, and I pushed it to my fork, so GH-pages is up to date as well.
I went through every page in the navigation, checking if it "looked" good, then opened the source code, confirmed everything looked OK. Feel free to take over if you'd like, and change the branch names, deployment options, netlify, RTD, etc 🙂 And also let me know if you need any help, please. Thank you! |
Accepted and merged to the new |
Part of #219
This pull request is only a port of the user guide as-is to Sphinx + Markdown (structure). Other PR's will be created to modify the documents and work on the existing issues (content.)
Based on the documentation of JupyterHub, which renders both Markdown and rst, but also produces an epub, has spellchecking, and other goodies that we can copy if needed (I'll drop a thank you in their chat room once it's done.)
I used the same Sphinx theme too, as it's used in several PyData projects, so I guess many users of CWL might be already familiar and comfortable with this theme. It's also not too different than the original, but its look n' feel looks better I think? Will add a preview in the comment below.
% text
in MyST)```{note|warning}```
in MyST)```{include} dir/file.md```
in MyST)WARNING: Pygments lexer name 'cwl' is not known
, and I fixed it for now using theYamlLexer
for CWL files 😐GH actions, etc (users must see a preview too)Footnotes
https://github.com/github/feedback/discussions/7730 ↩
https://github.com/rossjrw/pr-preview-action ↩