建立專案
觀看new指令說明
$ mkdocs new --help
顯示
Usage: mkdocs new [OPTIONS] PROJECT_DIRECTORY
Create a new MkDocs project
Options:
-q, --quiet Silence warnings
-v, --verbose Enable verbose output
-h, --help Show this message and exit.
建立新專案
執行
$ mkdocs new note
顯示
INFO - Creating project directory: note
INFO - Writing config file: note/mkdocs.yml
INFO - Writing initial docs: note/docs/index.md
觀看專案資料夾結構
執行
$ tree note
顯示
note/
├── docs
│ └── index.md
└── mkdocs.yml
1 directory, 2 files
觀看設定檔內容
$ cat note/mkdocs.yml
顯示
site_name: My Docs
觀看首頁內容
$ cat note/docs/index.md
顯示
# Welcome to MkDocs
For full documentation visit [mkdocs.org](http://mkdocs.org).
## Commands
* `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.
## Project layout
mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
切換到專案資料夾
執行
$ cd note
更多參考
- MkDocs / Getting started