-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feature request: automatically generate SUMMARY.md from the list of src/*.md files #1016
Comments
Are you proposing that titles are generated from the slugged filenames? That feels a bit limiting. A possible alternative might be to take the ordering from filenames, but titles from the top-level headings in each file. |
Hi, sorry if it wasn't clear. I was suggesting that the chapter or section title could be parsed from the top-level heading of each markdown file. I was able to prototype this in a crude way in Python. So I think this could be doable in Rust as well, though I'm not familiar with markdown parsing. |
Hi, I've been wanting this as well, but I've had trouble figuring out what the title should be for the folders. By title I mean the text used for the links in the summary. I tried getting around the problem by assuming there's a file in each folder called This is a PoC combining my concerns with what I understood yours to be. Can you try it out and give your input? |
I like this feature, which provides a pretty good basis for migration. |
@PsiACE Since OP seems to have disappeared, could you have a look at my PoC (above your comment) and tell me what you think? |
I'll try it later. Thank you so much for your work. |
I have a python script that does this very thing. But you need to adopt my file naming convention to test it out immediately. Then you would need to change the convention to whatever you need. Right now, it just generates the title from the filename. So garlic-cheese-foccia-bread.md gets printed to the summary with the title "Garlic Cheese Foccia Bread". Nice and simple. I use it maintain a large cooking recipe book (~300 pages) - so I can drop files into the right chapter directory, and then deploy to gh-pages with a dumb makefile that runs the summary generator as part of the deploy sequence - so just look in my recipes repo to find it. It's terrible recursive python code, so if it needs a refactor to rust, then I understand why - but I don't know rust. ;) |
I just stumbled on this one: https://github.com/dvogt23/book-summary |
It would be nice if there is an option to generate
SUMMARY.md
automatically from the list of markdown files undersrc
(exceptSUMMARY.md
itself). The generatedSUMMARY.md
would map the directory structure. For example, if I have chapters and sections organized in subfolders,the generated
SUMMARY.md
could be look likeThe advantage of this feature would be to save the effort of manually checking if every chapter/section is included in
SUMMARY.md
.The text was updated successfully, but these errors were encountered: