blob: 9c5822d2b4bb886cf4c0e466a03ef7b59e9744c2 [file] [log] [blame]
Rich Bennettac93e0e2017-07-19 01:36:52 -04001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2
3
Rich Bennett1da30462017-08-24 12:11:36 -04004Introduction
5============
6This guide describes how to create documentation for the Open Network
Rich Bennett5baea462017-09-13 03:19:19 -04007Automation Platform (ONAP). ONAP projects create a variety of
8content depending on the nature of the project. For example projects delivering
9a platform component may have different types of content than
10a project that creates libraries for a software development kit.
11The content from each project may be used together as a reference for that project
12and/or be used in documents are tailored to a specific user audience and
Rich Bennett1da30462017-08-24 12:11:36 -040013task they are performing.
Rich Bennettac93e0e2017-07-19 01:36:52 -040014
Rich Bennett1da30462017-08-24 12:11:36 -040015Much of the content in this document is derived from similar
16documentation processes used in other Linux Foundation
17Projects including OPNFV and Open Daylight.
Rich Bennettac93e0e2017-07-19 01:36:52 -040018
Rich Bennett1da30462017-08-24 12:11:36 -040019
20End to End View
Rich Bennettac93e0e2017-07-19 01:36:52 -040021---------------
Rich Bennett1da30462017-08-24 12:11:36 -040022ONAP documentation is stored in git repositories, changes are managed
23with gerrit reviews, and published documents generated when there is a
24change in any source used to build the documentation.
Rich Bennettac93e0e2017-07-19 01:36:52 -040025
Rich Bennett1da30462017-08-24 12:11:36 -040026Authors create source for documents in reStructured Text (RST) that is
27rendered to HTML and PDF and published on Readthedocs.io.
28The developer Wiki or other web sites can reference these rendered
29documents directly allowing projects to easily maintain current release
30documentation.
Rich Bennettac93e0e2017-07-19 01:36:52 -040031
Spencer Seidelf7100652017-09-06 12:39:15 -040032Why reStructuredText/Sphinx?
33~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34
35In the past, standard documentation methods included ad-hoc Word documents, PDFs,
36poorly organized Wikis, and other, often closed, tools like Adobe FrameMaker.
37The rise of DevOps, Agile, and Continuous Integration, however, created a paradigm
38shift for those who care about documentation because:
39
401. Documentation must be tightly coupled with code/product releases. In many cases,
41particularly with open-source products, many different versions of the same code
42can be installed in various production environments. DevOps personnel must have
43access to the correct version of documentation.
44
452. Resources are often tight, volunteers scarce. With a large software base
46like ONAP, a small team of technical writers, even if they are also developers,
47cannot keep up with a constantly changing, large code base. Therefore, those closest
48to the code should document it as best they can, and let professional writers edit for
49style, grammar, and consistency.
50
51Plain-text formatting syntaxes, such as reStructuredText, Markdown, and Textile,
52are a good choice for documentation because:
Rich Bennett5baea462017-09-13 03:19:19 -040053
54a. They are editor agnostic
55b. The source is nearly as easy to read as the rendered text
56c. Documentation can be treated exactly as source code is (e.g. versioned,
57 diff'ed, associated with commit messages that can be included in rendered docs)
58d. Shallow learning curve
Spencer Seidelf7100652017-09-06 12:39:15 -040059
60The documentation team chose reStructuredText largely because of Sphinx, a Python-based
61documentation build system, which uses reStructuredText natively. In a code base
62as large as ONAP's, cross-referencing between component documentation was deemed
63critical. Sphinx and reStructuredText have built-in functionality that makes
64collating and cross-referencing component documentation easier.
65
66Which docs should go where?
67~~~~~~~~~~~~~~~~~~~~~~~~~~~
68
69Frequently, developers ask where documentation should be created. Should they always use
70reStructuredText/Sphinx? Not necessarily. Is the wiki appropriate for anything at all? Yes.
71
72It's really up to the development team. Here is a simple rule:
73
74The more tightly coupled the documentation is to a particular version of the code,
75the more likely it is that it should be stored with the code in reStructuredText.
76
77Two examples on opposite ends of the spectrum:
78
79Example 1: API documentation is often stored literally as code in the form of formatted
80comment sections. This would be an ideal choice for reStructuredText stored in a doc repo.
81
82Example 2: A high-level document that describes in general how a particular component interacts
83with other ONAP components with charts. The wiki would be a better choice for this.
84
85The doc team encourages component teams to store as much documentation as reStructuredText
86as possible because:
87
881. The doc team can more easily edit component documentation for grammar, spelling, clarity, and consistency.
892. A consistent formatting syntax across components will allow the doc team more flexibility in producing different kinds of output.
903. The doc team can easily re-organize the documentation.
914. Wiki articles tend to grow stale over time as the people who write them change positions or projects.
Rich Bennettac93e0e2017-07-19 01:36:52 -040092
Rich Bennett1da30462017-08-24 12:11:36 -040093Structure
94---------
Rich Bennett5baea462017-09-13 03:19:19 -040095A top level master document structure is used to organize all
96documents for an ONAP release and this resides in the gerrit doc repository.
Rich Bennett1da30462017-08-24 12:11:36 -040097Complete documents or guides may reside here and reference parts of
98source for documentation from other project repositories
99A starting structure is shown below and may change as content is
Rich Bennett5baea462017-09-13 03:19:19 -0400100integrated for each release. Other ONAP projects will provide
Rich Bennett1da30462017-08-24 12:11:36 -0400101content that is referenced from this structure.
Rich Bennettac93e0e2017-07-19 01:36:52 -0400102
Rich Bennettac93e0e2017-07-19 01:36:52 -0400103
Rich Bennettac93e0e2017-07-19 01:36:52 -0400104
105::
106
107 docs/
Rich Bennett5baea462017-09-13 03:19:19 -0400108 ├── releases
109 │ ├── major releases
110 │ ├── projects
111 │ ├── cryptographic signatures
112 │ └── references
Rich Bennettd1f09492017-07-25 19:28:00 -0400113 ├── onap-developer
Rich Bennett5baea462017-09-13 03:19:19 -0400114 │ ├── architecture
115 │ ├── tutorials
116 │ ├── setting up
117 │ ├── developing
118 │ └── documenting
119 └── onap-users
120 ├── vf provider
121 ├── service designer
122 ├── service administrator
123 └── platform administrator
Rich Bennettac93e0e2017-07-19 01:36:52 -0400124
Rich Bennett1da30462017-08-24 12:11:36 -0400125
126
127Source Files
128------------
129All documentation for a project should be structured and stored
130in or below `<your_project_repo>/docs/` directory as Restructured Text.
131ONAP jenkins jobs that verify and merge documentation are triggered by
Rich Bennett5baea462017-09-13 03:19:19 -0400132RST file changes in the top level docs directory and below.
Rich Bennett1da30462017-08-24 12:11:36 -0400133
134
Rich Bennett1da30462017-08-24 12:11:36 -0400135
Rich Bennett5baea462017-09-13 03:19:19 -0400136Licensing
Rich Bennett1da30462017-08-24 12:11:36 -0400137---------
138All contributions to the ONAP project are done in accordance with the
139ONAP licensing requirements. Documentation in ONAP is contributed
140in accordance with the `Creative Commons 4.0 <https://creativecommons.org/licenses/by/4.0/>`_ license.
141All documentation files need to be licensed using the text below.
142The license may be applied in the first lines of all contributed RST
143files:
144
145.. code-block:: bash
146
147 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
Rich Bennettc5995662017-10-18 15:27:52 -0400148 .. http://creativecommons.org/licenses/by/4.0
149 .. Copyright YEAR ONAP or COMPANY or INDIVIDUAL
Rich Bennett1da30462017-08-24 12:11:36 -0400150
151 These lines will not be rendered in the html and pdf files.
152
Rich Bennettc5995662017-10-18 15:27:52 -0400153When there are subsequent, significant contributions to a source file from a different contributor,
154a new copyright line may be appended after the last existing copyright line.
155