Open
Description
As mdbook has grown and gained features over time, a couple bits and pieces have suffered from rightward drift or turned into spaghetti code. I'm noting down a list of problem areas which need a little TLC.
This is just standard refactoring and code cleanup, so would be great as a first contribution.
If you want to help with the cleanup, make a comment here so we can assign it to you. I'm also available to mentor if needed.
Individual modules which could do with some cleanup:
- mdbook::renderer::html_handlebars::helpers::navigation - several 80+ line functions and lots of rightward drift (fixed in Refactor navigation helpers #465)
- mdbook::renderer::html_handlebars::helpers::toc - the entire module is one long 100+ line method (Use template to generate TOC #467)
- mdbook::renderer::html_handlebars::hbs_renderer - several long functions which could be broken up into smaller steps/methods
- mdbook::bin::serve - argument parsing and execution should be broken out into two separate steps
- mdbook::bin::watch -
trigger_on_change()
is doing a bit too much and should be broken out into smaller functions - Clippy warnings (Fix last clippy warnings #469)
There is already a PR which runs rustfmt over the repo (#438, cheers @prertik!).
There are also existing PRs for the configuration (#457) and book (#409) modules.