-
Notifications
You must be signed in to change notification settings - Fork 98
Faster doc building by decoupling Literate.jl and Documenter.jl #1208
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
base: master
Are you sure you want to change the base?
Faster doc building by decoupling Literate.jl and Documenter.jl #1208
Conversation
mfherbst
left a comment
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.
Nice, thanks for the starting point. Let's see what CI says.
| @debug "Processing" file.src file.dest | ||
| # Skip all flies that did not change since last build | ||
| if mtime(file.src) <= mtime(file.dest) && !DEBUG | ||
| @debug "Skipping up-to-date file" | ||
| continue | ||
| end |
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.
Could handle debug printing more elegantly here by printing a different message depending on the mtime check.
| file.src, file.dest; | ||
| flavor=Literate.DocumenterFlavor(), | ||
| credit=false, | ||
| preprocess=add_badges(badges), |
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.
The only reason to have the badges was to have the links to the binder platform for executing ipynb notebooks online. If we drop ipynb generation, we can drop the add_badges business, too.
| end | ||
| end | ||
| end | ||
| # if !DEBUG |
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.
On purpose ?
|
@nathanaelbosch I added a new todo to just add a sentence to the developer docs once this feature is ready. |
This PR implements the suggested adjustments from #1206, plus some additional minor things.
The major change is that code execution is now handled by Literate.jl, instead of Documenter.jl. This enables the functionality of this PR, to only run code of selected files, while including all other files without any code execution.
The logic to determine which scripts to execute is now the following:
JL_FILES_TO_EXECUTE = :ALLthen all files are run.JL_FILES_TO_EXECUTEis a list of filepaths, then only those files are executed, and all other ones are included without any code execution. This can be helpful to work on a particular file, or even just to iterate quickly when working on text or structure.Overall I'd hope that this enables a much easier development workflow to work on the docs.
Additional changes:
@debugstatements: This is just something I found helpful while writing the PRdraft=truefor faster development: This seems to be one of these things that can sometimes be hard to find, but which are very helpful for people when they work on the documentation. I therefore added a small comment inmakedocssuch that people can find this setting quickly if they need it.I'm happy to keep or remove these as you prefer.
Things that are left to do:
mastertoo..gitignore: I did not yet make sure that the.gitignoreis aware of all the generated.mdfiles that are now kept around. I'm not quite sure what the most elegant way is to solve this.size_threshold_warn=nothingto reduce the number of warnings?