v 1.0
The repository will contain the following files at the root level:
docs
This folder will be the root of the documentation.LICENSE
The license for the documentationconfig.json
Navigation structure and optional repo configuration
This file contains a dictionary of all sections and classes contained in the repository, in the order in which they will appear on the developer portal. It also allows the option to override the default language and default asset directory.
The root level of /docs contains an “assets” directory for storage of global assets, an “index.md” file for root-level content, and individual directories for each section or class. Directories can contain spaces.
Each directory in /docs can contain an “index.md” which contains the documentation in the Markdown format as described below.
In addition to the Markdown file, assets like code samples, tables, and images, can be stored in an “assets” folder next to the index.md file. Supported files are listed in the Importing Files section.
When referencing assets, the parser will first look at the /assets directory at the same level as the “index.md” file. If the asset is not found, the parser will look up the directory tree until it reaches the global /assets directory. Assets cannot be shared across repositories.
Maximum pages level in hierarchy is 2 only.
Example:
docs \
Level 1 \
index.md
level 2 \
index.md
level 2 \
index.md
...
level 1 \
index.md
...
NOTE: H1 is reserved for page titles and shouldn’t be used in the documentation
#
Page Section Titles
##
Sub-Section Titles
###
Chart Titles
####
Notes, Chart Column Titles
#####
Chart Row Titles
######
Each Header could be used as anchor links The rule for links is following:
- remove '.' (dots)
- replace ' ' (spaces) with '-' (hyphen)
- convert all upper case letters to lower case
Example:
## 4.1.4 Chapter 4.1.4 References
---
[link text](#--414--chapter-414-references)
_emphasis_
, or *emphasis*
__strong__
, or **strong**
~~strikethrough~~
`code`
```language Class = new className; ```
Supports nested blockquotes
>
- List item 1
- List item 2
1. Item 1
1. Item 2
[link text](https://www.google.com)
[link text](https://www.google.com “Title”)
[link text][reference text]
---
[reference text]: https://www.google.com
[link text](#achor)
![alt text](https://google.com/image.png "Title Text")
![alt text][image]
---
[image]: https://google.com/image.png "Title Text"
| Header | Header 2 | Header 3 |
| ---------------- | ------------------ | ------------------ |
| cell content | cell content | cell content |
| Header | Header 2 | Header 3 |
| :--------------: | ------------------ | ------------------ |
| Header | Header 2 | Header 3 |
| ---------------: | ------------------ | ------------------ |
---
Line 1 text
Line 2 text
Line 1 text
Line 2 text
Fenced by !!!. Supports inline markdown. Content can start on first line or new line. “NOTE” type is optional, as it is the default.
!!! NOTE
Content
!!!
!!! IMPORTANT
Content
!!!
!!! MUST
Content
!!!
!!! MAY
Content
!!!
Link to Sequencing Chart
|||
Content
![alt text](assets/diagram.jpg)
|||
[link text][Class Name]
or
[link text][parent/ClassName]
Links without a leading slash are treated as links between documents by the parser. The parent directory can be included to handle namespace conflicts.
[link text][version/ClassName]
If omitted, the latest version is used for the link
[link text][version/Class Name/constant]
[link text][version/Class Name/method]
[link text][platform/version/Class Name/constant]
Allows the link to traverse repos (linking iOS to Core). Version and Constant are optional.
A document can begin with a metadata section defined by “---” with keys and values as shown below:
---
key: value
key2: value2
---
DocDown converts documents from Markdown into HTML, therefore most HTML tags are supported. Use HTML tags with caution as each template can render the them differently leading to unexpected outcomes.
Localization of files is handled by appending the language code to the file itself. Directories currently cannot be localized. The default language is _en_us
and is optional. Assets can be localized as well, in the same fashion.
External code snippets can be imported and will be parsed using their native language. CSV imports will create HTML tables from their content. The parser will look in the assets/ directory for all imported files.
+++ file.m
+++ response.json
would import a JSON code snippet from assests/response.json
.
Supported file types:
- JSON
- CSV
- HTML
- JS
- CSS
- Obj-C
- Swift
- Java
- C++