3 title: How to add documentation to AGL
5 https://raw.githubusercontent.com/automotive-grade-linux/docs-sources/master/docs/handle-docs/handle-docs.md
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/howto/master/howto-add-docs-handle-docs-book.yml -->
10 # How to add a new documentation section into AGL documentation
12 They are two steps to add new markdown files to AGL documentation:
14 - Add a book yaml file to the repository where the documentation sources are located (written in markdown files).
15 - Add an entry into the global section yaml file that point to your book file. The section yaml file is in [docs-webtemplate](https://github.com/automotive-grade-linux/docs-webtemplate) repository (`git@github.com:automotive-grade-linux/docs-webtemplate.git`) named `section_<version>.yml`.
19 **Note**: To generate a local documentation please refer to the [README](https://github.com/automotive-grade-linux/docs-webtemplate/blob/master-next/README.md) of the docs-webtemplate (https://github.com/automotive-grade-linux/docs-webtemplate) and use `setupdocs.sh` script.
23 ## Add a book yaml file into a repository
25 The book file is needed to describe how your documentation is structured and must be used to describe
28 - the global title of the doc
29 - the chapter name when the doc will be part of the whole documentation website
30 - subchapters list and consequently subchapters hierarchy
31 - multi-language description
37 Multi-language is handled by key suffixes. That is to say, there are some keys that can be suffixed by a language: ``<key>_<lang>``
38 For the url to the markdown files, the prefix ```%lang%``` will match with suffixes. So, you have to create a subdirectory named ```%lang%``` where the markdown files are put.
40 A example for the french:
43 name: "My section in english"
44 name_fr: "Ma section en français"
45 url: "%lang/section.md"
57 There are several types of book:
64 `book` type describes documentation structure and chapters.
65 Below the generic way to include a book file:
72 order: x #optional: between 0 in 100 default when not set is 50, it allows to define order in final
73 #documentation, more the order number is low more the documentation is first
74 title: title of your chapter #default title
75 title_<lang>: title in <lang>
76 description: description of your book
77 keywords: some keywords
78 author: author of the documentation
79 version: version of the documentation
81 - name: Name of your subchapter
82 name_<lang>: Name of your subchapter in <lang>
83 url: "%lang%/relative-path/to/your/mardown.md" #%lang% will be replaced by the
85 #default language can be in the root directory
86 - name: Name of your subchapter
87 name_<lang>: Name of your subchapter in <lang>
88 url: "%lang%/relative-path/to/your/mardown.md"
89 - name: Name of your subchapter
90 name_<lang>: Name of your subchapter in <lang>
91 - name: Name of your subsubchapter
92 name_<lang>: Name of your subsubchapter in <lang>
93 url: "%lang%/relative-path/to/your/mardown.md"
94 - name: Name of your subsubchapter
95 name_<lang>: Name of your subsubchapter in <lang>
105 [book.yml.in](https://github.com/automotive-grade-linux/docs-sources/blob/master/docs/handle-docs/book.yml.in)
106 is a sort of schema of book.yml. This file contains all supported keys.
108 Here a sample yaml file, you can start from :
111 wget https://raw.githubusercontent.com/automotive-grade-linux/docs-sources/master-next/docs/getting-started-book.yml -O my-new-book.yml
118 ## Add an entry in section file
120 There are 4 sections in docs: getting_started, architecture_guides, developer_guides, apis_services.
122 They are located in `content/docs` in [docs-webtemplate](https://github.com/automotive-grade-linux/docs-webtemplate) repository.
123 In addition, each directory contains several section yaml file, one a version. For master version, it is `section_master.yml`.
125 Below the structure of section yaml file.
128 url_fetch : DEFAULT_URL_FETCH #this the default url_fetch that can be overload further, there already are some default variables defined in docs-webtemplate/docs-tools
129 git_commit : DEFAULT_VERSION #this is the default git_commit that can be overload further, there already are some default variables defined in docs-webtemplate/docs-tools
131 name: Name of the section
132 template: generated_index.html
136 url_fetch: <url_fetch> #optional, overload the default one
137 git_commit: <git_commit> #optional, overload the default one
138 path: "relativepath/from/root/repository/to/the/book/yaml/file"
139 books: #optional: subbooks, will be a child of the above book
141 url_fetch: <url_fetch> #optional, overload the default one
142 git_commit: <git_commit> #optional, overload the default one
143 path: "relativepath/from/root/repository/to/the/book/yaml/file"