iredmail-doc/USAGE.md

78 lines
2.6 KiB
Markdown
Raw Permalink Normal View History

# How to write documents with Markdown
2014-09-17 08:42:48 -05:00
2017-08-24 19:36:20 -05:00
## Required Python modules
* markdown
* markdown_checklist
## Usage
2014-09-20 08:28:32 -05:00
* Organize articles in directories, each directory is a chapter.
2016-04-22 00:13:31 -05:00
* Order of chapters is hard-coded in file `convert.sh` (parameter
`all_chapter_dirs`), so that we can avoid complex/unnecessary way to order them.
2014-09-20 08:28:32 -05:00
* Chapter title is defined in file `_title.md` under chapter folder.
2014-10-08 07:44:06 -05:00
* Chapter summary is defined in file `_summary.md` under chapter folder.
2015-01-04 10:17:26 -06:00
* Additional links stored in file `_links.md` will be appended to chapter.
2014-09-20 08:28:32 -05:00
```
2017-08-24 19:36:20 -05:00
|- <language>/ # Short language code. e.g. `en_US`. Required.
|- _lang.md # Full name of the language. REQUIRED. e.g. `English` for `en_US`.
2016-04-22 00:13:31 -05:00
|- chapter_name_1/
2017-08-24 19:36:20 -05:00
|- _title.md # Chapter title. REQUIRED
|- _links.md # Additional links, will be appended to chapter. OPTIONAL
|- _summary.md # Summary text of this chapter, will be displayed
# under chapter title. OPTIONAL
|- article-1.md
|- article-2.md
|- article-3.md
2016-04-22 00:13:31 -05:00
|- chapter_name_2/
|- ...
|- chapter_name_3/
|- ...
|- ...
2017-08-24 19:36:20 -05:00
- html/css/markdown.css # CSS file
- html/images/ # Place images you need to display in HTML files here
2014-09-20 08:28:32 -05:00
```
2014-10-08 07:44:06 -05:00
* Articles will be ordered automatically, if you want to specify the order,
2017-09-01 01:49:54 -05:00
prepend a digit number and `-` in article file name, script `convert.sh` will
2014-10-08 07:44:06 -05:00
remove this prefix during converting Markdown source file to HTML file. e.g.
2017-08-24 19:36:20 -05:00
`1-file1.md`, `2-file2.md`.
* If you don't want to show an article in index page, prepend `0-` in its
2017-09-01 01:49:54 -05:00
file name like below.
2014-09-17 08:42:48 -05:00
```
2014-10-08 07:44:06 -05:00
- chapter_name_x/
2014-09-17 08:42:48 -05:00
|- _title.md
2017-09-01 01:49:54 -05:00
|- 0-hidden_article.md # This article will not be displayed on index page
2017-08-24 19:36:20 -05:00
|- 1-article-a.md # This article will be displayed as first one on index page
|- 2-article-b.md # 2nd article on index page
|- 3-article-c.md # 3rd article on index page
2014-12-03 21:11:39 -06:00
...
2014-09-17 08:42:48 -05:00
```
2017-08-24 19:36:20 -05:00
* The first line in article file will be used as article title (string `# `
at beginning of line will be removed). Note: it must be the first line in
file, not the first non-empty line. For example:
```
# This is article title.
```
2014-12-03 21:11:39 -06:00
2014-10-08 07:44:06 -05:00
* Run script `convert.sh` to convert Markdown files to HTML static files.
* It will generate index file `html/index.html` which includes all articles
with relative links to HTML files.
* it also generates README.md file used by bitbucket.org as index page.
2014-09-17 08:42:48 -05:00
```bash
$ bash convert.sh
```
2016-04-21 23:37:35 -05:00
To recompile all files, append flag `--all`:
```bash
$ bash convert.sh --all
```