blob: 316e0af31fccaab2a6d9b71c27321ef6eec8b52d [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
7Automation Platform (ONAP). ONAP projects create a variety of document
8types depending on the nature of the project. Some projects will create
9detailed technical descriptions such as configuration parameters or how
10to use or extend the functionality of platform component.
11These descriptions may be used together as a reference for that project
12and/or be used in documents tailored to a specific user audience and
13task 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:
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,
56diff'ed, associated with commit messages that can be included in rendered docs)
57 d. Shallow learning curve
58
59The documentation team chose reStructuredText largely because of Sphinx, a Python-based
60documentation build system, which uses reStructuredText natively. In a code base
61as large as ONAP's, cross-referencing between component documentation was deemed
62critical. Sphinx and reStructuredText have built-in functionality that makes
63collating and cross-referencing component documentation easier.
64
65Which docs should go where?
66~~~~~~~~~~~~~~~~~~~~~~~~~~~
67
68Frequently, developers ask where documentation should be created. Should they always use
69reStructuredText/Sphinx? Not necessarily. Is the wiki appropriate for anything at all? Yes.
70
71It's really up to the development team. Here is a simple rule:
72
73The more tightly coupled the documentation is to a particular version of the code,
74the more likely it is that it should be stored with the code in reStructuredText.
75
76Two examples on opposite ends of the spectrum:
77
78Example 1: API documentation is often stored literally as code in the form of formatted
79comment sections. This would be an ideal choice for reStructuredText stored in a doc repo.
80
81Example 2: A high-level document that describes in general how a particular component interacts
82with other ONAP components with charts. The wiki would be a better choice for this.
83
84The doc team encourages component teams to store as much documentation as reStructuredText
85as possible because:
86
871. The doc team can more easily edit component documentation for grammar, spelling, clarity, and consistency.
882. A consistent formatting syntax across components will allow the doc team more flexibility in producing different kinds of output.
893. The doc team can easily re-organize the documentation.
904. 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 -040091
Rich Bennett1da30462017-08-24 12:11:36 -040092Structure
93---------
94A top level master_document structure is used to organize all
95documents for an ONAP release that reside in the doc git repository.
96Complete documents or guides may reside here and reference parts of
97source for documentation from other project repositories
98A starting structure is shown below and may change as content is
99intergrated for each release. Others ONAP projects will provide
100content that is referenced from this structure.
Rich Bennettac93e0e2017-07-19 01:36:52 -0400101
Rich Bennett1da30462017-08-24 12:11:36 -0400102.. index:: master
Rich Bennettac93e0e2017-07-19 01:36:52 -0400103
Rich Bennettac93e0e2017-07-19 01:36:52 -0400104
105::
106
107 docs/
Rich Bennettac93e0e2017-07-19 01:36:52 -0400108 ├── release
Rich Bennettac93e0e2017-07-19 01:36:52 -0400109 │ ├── overview
Rich Bennettd1f09492017-07-25 19:28:00 -0400110 │ ├── architecture
111 │ ├── use-cases
112 │ ├── tutorials
Rich Bennettac93e0e2017-07-19 01:36:52 -0400113 │ └── release-notes
Rich Bennettd1f09492017-07-25 19:28:00 -0400114 ├── onap-developer
115 │ ├── design
116 │ ├── develop
117 │ ├── document
118 │ └── test
Rich Bennett976bffd2017-08-15 07:56:32 -0400119 ├── adminstrator
Rich Bennettd1f09492017-07-25 19:28:00 -0400120 │ ├── configure
121 │ ├── deploy
122 │ └── operate
Rich Bennettac93e0e2017-07-19 01:36:52 -0400123 ├── service-designer
124 │ ├── deploy
125 │ ├── design
126 │ └── portal
127 └── vnf-provider
128 ├── guidelines
129 └── sdk
130
Rich Bennett1da30462017-08-24 12:11:36 -0400131
132
133Source Files
134------------
135All documentation for a project should be structured and stored
136in or below `<your_project_repo>/docs/` directory as Restructured Text.
137ONAP jenkins jobs that verify and merge documentation are triggered by
138file changes in the docs directory and below.
139
140
141.. index:: licensing
142
143Licencing
144---------
145All contributions to the ONAP project are done in accordance with the
146ONAP licensing requirements. Documentation in ONAP is contributed
147in accordance with the `Creative Commons 4.0 <https://creativecommons.org/licenses/by/4.0/>`_ license.
148All documentation files need to be licensed using the text below.
149The license may be applied in the first lines of all contributed RST
150files:
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 Bennett976bffd2017-08-15 07:56:32 -0400161Templates
Rich Bennett1da30462017-08-24 12:11:36 -0400162---------
163To encourage consistency of information across components, some
164templates are available as a starting point under `doc/docs/templates/`
165and listed below. With the "show source" feature on html pages, you
166may be able to use portions of an existing page as starting point for
167creating new content.
168
Rich Bennett976bffd2017-08-15 07:56:32 -0400169
170.. toctree::
171 :maxdepth: 1
Rich Bennett1da30462017-08-24 12:11:36 -0400172 :glob:
173
174 ../../../templates/**/index
Rich Bennett976bffd2017-08-15 07:56:32 -0400175