2.6 KiB
2.6 KiB
Welcome to MkDocs
For full documentation visit mkdocs.org.
Installation:
$ pip install mkdocs
Commandes:
mkdocs new [dir-name]- Create a new project.mkdocs serve- Start the live-reloading docs server.mkdocs build- Build the documentation site.mkdocs help- Print this help message.gh-deploy- Deploy your documentation to GitHub Pages.
Project layout:
mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
Créer un nouveau projet de docs:
bruno@SilverBook:~$ mkdocs new project
INFO - Creating project directory: project
INFO - Writing config file: project/mkdocs.yml
INFO - Writing initial docs: project/docs/index.md
bruno@SilverBook:~$ cd project
total 8
drwxr-xr-x 4 bruno staff 128 16 déc 20:48 .
drwxr-xr-x@ 70 bruno staff 2240 16 déc 20:48 ..
drwxr-xr-x 3 bruno staff 96 16 déc 20:48 docs
-rw-r--r-- 1 bruno staff 19 16 déc 20:48 mkdocs.yml
Servir le projet:
bruno@SilverBook:~/project$ mkdocs serve
INFO - Building documentation...
INFO - Cleaning site directory
[I 171216 20:54:40 server:283] Serving on http://127.0.0.1:8000
[I 171216 20:54:40 handlers:60] Start watching changes
[I 171216 20:54:40 handlers:62] Start detecting changes
[I 171216 20:55:00 handlers:133] Browser Connected: http://127.0.0.1:8000/
[I 171216 20:55:41 handlers:133] Browser Connected: http://127.0.0.1:8000/
Copier les docs sur le serveur:
$ cd /Users/bruno/project
$ ./build_and_upload.sh
/build_and_upload.sh
# !/bin/bash
cd /Users/bruno/project
mkdocs build
scp -P42666 -r ./central_docs bruno@192.168.xxx.xxx:/volume1/web
Font Awesome icons:
:fa-link: http://bwmarrin.github.io/MkDocsPlus/
:fa-link: http://fontawesome.io/icons/
:fa-link:
:fa-link:
<i class="fa fa-link fa-lg"></i>
<i class="fa fa-link fa-2x"></i>
<i class="fa fa-link fa-5x"></i>
Themes:
Installer un thème:
$ pip install mkdocs-cinder
Mettre à jour un thème:
$ pip install --upgrade mkdocs-material