-
Notifications
You must be signed in to change notification settings - Fork 63
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
added create_tutorials_html.py and tutorials.html.jinja #207
Conversation
Hello @BoxiLi ! |
The plot you show looks great! Maybe one can create a separate folder under And yes it would be great to add this to the build logic. You may need to add the new packages to |
I have created a folder and added the libraries to requirements.txt |
The |
I get the following error when I run make html SPHINX OPTS= "W" |
I should be |
this is the error I get now, not related to what I have modified |
This is probably because you installed the release version of qutip-qip, but try to render the doc in the master branch. Maybe try installing the master branch version first. |
worked thanks!
File "tutorials.rst" and "tutorials-v5.rst" is generated using the same .jinja template. Sphinx is treating the v5 as a duplicate although the links are different. For now, I'll just remove tutorials_v4.rst. And also there's another caveat, GitHub API requests have a rate limit of 1000 requests per hour for an unauthenticated user which means I can only run the script twice every hour (create_tutorials_html.py). I had looked for other ways to sync up the tutorials like Git submodules, Git subtree etc, but they required duplication of files inside this repo. |
removing v4 builds without any error, how to remove .DStore, tutorials.rst from the commit tho? |
removed XP |
Ok, didn't expect that. If GitHub action belongs to the "authenticated user", you can push things to your fork (e.g. master, but remember to reset it back to upstream after this) and let GitHub action in your fork test things. Yes Looks like a successful build! |
One question, is |
manually at the moment |
running create_tutorials_html.py more than twice will throw an error, so if this is added to the build logic make html will also be throwing an error if its run more than twice ig . |
every function in the create_tutorials_html.py has get(url) : sends multiple get requests to the qutip-tutorials |
Ok, so the main problem is the It is fine if the files are copied, the key point is that they are only stored temporarily and not pushed to the |
This should work, but we wanted the links to automatically sync with the qutip-tutorials repo. Temp dir is created by cloning qutip-tutorial, so the links will not be in sync with new changes. |
I think I missed something here so I don't really get it. Given that
Every time the doc is built, it uses the newest links of the tutorials, right? This should be sufficient, as long as we trigger the build every week/day. In the end, even with |
yeah thanks for the clarification I have a pending question. Where are the files that generate the other .rst files in the source folder? I don't completely get how they are generated by Sphinx. |
None of the |
yes |
yup |
@BoxiLi this works as expected. This can be merged now ig |
Thanks! I'll add a few fine-tuning comments in a day or so. Right now, however, if I click on the generated links to the notebook, I get 404 error. Did something go wrong with the links? If you want to check, you can download the generated HTML in the action artefacts https://github.com/qutip/qutip-qip/actions/runs/5259223981?pr=207. |
It is ok if the list is only generated for qutip v5, but could you add the link of the main v4 tutorial page (https://qutip.org/qutip-tutorials/) to the sentence
|
@BoxiLi The links should be working now |
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.
Nope, something is still missing. I guess a /
after tmp
?
now? |
@BoxiLi Do you have any feedback? |
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.
Here you go. Looks pretty good! A few minor changes. Thank you very much.
Could you also add pandoc
to contribution-docs.rst
@BoxiLi You want me to add something like this ? A few .rst files are generated runtime from html files using the pandoc https://pandoc.org_ tool. |
Yes, something like So that people know that they need to install it and how. |
alright, done |
Automatically generating the tutorial list
@BoxiLi so, this is not pushed to the stable version of the doc? need more changes or additional issues to be resolved? |
I'm open to contribute more |
Well spotted! It is missing from the rendered version on readthedoc indeed. Didn't notice it... I opened an issue #219. Will have a closer look in the next few days but of course you are also welcome to dig a bit into it. |
Automatically lists qutip-qip tutorials in doc #204
Description
Added a Python script (create_tutorials_html.py) to list tutorials from qutip-tutorials repository
Running
make html
will run the script which in turn will clone qutip-tutorials directory into a temporary directory, fetch tutorials, generate HTML and tutorials_v5.rst files and finally wipe off the temporary directory.Files generated runtime
HTML : doc/source/tutorials-website/qutip-qip.html and doc/source/tutorials-website/qutip-qip_v5.html
RST : doc/source/tutorials_v5.rst
Old Description
Added a Python script create_tutorials_html.py to fetch tutorials from qutip-tutorials repository and display it here. Used GitHub APIs to fetch the files. The script automates linking and syncing the tutorial files in qutip-tutorials with the qutip-qip repo.
I have pushed the generated tutorials.rst file as well. So, by cloning and running make HTML, you should be able to view the tutorials page with tutorials in qutip-tutorials as of today. Changes in the tutorials directory can be synced by running the script.
Steps to reproduce/sync
This should create qutip.qip.html and qutip-qip-v5.html in the tutorial-websites dir and tutorials.rst and tutorials-v5.rst in the source directory. (Source dir hosts individual .rst files that render as HTML files)
cd ../..
and runThis should create the _build file in the doc directory. Navigate to tutorials.html to view the file
To-Do
html make
is called.Caveats
Can only run the script twice per hour due to rate limits (1000 requests per hour )on the number of GitHub API requests an unauthenticated (No access rights to the repo ) user can make