Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | |
| 3 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 4 | Introduction |
| 5 | ============ |
| 6 | This guide describes how to create documentation for the Open Network |
| 7 | Automation Platform (ONAP). ONAP projects create a variety of document |
| 8 | types depending on the nature of the project. Some projects will create |
| 9 | detailed technical descriptions such as configuration parameters or how |
| 10 | to use or extend the functionality of platform component. |
| 11 | These descriptions may be used together as a reference for that project |
| 12 | and/or be used in documents tailored to a specific user audience and |
| 13 | task they are performing. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 14 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 15 | Much of the content in this document is derived from similar |
| 16 | documentation processes used in other Linux Foundation |
| 17 | Projects including OPNFV and Open Daylight. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 18 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 19 | |
| 20 | End to End View |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 21 | --------------- |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 22 | ONAP documentation is stored in git repositories, changes are managed |
| 23 | with gerrit reviews, and published documents generated when there is a |
| 24 | change in any source used to build the documentation. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 25 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 26 | Authors create source for documents in reStructured Text (RST) that is |
| 27 | rendered to HTML and PDF and published on Readthedocs.io. |
| 28 | The developer Wiki or other web sites can reference these rendered |
| 29 | documents directly allowing projects to easily maintain current release |
| 30 | documentation. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 31 | |
Spencer Seidel | f710065 | 2017-09-06 12:39:15 -0400 | [diff] [blame^] | 32 | Why reStructuredText/Sphinx? |
| 33 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 34 | |
| 35 | In the past, standard documentation methods included ad-hoc Word documents, PDFs, |
| 36 | poorly organized Wikis, and other, often closed, tools like Adobe FrameMaker. |
| 37 | The rise of DevOps, Agile, and Continuous Integration, however, created a paradigm |
| 38 | shift for those who care about documentation because: |
| 39 | |
| 40 | 1. Documentation must be tightly coupled with code/product releases. In many cases, |
| 41 | particularly with open-source products, many different versions of the same code |
| 42 | can be installed in various production environments. DevOps personnel must have |
| 43 | access to the correct version of documentation. |
| 44 | |
| 45 | 2. Resources are often tight, volunteers scarce. With a large software base |
| 46 | like ONAP, a small team of technical writers, even if they are also developers, |
| 47 | cannot keep up with a constantly changing, large code base. Therefore, those closest |
| 48 | to the code should document it as best they can, and let professional writers edit for |
| 49 | style, grammar, and consistency. |
| 50 | |
| 51 | Plain-text formatting syntaxes, such as reStructuredText, Markdown, and Textile, |
| 52 | are a good choice for documentation because: |
| 53 | a. They are editor agnostic |
| 54 | b. The source is nearly as easy to read as the rendered text |
| 55 | c. Documentation can be treated exactly as source code is (e.g. versioned, |
| 56 | diff'ed, associated with commit messages that can be included in rendered docs) |
| 57 | d. Shallow learning curve |
| 58 | |
| 59 | The documentation team chose reStructuredText largely because of Sphinx, a Python-based |
| 60 | documentation build system, which uses reStructuredText natively. In a code base |
| 61 | as large as ONAP's, cross-referencing between component documentation was deemed |
| 62 | critical. Sphinx and reStructuredText have built-in functionality that makes |
| 63 | collating and cross-referencing component documentation easier. |
| 64 | |
| 65 | Which docs should go where? |
| 66 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 67 | |
| 68 | Frequently, developers ask where documentation should be created. Should they always use |
| 69 | reStructuredText/Sphinx? Not necessarily. Is the wiki appropriate for anything at all? Yes. |
| 70 | |
| 71 | It's really up to the development team. Here is a simple rule: |
| 72 | |
| 73 | The more tightly coupled the documentation is to a particular version of the code, |
| 74 | the more likely it is that it should be stored with the code in reStructuredText. |
| 75 | |
| 76 | Two examples on opposite ends of the spectrum: |
| 77 | |
| 78 | Example 1: API documentation is often stored literally as code in the form of formatted |
| 79 | comment sections. This would be an ideal choice for reStructuredText stored in a doc repo. |
| 80 | |
| 81 | Example 2: A high-level document that describes in general how a particular component interacts |
| 82 | with other ONAP components with charts. The wiki would be a better choice for this. |
| 83 | |
| 84 | The doc team encourages component teams to store as much documentation as reStructuredText |
| 85 | as possible because: |
| 86 | |
| 87 | 1. The doc team can more easily edit component documentation for grammar, spelling, clarity, and consistency. |
| 88 | 2. A consistent formatting syntax across components will allow the doc team more flexibility in producing different kinds of output. |
| 89 | 3. The doc team can easily re-organize the documentation. |
| 90 | 4. Wiki articles tend to grow stale over time as the people who write them change positions or projects. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 91 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 92 | Structure |
| 93 | --------- |
| 94 | A top level master_document structure is used to organize all |
| 95 | documents for an ONAP release that reside in the doc git repository. |
| 96 | Complete documents or guides may reside here and reference parts of |
| 97 | source for documentation from other project repositories |
| 98 | A starting structure is shown below and may change as content is |
| 99 | intergrated for each release. Others ONAP projects will provide |
| 100 | content that is referenced from this structure. |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 101 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 102 | .. index:: master |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 103 | |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 104 | |
| 105 | :: |
| 106 | |
| 107 | docs/ |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 108 | ├── release |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 109 | │ ├── overview |
Rich Bennett | d1f0949 | 2017-07-25 19:28:00 -0400 | [diff] [blame] | 110 | │ ├── architecture |
| 111 | │ ├── use-cases |
| 112 | │ ├── tutorials |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 113 | │ └── release-notes |
Rich Bennett | d1f0949 | 2017-07-25 19:28:00 -0400 | [diff] [blame] | 114 | ├── onap-developer |
| 115 | │ ├── design |
| 116 | │ ├── develop |
| 117 | │ ├── document |
| 118 | │ └── test |
Rich Bennett | 976bffd | 2017-08-15 07:56:32 -0400 | [diff] [blame] | 119 | ├── adminstrator |
Rich Bennett | d1f0949 | 2017-07-25 19:28:00 -0400 | [diff] [blame] | 120 | │ ├── configure |
| 121 | │ ├── deploy |
| 122 | │ └── operate |
Rich Bennett | ac93e0e | 2017-07-19 01:36:52 -0400 | [diff] [blame] | 123 | ├── service-designer |
| 124 | │ ├── deploy |
| 125 | │ ├── design |
| 126 | │ └── portal |
| 127 | └── vnf-provider |
| 128 | ├── guidelines |
| 129 | └── sdk |
| 130 | |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 131 | |
| 132 | |
| 133 | Source Files |
| 134 | ------------ |
| 135 | All documentation for a project should be structured and stored |
| 136 | in or below `<your_project_repo>/docs/` directory as Restructured Text. |
| 137 | ONAP jenkins jobs that verify and merge documentation are triggered by |
| 138 | file changes in the docs directory and below. |
| 139 | |
| 140 | |
| 141 | .. index:: licensing |
| 142 | |
| 143 | Licencing |
| 144 | --------- |
| 145 | All contributions to the ONAP project are done in accordance with the |
| 146 | ONAP licensing requirements. Documentation in ONAP is contributed |
| 147 | in accordance with the `Creative Commons 4.0 <https://creativecommons.org/licenses/by/4.0/>`_ license. |
| 148 | All documentation files need to be licensed using the text below. |
| 149 | The license may be applied in the first lines of all contributed RST |
| 150 | files: |
| 151 | |
| 152 | .. code-block:: bash |
| 153 | |
| 154 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 155 | .. (c) <optionally add copyrights company name> |
| 156 | |
| 157 | These lines will not be rendered in the html and pdf files. |
| 158 | |
| 159 | |
| 160 | |
Rich Bennett | 976bffd | 2017-08-15 07:56:32 -0400 | [diff] [blame] | 161 | Templates |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 162 | --------- |
| 163 | To encourage consistency of information across components, some |
| 164 | templates are available as a starting point under `doc/docs/templates/` |
| 165 | and listed below. With the "show source" feature on html pages, you |
| 166 | may be able to use portions of an existing page as starting point for |
| 167 | creating new content. |
| 168 | |
Rich Bennett | 976bffd | 2017-08-15 07:56:32 -0400 | [diff] [blame] | 169 | |
| 170 | .. toctree:: |
| 171 | :maxdepth: 1 |
Rich Bennett | 1da3046 | 2017-08-24 12:11:36 -0400 | [diff] [blame] | 172 | :glob: |
| 173 | |
| 174 | ../../../templates/**/index |
Rich Bennett | 976bffd | 2017-08-15 07:56:32 -0400 | [diff] [blame] | 175 | |