Skip to content
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

Automatizing the conversion of jupyter examples to rst #105

Merged
merged 4 commits into from
Dec 4, 2023

Conversation

mohammadamint
Copy link
Collaborator

Fix #104
Closes #104

To address the concern raised in the tedious work of converting the Jupyter Notebook files into .rst for documentation.

The new script will automatically convert the files into the right directory, however, the inclusion of the examples in the doc should be always controlled in docs/source/examples.rst by specifying the path of the example in the toctree

when an  example is updated in jupyter notebook files, the script can be
used to automatically convert the jupyter files in notebooks folder to
rst files saved to source/examples for the documentaiton

changes:
	1. docs/notebooks_convert.py: the script to read the jupyter
	   files, convert them to rst and save them into example folder
	2. docs-requirements.py: updating the requirements with nbformat
	   and nbconvert needed for the conversion
Copy link
Collaborator

@Bachibouzouk Bachibouzouk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @mohammadamint, I like it

I only suggested to use os.path.join instead of building the path with / as os.path.join is cross platforms, but this is a minor correction you might ignore if you want :)

In the "Files changed" tab you can add all the suggestion to a batch and commit them as one commit if you want

replacing f"{}/{}" with ps.path.join

Co-authored-by: Pierre Francois <[email protected]>
@mohammadamint
Copy link
Collaborator Author

Nice work @mohammadamint, I like it

I only suggested to use os.path.join instead of building the path with / as os.path.join is cross platforms, but this is a minor correction you might ignore if you want :)

In the "Files changed" tab you can add all the suggestion to a batch and commit them as one commit if you want

Done!

@Bachibouzouk
Copy link
Collaborator

The tests are failing because maybe you don't have the same black version as in github actions?

@Bachibouzouk
Copy link
Collaborator

I would merge it, are you waiting for @FLomb's approval @mohammadamint ?

@mohammadamint
Copy link
Collaborator Author

I would merge it, are you waiting for @FLomb's approval @mohammadamint ?

We can go ahead! I am traveling, that is why I was a little bit silent!

@FLomb
Copy link
Contributor

FLomb commented Dec 4, 2023

Does this mean we should delete the manually-written .rst files that exist in the docs right now?

Other than this question, I'm happy to merge this automation so that we may also finalise PR #102 and then PR #100

@mohammadamint
Copy link
Collaborator Author

Does this mean we should delete the manually-written .rst files that exist in the docs right now?

Other than this question, I'm happy to merge this automation so that we may also finalise PR #102 and then PR #100

No we dont need this. The script wont automatically run. Every time we update something in Jupyter files, we need to run the script to replicate all the changes into rst files.

When merging, we need to just be careful that all the new changes on jupyter files will be implemented on top of this.

Copy link
Contributor

@FLomb FLomb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've tested this locally, and it worked without issues. I'm merging this already

@FLomb FLomb merged commit 21e96dc into development Dec 4, 2023
3 checks passed
@FLomb FLomb deleted the ipynb_to_rst branch December 4, 2023 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants