-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add a way to ignore the source link file present in the SUMMARY.md while including the link. #2573
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
Comments
How do you combine the autogenerated part today? If I understand you correctly you could include empty md-files as placeholders for the html files and once |
Yes it would solve my issue but the problem arise when i do a |
I made a pr that adds a way for me to hook into the serve process and run a script. Works perfectly 😄 Now we wait for a review... |
Thanks for the suggestion! However, this seems like a duplicate of #919. I don't think making the webserver hookable is an approach I would want to take. The webserver is intended only for local development, and thus any integration wouldn't be appropriate for deployment. |
If I understand correctly, this should not make the webserver hookable. This would add a post-processing step that runs after all the output-processors ran. |
Yes that is the intended use.
To be more clear, the problem with the serve command is i can't easily make my post process step run after the watcher rebuilds the book. But its way simpler for build This would allow use cases like including generated markdown and html in the book: ./include-generated-md-files.sh && \ # include md files in the src directory
mdbook build && \
./include-generate-html-files.sh # patch the html files in the book and mdbook serve --pre-build "./include-generated-md-file.sh" --post-build "./include-generated-html-files.sh" |
I actually have a case that might be similar to this. In the https://mdbooks.code-maven.com/ project all the So I run Where This conversation now encouraged me to try to setup a different way so I ran
and this seem to solve the problem for me. (And I just noticed that cargo watch is now archived: https://github.com/watchexec/cargo-watch so maybe I'll need another solution.) |
Problem
I want to add an auto generated part of a documentation that I am writing but the tool I am using generates HTML so i want to have a link to the page generated by the tool in the sidebar. Problem the book won't build because the source doesn't exist.
Proposed Solutions
Solution 1: Add a syntax to the SUMMARY parser to make it so it will ignore the file behind the link but generate the the link .
Solution 2: If the link is not a
md
file it inserts the link into the sidebar without checking for a file in the source directory and leave it to the user to ensure the file at the link destination is present in the output directory.Solution 3: Add a way to hook into the serve process to have a post build script run before the files are served where i can fix the generated part with a bash script.
Notes
Currently to include my generated part i put an empty
index.md
file where theindex.html
would end up in the finished build but the problem arise when runningmdbook serve
where the generated HTML is systematically replaced by the empty file.The text was updated successfully, but these errors were encountered: