Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 |
| 2 | .. International License. http://creativecommons.org/licenses/by/4.0 |
| 3 | .. Copyright 2017 AT&T Intellectual Property. All rights reserved. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 4 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 5 | Introduction |
| 6 | ============ |
| 7 | This guide describes how to create documentation for the Open Network |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 8 | Automation Platform (ONAP). ONAP projects create a variety of |
| 9 | content depending on the nature of the project. For example projects |
| 10 | delivering a platform component may have different types of content than |
Rich Bennett | 5baea46 | 2017-09-13 03:19:19 -0400 | [diff] [blame] | 11 | a project that creates libraries for a software development kit. |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 12 | The content from each project may be used together as a reference for |
Rich Bennett | 7fc6d94 | 2018-11-27 09:36:32 -0500 | [diff] [blame] | 13 | that project and/or be used in documents that are tailored to a specific |
| 14 | user audience and tasks they are performing. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 15 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 16 | Much of the content in this document is derived from similar |
| 17 | documentation processes used in other Linux Foundation |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 18 | Projects including OPNFV and Open Daylight. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 19 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 20 | |
| 21 | End to End View |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 22 | --------------- |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 23 | ONAP documentation is stored in git repositories, changes are managed |
| 24 | with gerrit reviews, and published documents generated when there is a |
| 25 | change in any source used to build the documentation. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 26 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 27 | Authors create source for documents in reStructured Text (RST) that is |
Rich Bennett | 7fc6d94 | 2018-11-27 09:36:32 -0500 | [diff] [blame] | 28 | rendered to HTML and published on Readthedocs.io. |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 29 | The developer Wiki or other web sites can reference these rendered |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 30 | documents directly allowing projects to easily maintain current release |
| 31 | documentation. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 32 | |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 33 | Why reStructuredText/Sphinx? |
| 34 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 35 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 36 | In the past, standard documentation methods included ad-hoc Word documents, |
| 37 | PDFs, poorly organized Wikis, and other, often closed, tools like |
| 38 | Adobe FrameMaker. The rise of DevOps, Agile, and Continuous Integration, |
| 39 | however, created a paradigm shift for those who care about documentation |
| 40 | because: |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 41 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 42 | 1. Documentation must be tightly coupled with code/product releases. |
| 43 | In many cases, particularly with open-source products, many different |
| 44 | versions of the same code can be installed in various production |
| 45 | environments. DevOps personnel must have access to the correct version |
| 46 | of documentation. |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 47 | |
| 48 | 2. Resources are often tight, volunteers scarce. With a large software base |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 49 | like ONAP, a small team of technical writers, even if they are also |
| 50 | developers, cannot keep up with a constantly changing, large code base. |
| 51 | Therefore, those closest to the code should document it as best they can, |
| 52 | and let professional writers edit for style, grammar, and consistency. |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 53 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 54 | Plain-text formatting syntaxes, such as reStructuredText, Markdown, |
| 55 | and Textile, are a good choice for documentation because: |
Rich Bennett | 5baea46 | 2017-09-13 03:19:19 -0400 | [diff] [blame] | 56 | |
| 57 | a. They are editor agnostic |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 58 | |
Rich Bennett | 5baea46 | 2017-09-13 03:19:19 -0400 | [diff] [blame] | 59 | b. The source is nearly as easy to read as the rendered text |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 60 | |
Rich Bennett | 5baea46 | 2017-09-13 03:19:19 -0400 | [diff] [blame] | 61 | c. Documentation can be treated exactly as source code is (e.g. versioned, |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 62 | diff'ed, associated with commit messages that can be included |
| 63 | in rendered docs) |
| 64 | |
Rich Bennett | 5baea46 | 2017-09-13 03:19:19 -0400 | [diff] [blame] | 65 | d. Shallow learning curve |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 66 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 67 | The documentation team chose reStructuredText largely because of Sphinx, |
| 68 | a Python-based documentation build system, which uses reStructuredText |
| 69 | natively. In a code base as large as ONAP's, cross-referencing between |
| 70 | component documentation was deemed critical. Sphinx and reStructuredText |
| 71 | have built-in functionality that makes collating and cross-referencing |
| 72 | component documentation easier. |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 73 | |
| 74 | Which docs should go where? |
| 75 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 76 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 77 | Frequently, developers ask where documentation should be created. Should |
| 78 | they always use reStructuredText/Sphinx? Not necessarily. Is the wiki |
| 79 | appropriate for anything at all? Yes. |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 80 | |
| 81 | It's really up to the development team. Here is a simple rule: |
| 82 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 83 | The more tightly coupled the documentation is to a particular version |
| 84 | of the code, the more likely it is that it should be stored with the |
| 85 | code in reStructuredText. |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 86 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 87 | The doc team encourages component teams to store as much documentation |
| 88 | as reStructuredText as possible because: |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 89 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 90 | 1. It is easier to edit component documentation for grammar, |
| 91 | spelling, clarity, and consistency. |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 92 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 93 | 2. A consistent formatting syntax across components will allow |
| 94 | flexibility in producing different kinds of output. |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 95 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 96 | 3. It is easier to re-organize the documentation. |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame] | 97 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 98 | 4. Wiki articles tend to grow in size and not maintained making it hard |
| 99 | to find current information. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 100 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 101 | Structure |
| 102 | --------- |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 103 | A top level master document structure is used to organize all |
| 104 | documents created by ONAP projects and this resides in the gerrit doc |
| 105 | repository. Complete documents or guides may reside here and |
| 106 | reference parts of source for documentation from other project |
| 107 | repositories. Other ONAP projects will provide content that |
| 108 | is referenced from this structure. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 109 | |
| 110 | :: |
| 111 | |
Rich Bennett | 7fc6d94 | 2018-11-27 09:36:32 -0500 | [diff] [blame] | 112 | docs |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 113 | ├── guides |
| 114 | │ ├── onap-developer |
| 115 | │ │ ├── apiref |
| 116 | │ │ ├── architecture |
| 117 | │ │ ├── developing |
| 118 | │ │ ├── how-to-use-docs |
| 119 | │ │ ├── settingup |
Rich Bennett | 7fc6d94 | 2018-11-27 09:36:32 -0500 | [diff] [blame] | 120 | │ │ ├── tutorials |
| 121 | │ │ └── use-cases |
| 122 | │ ├── onap-provider |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 123 | │ └── onap-user |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 124 | ├── release |
Rich Bennett | 7fc6d94 | 2018-11-27 09:36:32 -0500 | [diff] [blame] | 125 | └── templates |
| 126 | ├── collections |
| 127 | └── sections |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 128 | |
| 129 | Source Files |
| 130 | ------------ |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 131 | All documentation for project repositories should be structured and stored |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 132 | in or below `<your_project_repo>/docs/` directory as Restructured Text. |
| 133 | ONAP jenkins jobs that verify and merge documentation are triggered by |
Rich Bennett | 5baea46 | 2017-09-13 03:19:19 -0400 | [diff] [blame] | 134 | RST file changes in the top level docs directory and below. |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 135 | |
Rich Bennett | 5baea46 | 2017-09-13 03:19:19 -0400 | [diff] [blame] | 136 | Licensing |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 137 | --------- |
| 138 | All contributions to the ONAP project are done in accordance with the |
| 139 | ONAP licensing requirements. Documentation in ONAP is contributed |
| 140 | in accordance with the `Creative Commons 4.0 <https://creativecommons.org/licenses/by/4.0/>`_ license. |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 141 | All documentation files need to be licensed using the text below. |
| 142 | The license may be applied in the first lines of all contributed RST |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 143 | files: |
| 144 | |
| 145 | .. code-block:: bash |
| 146 | |
| 147 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
Rich Bennett | c599566 | 2017-10-18 15:27:52 -0400 | [diff] [blame] | 148 | .. http://creativecommons.org/licenses/by/4.0 |
| 149 | .. Copyright YEAR ONAP or COMPANY or INDIVIDUAL |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 150 | |
| 151 | These lines will not be rendered in the html and pdf files. |
| 152 | |
Rich Bennett | d504dc8 | 2018-05-31 08:40:36 -0400 | [diff] [blame] | 153 | When there are subsequent, significant contributions to a source file |
| 154 | from a different contributor, a new copyright line may be appended |
| 155 | after the last existing copyright line. |