|
| 1 | +mdBook |
| 2 | +====== |
| 3 | + |
| 4 | +.. meta:: |
| 5 | + :description lang=en: Learn how to host mdBook documentation on Read the Docs. |
| 6 | + |
| 7 | +`mdBook`_ is a command line tool to create books with Markdown. |
| 8 | + |
| 9 | +Minimal configuration is required to build an existing mdBook project on Read the Docs. |
| 10 | + |
| 11 | +.. code-block:: yaml |
| 12 | + :caption: .readthedocs.yaml |
| 13 | +
|
| 14 | + version: 2 |
| 15 | +
|
| 16 | + build: |
| 17 | + os: ubuntu-lts-latest |
| 18 | + tools: |
| 19 | + rust: latest |
| 20 | + commands: |
| 21 | + - cargo install mdbook |
| 22 | + # For an example book.. |
| 23 | + # - mdbook init docs |
| 24 | + - mdbook build docs --dest-dir $READTHEDOCS_OUTPUT/html |
| 25 | +
|
| 26 | +.. _mdBook: https://rust-lang.github.io/mdBook/ |
| 27 | + |
| 28 | +Getting started |
| 29 | +--------------- |
| 30 | + |
| 31 | +- If you have an existing mdBook project you want to host on Read the Docs, check out our :doc:`/intro/add-project` guide. |
| 32 | +- If you're new to mdBook, check out the official `Getting started with mdBook`_ guide. |
| 33 | + |
| 34 | +.. _Getting started with mdBook: https://rust-lang.github.io/mdBook/guide/creating.html |
| 35 | + |
| 36 | +Configuring mdBook and Read the Docs Addons |
| 37 | +------------------------------------------- |
| 38 | + |
| 39 | +Adjust the flyout menu font size |
| 40 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 41 | + |
| 42 | +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, |
| 43 | +so that the font in the :ref:`flyout-menu:Addons flyout menu` matches the theme better. |
| 44 | + |
| 45 | +.. code-block:: css |
| 46 | + :caption: readthedocs.css: |
| 47 | +
|
| 48 | + :root { |
| 49 | + /* Increase the font size of the flyout menu */ |
| 50 | + --readthedocs-flyout-font-size: 1.3rem; |
| 51 | +
|
| 52 | + /* Increase the font size of the notifications */ |
| 53 | + --readthedocs-notification-font-size: 1.3rem; |
| 54 | +
|
| 55 | + } |
| 56 | +
|
| 57 | +Example repository and demo |
| 58 | +--------------------------- |
| 59 | + |
| 60 | +Example repository |
| 61 | + https://github.com/readthedocs/test-builds/tree/mdbook |
| 62 | + |
| 63 | +Demo |
| 64 | + https://test-builds.readthedocs.io/en/mdbook/ |
| 65 | + |
| 66 | +Further reading |
| 67 | +--------------- |
| 68 | + |
| 69 | +* `mdBook documentation`_ |
| 70 | + |
| 71 | +.. _mdBook documentation: https://rust-lang.github.io/mdBook/ |
0 commit comments