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

"Makefile" like capability for Literate examples? #226

Open
JeffFessler opened this issue Sep 8, 2023 · 4 comments
Open

"Makefile" like capability for Literate examples? #226

JeffFessler opened this issue Sep 8, 2023 · 4 comments

Comments

@JeffFessler
Copy link
Sponsor

I have a repo with over 30 Literate demos for a textbook, and no source code under src/.
https://github.com/JeffFessler/book-mmaj-demo
Every time I edit one of the demos, the Literate/Documenter build reruns all 30+ demos, which takes a long time and might be related to my time-out issue #225.
Is there a way to set up the repo / yaml files / make.jl so that it behaved more like a Makefile would, where the workflow would only rerun the demos that have changed, instead of all of them?
(I've studied the docs for Literate and Documenter and could not find an answer.)
Such a capability could reduce a lot of CO2... Ideas?

@fredrikekre
Copy link
Owner

Are you aware of Documenters draft mode? draft = true to makedocs(...).

@JeffFessler
Copy link
Sponsor Author

Yes, I sometimes use that and expandfirst when I am debugging locally. But then when it is ready I push to github (without those debugging flags) and make a PR and the github actions build and rerun all the demos, most of which have not changed, wasting CPU time in the cloud. Which is why I was asking if there was a way to set up the Documenter.yaml or make.jl or such to be smarter about it in the cloud.

There is one brute-force option I've considered, which is to put every demo in its own repo, because then only one demo at a time would get built by github actions. That would be a maintenance pain though...

Another option might be to have one repo with a separate "subpackage" for each demo, each with its own docs/ and make.jl or such. I haven't found any examples of this approach though so not sure how to put it all together. Have you seen any examples of a single repo with multiple subpackages in it with partially separate Lit/Doc builds?

(Note to self, I might run into this issue: JuliaDocs/Documenter.jl#319)

@mortenpi
Copy link
Contributor

So the expensive running of the examples are done with Literate, since you pass execute=true generally, right? You could probably invent something where you cache the .md files produced by Literate with GitHub artifacts. But you'd have to add the necessary logic into make.jl and your GitHub workflows.

@JeffFessler
Copy link
Sponsor Author

Cool idea - thanks for the tip! I will look into that.
And yes, it is the Literate execute that takes the bulk of the time.

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

No branches or pull requests

3 participants