nx-guides
nx-guides copied to clipboard
Notebook on Lowest Common Ancestor
Hello @MridulS , I am continuously getting the following error:
make: *** [Makefile:20: html] Error 1
Do you have any idea about what could be the reason?
@dtekinoglu You need to include the content in nx-guides/content/algorithms/index.md
Thank you! @inomag
Hi @dtekinoglu, I am not sure what is wrong here but I think you can make the following changes -
- Instead of using images in base64 form, you can directly save the static images in a images folder in the same location and use them (Not the ones generated by code)
- You have written
!pip install pydotin the code, which might cause some problems. Include the necessary dependencies inrequirements.txt
@dtekinoglu Hmm there are some weird markdown cells here. Can you try running this on your notebook?
$ jupytext notebook.ipynb --to myst
and then push it here?
Thanks!
Thank you @MridulS it passes the checks now 😄 I initally included a quiz cell which requires user input, but I thought that it is not supported. Thus, I removed that part. Am I correct? Do you suggest me to add it back?
I initally included a quiz cell which requires user input, but I thought that it is not supported. Thus, I removed that part. Am I correct?
Yeah we are not that fancy just yet! For now let's just keep narrative notebooks for our users :)
You can check the doc build here https://output.circle-artifacts.com/output/job/427d7bcf-0a12-412e-af58-618e4985f1e2/artifacts/0/site/_build/html/content/algorithms/lca/LCA.html
Please do checkout the suggestions by @inomag, they should help with cleaning up the output :)
@MridulS how can I apply lint pre-commit changes for the notebooks?
@dtekinoglu I pushed the changes required to make the linters happy. It needs to run the pre-commit linters on the jupyter notebook (.ipynb) before converting it to myst.
# The following commands finds ALL the .md files in the repository
$ find content/ -name "*.md" -exec jupytext --to notebook {} \;
# Run pre-commit on all files
$ pre-commit run --all-files --show-diff-on-failure --color always
# Convert all the new "cleaned" ipynb files to myst
$ find content/ -name "*.ipynb" -exec jupytext --to md:myst {} \;
# Remove the .ipynb files
$ find content/ -name "*.ipynb" -exec rm {} \;
After this you should see the changes the linters made inside the markdown myst files. I know this isn't an ideal workflow but currently nbqa doesn't natively support myst format.
@dtekinoglu well finally did the review :) I'll go ahead and merge this. Thanks for your contributions :)