-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Spaghetti Time! #458
Comments
@azerupi or @budziq, let me know if you can think of other places which could do with a little refactoring/cleanup. Also, would it be a good idea to post this issue to the Call For Participation thread on the user forums? |
I am interested in working on these issues. I am new to Rust so I would need some mentoring. |
@markcol sure! Anyways, if you need any assistance, don't hesitate to ping me or @Michael-F-Bryan on this issue or on a work-in-progress PR and we will guide you as best we can. Good luck! |
@markcol, one of the things I've been wanting to do is convert update our command line argument parsing from using raw clap to structopt. That should help tidy up a lot of the messy code to do with arguments in the I'm planning to go through the HTML renderer and restructure it soon, so it's probably not worth addressing the two |
@Michael-F-Bryan, mind if I give the clap -> structopt conversion a go? |
Sure thing. If you open a PR and prefix its title with "WIP:" we can review your code as you are going and it'll also give us a place to discuss and ask/answer questions. |
@Michael-F-Bryan are there any more items along these lines? I'm just learning Rust and am itching to get my hands dirty. However, I'm more of an embedded systems guy than a web / HTML / js guy. |
@mwilbur I think the easiest way to get into things would be to simply skim through the code base and if you see a spot that's messy/hard to understand, try to clean it up a little bit. This helps learn how to understand other people's code and you can see what Rust looks like in a "real" codebase... Plus it helps us by cleaning up some accumulated technical debt 😜 I wouldn't be worried about not having much web/HTML experience. If anything, you could almost think of
Sure one of the renderers spits out HTML based on a couple templates, but that's just an implementation detail and there are other 3rd party renderers which may do other things with the book (e.g. mdbook-linkcheck, [termbook-cli] or mdbook-epub). |
Is it okay to rewrite |
I think that part of the code hasn't really fundamentally changed since the early beginning. It would definitely benefit from some refactoring. The code from Zola is really clean, if we can get something close to that it would be a big improvement. If you want to tackle this, I would say go for it! 🙂 |
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:
trigger_on_change()
is doing a bit too much and should be broken out into smaller functionsThere 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.
The text was updated successfully, but these errors were encountered: