-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Add mdbook docs page #11849
Add mdbook docs page #11849
Changes from all commits
bf5162f
3237134
9779094
9d63e24
cb5f63f
c59f5c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
mdBook | ||
====== | ||
|
||
.. meta:: | ||
:description lang=en: Learn how to host mdBook documentation on Read the Docs. | ||
|
||
`mdBook`_ is a command line tool to create books with Markdown. | ||
|
||
Minimal configuration is required to build an existing mdBook project on Read the Docs. | ||
|
||
.. code-block:: yaml | ||
:caption: .readthedocs.yaml | ||
|
||
version: 2 | ||
|
||
build: | ||
os: ubuntu-lts-latest | ||
tools: | ||
rust: latest | ||
commands: | ||
- cargo install mdbook | ||
# For an example book.. | ||
# - mdbook init docs | ||
- mdbook build docs --dest-dir $READTHEDOCS_OUTPUT/html | ||
|
||
.. _mdBook: https://rust-lang.github.io/mdBook/ | ||
|
||
Getting started | ||
--------------- | ||
|
||
- If you have an existing mdBook project you want to host on Read the Docs, check out our :doc:`/intro/add-project` guide. | ||
- If you're new to mdBook, check out the official `Getting started with mdBook`_ guide. | ||
|
||
.. _Getting started with mdBook: https://rust-lang.github.io/mdBook/guide/creating.html | ||
|
||
Configuring mdBook and Read the Docs Addons | ||
------------------------------------------- | ||
|
||
Adjust the flyout menu font size | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Add a ``readthedocs.css`` to your build with the `additional-css <https://crisal.io/tmp/book-example/book/format/config.html#html-renderer-options>`_ flag, | ||
so that the font in the :ref:`flyout-menu:Addons flyout menu` matches the theme better. | ||
|
||
.. code-block:: css | ||
:caption: readthedocs.css: | ||
|
||
:root { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @humitos This worked nicely in my test: https://test-builds.readthedocs.io/en/mdbook/ But it seems like the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks great! I remember having a similar issue with Material for MkDocs. They ended up fixing the issue on their side by skipping handling the keydown if the focus was inside a text input. The options I see here are:
I'm not sure if that's possible, tho. |
||
/* Increase the font size of the flyout menu */ | ||
--readthedocs-flyout-font-size: 1.3rem; | ||
|
||
/* Increase the font size of the notifications */ | ||
--readthedocs-notification-font-size: 1.3rem; | ||
|
||
} | ||
|
||
Example repository and demo | ||
--------------------------- | ||
|
||
Example repository | ||
https://github.com/readthedocs/test-builds/tree/mdbook | ||
|
||
Demo | ||
https://test-builds.readthedocs.io/en/mdbook/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should add custom CSS files to make the flyout looks nice; it's pretty small now: See an example for MkDocs: https://docs.readthedocs.io/en/latest/intro/mkdocs.html#adjust-the-flyout-menu-font-size |
||
|
||
Further reading | ||
--------------- | ||
|
||
* `mdBook documentation`_ | ||
|
||
.. _mdBook documentation: https://rust-lang.github.io/mdBook/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried using
build.jobs.build.html
instead? I think we should be recommending as much as possible that approach.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't, but thought this was blocked on #11819