Welcome stranger!
If you have come here to learn how to contribute to mdBook, we have some tips for you!
First of all, don't hesitate to ask questions! Use the issue tracker, no question is too simple.
Any issue is up for the grabbing, but if you are starting out, you might be interested in the E-Easy issues. Those are issues that are considered more straightforward for beginners to Rust or the codebase itself. These issues can be a good launching pad for more involved issues. Easy tasks for a first time contribution include documentation improvements, new tests, examples, updating dependencies, etc.
If you come from a web development background, you might be interested in issues related to web technologies tagged A-JavaScript, A-Style, A-HTML or A-Mobile.
When you decide you want to work on a specific issue, ping us on that issue so that we can assign it to you. Again, do not hesitate to ask questions. We will gladly mentor anyone that want to tackle an issue.
Issues on the issue tracker are categorized with the following labels:
mdBook builds on stable Rust, if you want to build mdBook from source, here are the steps to follow:
Navigate to the directory of your choice
Clone this repository with git.
git clone https://github.com/rust-lang/mdBook.git
Navigate into the newly created mdBook
directory
Run cargo build
The resulting binary can be found in mdBook/target/debug/
under the name mdbook
or mdbook.exe
.
We love code quality and Rust has some excellent tools to assist you with contributions.
Before you make your Pull Request to the project, please run it through the rustfmt
utility. This will ensure we have good quality source code that is better for us all to maintain.
rustfmt has a lot more information on the project. The quick guide is
rustup component add rustfmt
rustfmt
on a single file simply by...rustfmt src/path/to/your/file.rs... or you can format the entire project with
cargo fmtWhen run through
cargo
it will format all bin and lib files in the current crate.For more information, such as running it from your favourite editor, please see the rustfmt
project. rustfmt
Clippy is a code analyser/linter detecting mistakes, and therefore helps to improve your code. Like formatting your code with rustfmt
, running clippy regularly and before your Pull Request will help us maintain awesome code.
The best documentation can be found over at rust-clippy
rustup component add clippy
cargo clippy
Clippy has an ever growing list of checks, that are managed in lint files.
When you feel comfortable that your changes could be integrated into mdBook, you can create a pull-request on GitHub. One of the core maintainers will then approve the changes or request some changes before it gets merged.
If you want to make your pull-request even better, you might want to run Clippy and rustfmt on the code first. This is not a requirement though and will never block a pull-request from being merged.
That's it, happy contributions! :tada: :tada: :tada:
Currently we don't have a strict browser compatibility matrix due to our limited resources. We generally strive to keep mdBook compatible with a relatively recent browser on all of the most major platforms. That is, supporting Chrome, Safari, Firefox, Edge on Windows, macOS, Linux, iOS, and Android. If possible, do your best to avoid breaking older browser releases.
Any change to the HTML or styling is encouraged to manually check on as many browsers and platforms that you can. Unfortunately at this time we don't have any automated UI or browser testing, so your assistance in testing is appreciated.
The following are instructions for updating highlight.js.
10.1.1
).npm install
node tools/build.js :common apache armasm coffeescript d handlebars haskell http julia nginx properties r scala x86asm yaml
syntax-highlighting.md
. If any are missing, add them to the list and rebuild (and update these docs). If any are added to the common set, add them to syntax-highlighting.md
.build/highlight.min.js
to mdbook's directory highlight.js
.