-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Auto-Generating Tutorials Page #1757
Conversation
Before a pull request is accepted, it must meet the following criteria:
|
Codecov Report
@@ Coverage Diff @@
## master #1757 +/- ##
==========================================
- Coverage 62.45% 58.45% -4.00%
==========================================
Files 64 66 +2
Lines 5985 6687 +702
==========================================
+ Hits 3738 3909 +171
- Misses 2247 2778 +531
Continue to review full report at Codecov.
|
|
So to your first point, I could not figure out a way to do this through For the second point I can revert that commit. I am purely wondering though, since |
Just copy and paste the script content at the end of |
abad06e
to
8903c13
Compare
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.
This looks like a great addition - I think your code can be improved a bit (see my comments). Besides we use f-strings in most of TARDIS modules since they're more readable so please use them over strings concatenation - it'll also save you from adding \n before, after your variables (like title
, description
) since you can put them as f"{title}\n{description}\n"
Apart from this, I was wondering if we can reorder notebooks in list meaningfully or perhaps make the not-so-informative list of notebooks a bit more informative (& attractive 😄 ) by adding relevant visuals (for e.g. how einsteinpy does it)
I don't see why it's necessary to add |
It definitely needs to be in |
If the file is not committed then it's not on the repository. It's just on your computer marked as "untracked". There's nothing wrong with that (it's the same situation with ZENODO.rst) |
Personally, I think it makes it more clear that we do not want it in the repo to have it in the |
@epassaro I removed any edits to |
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.
Thanks for making changes - code looks lot neater now. Though you forgot to address my comment about using f-strings!
That's definitely wrong IMO @epassaro. Why? Because some new contributor built docs to add a page locally and tutorials.rst will get generated and they'll likely commit all the files together. In general, almost auto-generated files should be gitignored. You can notice same for |
That was my thinking as well. |
I think we will discuss the |
@smithis7 @jaladh-singhal @epassaro my main criticism of the PR is that I do not think that is how files should be generated in the Sphinx API (I might be wrong). It feels very hacky to add this to the |
@wkerzendorf how I did it is the same way we generate the zenodo file. I can use the link you suggested, but that involves (pretty messy IMO) changes to the |
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 1.42%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
@wkerzendorf how is this implementation? This is the more "official" way of doing it, by hooking into the sphinx build process. See https://www.sphinx-doc.org/en/master/extdev/appapi.html#events |
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.
@smithis7 looks good to me except I think you must add tutotrials.rst
to gitignore in this same PR.
@epassaro please read this https://www.atlassian.com/git/tutorials/saving-changes/gitignore - tutorial.rst is generated at runtime and we don't want users who have built docs locally to accidentally commit it.
- files generated at runtime, such as .log, .lock, or .tmp
@wkerzendorf I don't think we have a better way for this not-so-common usecase. Also now that @smithis7 has hooked this function to build initiation event of sphinx, I can confirm this is right way to do it because I used same approach to create redirects in #1458: Line 361 in 6a0b8db
|
Description
I have created a script that, when we build the documentation, generates an rst file that links to all of the TARDIS tutorials. I probably have not implemented the most elegant way to run the script, so if anyone has a better way of getting it to run please let me know.
While I was changing the sidebar, I moved the API section in the sidebar. I thought it would be rather silly to make that a PR on its own, and it vaguely had to do with this PR.
I made it its own commit, however, so if I need to remove that commit I will. I also addedZENODO.rst
to.gitignore
while I was addingtutorials.rst
to.gitignore
for the same reason.Motivation and context
My goal was to create a page that lists all of the tutorials in TARDIS, which will automatically update when we add in a new tutorial (noting that all of our tutorials are under
docs/io
).How has this been tested?
Examples
See built documentation:
https://smithis7.github.io/tardis/branch/tutorials_doc/index.html
Type of change
Checklist