blob: ff45080902667b210d78524c479c7fc4c0ed5c49 [file] [log] [blame]
Rich Bennettd504dc82018-05-31 08:40:36 -04001.. 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 Bennettac93e0e2017-07-19 01:36:52 -04004
Rich Bennett1da30462017-08-24 12:11:36 -04005Introduction
6============
7This guide describes how to create documentation for the Open Network
Rich Bennettd504dc82018-05-31 08:40:36 -04008Automation Platform (ONAP). ONAP projects create a variety of
9content depending on the nature of the project. For example projects
10delivering a platform component may have different types of content than
Rich Bennett5baea462017-09-13 03:19:19 -040011a project that creates libraries for a software development kit.
Rich Bennettd504dc82018-05-31 08:40:36 -040012The content from each project may be used together as a reference for
Rich Bennett7fc6d942018-11-27 09:36:32 -050013that project and/or be used in documents that are tailored to a specific
14user audience and tasks they are performing.
Rich Bennettac93e0e2017-07-19 01:36:52 -040015
Rich Bennettd504dc82018-05-31 08:40:36 -040016Much of the content in this document is derived from similar
17documentation processes used in other Linux Foundation
Rich Bennett1da30462017-08-24 12:11:36 -040018Projects including OPNFV and Open Daylight.
Rich Bennettac93e0e2017-07-19 01:36:52 -040019
Rich Bennett1da30462017-08-24 12:11:36 -040020
21End to End View
Rich Bennettac93e0e2017-07-19 01:36:52 -040022---------------
Rich Bennett1da30462017-08-24 12:11:36 -040023ONAP documentation is stored in git repositories, changes are managed
24with gerrit reviews, and published documents generated when there is a
25change in any source used to build the documentation.
Rich Bennettac93e0e2017-07-19 01:36:52 -040026
Rich Bennett1da30462017-08-24 12:11:36 -040027Authors create source for documents in reStructured Text (RST) that is
Rich Bennett7fc6d942018-11-27 09:36:32 -050028rendered to HTML and published on Readthedocs.io.
Rich Bennettd504dc82018-05-31 08:40:36 -040029The developer Wiki or other web sites can reference these rendered
Rich Bennett1da30462017-08-24 12:11:36 -040030documents directly allowing projects to easily maintain current release
31documentation.
Rich Bennettac93e0e2017-07-19 01:36:52 -040032
Spencer Seidelf7100652017-09-06 12:39:15 -040033Why reStructuredText/Sphinx?
34~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35
Rich Bennettd504dc82018-05-31 08:40:36 -040036In the past, standard documentation methods included ad-hoc Word documents,
37PDFs, poorly organized Wikis, and other, often closed, tools like
38Adobe FrameMaker. The rise of DevOps, Agile, and Continuous Integration,
39however, created a paradigm shift for those who care about documentation
40because:
Spencer Seidelf7100652017-09-06 12:39:15 -040041
Rich Bennettd504dc82018-05-31 08:40:36 -0400421. 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 Seidelf7100652017-09-06 12:39:15 -040047
482. Resources are often tight, volunteers scarce. With a large software base
Rich Bennettd504dc82018-05-31 08:40:36 -040049 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 Seidelf7100652017-09-06 12:39:15 -040053
Rich Bennettd504dc82018-05-31 08:40:36 -040054Plain-text formatting syntaxes, such as reStructuredText, Markdown,
55and Textile, are a good choice for documentation because:
Rich Bennett5baea462017-09-13 03:19:19 -040056
57a. They are editor agnostic
Rich Bennettd504dc82018-05-31 08:40:36 -040058
Rich Bennett5baea462017-09-13 03:19:19 -040059b. The source is nearly as easy to read as the rendered text
Rich Bennettd504dc82018-05-31 08:40:36 -040060
Rich Bennett5baea462017-09-13 03:19:19 -040061c. Documentation can be treated exactly as source code is (e.g. versioned,
Rich Bennettd504dc82018-05-31 08:40:36 -040062 diff'ed, associated with commit messages that can be included
63 in rendered docs)
64
Rich Bennett5baea462017-09-13 03:19:19 -040065d. Shallow learning curve
Spencer Seidelf7100652017-09-06 12:39:15 -040066
Rich Bennettd504dc82018-05-31 08:40:36 -040067The documentation team chose reStructuredText largely because of Sphinx,
68a Python-based documentation build system, which uses reStructuredText
69natively. In a code base as large as ONAP's, cross-referencing between
70component documentation was deemed critical. Sphinx and reStructuredText
71have built-in functionality that makes collating and cross-referencing
72component documentation easier.
Spencer Seidelf7100652017-09-06 12:39:15 -040073
74Which docs should go where?
75~~~~~~~~~~~~~~~~~~~~~~~~~~~
76
Rich Bennettd504dc82018-05-31 08:40:36 -040077Frequently, developers ask where documentation should be created. Should
78they always use reStructuredText/Sphinx? Not necessarily. Is the wiki
79appropriate for anything at all? Yes.
Spencer Seidelf7100652017-09-06 12:39:15 -040080
81It's really up to the development team. Here is a simple rule:
82
Rich Bennettd504dc82018-05-31 08:40:36 -040083The more tightly coupled the documentation is to a particular version
84of the code, the more likely it is that it should be stored with the
85code in reStructuredText.
Spencer Seidelf7100652017-09-06 12:39:15 -040086
Rich Bennettd504dc82018-05-31 08:40:36 -040087The doc team encourages component teams to store as much documentation
88as reStructuredText as possible because:
Spencer Seidelf7100652017-09-06 12:39:15 -040089
Rich Bennettd504dc82018-05-31 08:40:36 -0400901. It is easier to edit component documentation for grammar,
91 spelling, clarity, and consistency.
Spencer Seidelf7100652017-09-06 12:39:15 -040092
Rich Bennettd504dc82018-05-31 08:40:36 -0400932. A consistent formatting syntax across components will allow
94 flexibility in producing different kinds of output.
Spencer Seidelf7100652017-09-06 12:39:15 -040095
Rich Bennettd504dc82018-05-31 08:40:36 -0400963. It is easier to re-organize the documentation.
Spencer Seidelf7100652017-09-06 12:39:15 -040097
Rich Bennettd504dc82018-05-31 08:40:36 -0400984. Wiki articles tend to grow in size and not maintained making it hard
99 to find current information.
Rich Bennettac93e0e2017-07-19 01:36:52 -0400100
Rich Bennett1da30462017-08-24 12:11:36 -0400101Structure
102---------
Rich Bennettd504dc82018-05-31 08:40:36 -0400103A top level master document structure is used to organize all
104documents created by ONAP projects and this resides in the gerrit doc
105repository. Complete documents or guides may reside here and
106reference parts of source for documentation from other project
107repositories. Other ONAP projects will provide content that
108is referenced from this structure.
Rich Bennettac93e0e2017-07-19 01:36:52 -0400109
110::
111
Rich Bennett7fc6d942018-11-27 09:36:32 -0500112 docs
Rich Bennettd504dc82018-05-31 08:40:36 -0400113 ├── guides
114 │   ├── onap-developer
115 │   │   ├── apiref
116 │   │   ├── architecture
117 │   │   ├── developing
118 │   │   ├── how-to-use-docs
119 │   │   ├── settingup
Rich Bennett7fc6d942018-11-27 09:36:32 -0500120 │   │   ├── tutorials
121 │   │   └── use-cases
122 │   ├── onap-provider
Rich Bennettd504dc82018-05-31 08:40:36 -0400123 │   └── onap-user
Rich Bennettd504dc82018-05-31 08:40:36 -0400124 ├── release
Rich Bennett7fc6d942018-11-27 09:36:32 -0500125 └── templates
126    ├── collections
127    └── sections
Rich Bennett1da30462017-08-24 12:11:36 -0400128
129Source Files
130------------
Rich Bennettd504dc82018-05-31 08:40:36 -0400131All documentation for project repositories should be structured and stored
Rich Bennett1da30462017-08-24 12:11:36 -0400132in or below `<your_project_repo>/docs/` directory as Restructured Text.
133ONAP jenkins jobs that verify and merge documentation are triggered by
Rich Bennett5baea462017-09-13 03:19:19 -0400134RST file changes in the top level docs directory and below.
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.
Rich Bennettd504dc82018-05-31 08:40:36 -0400141All documentation files need to be licensed using the text below.
142The license may be applied in the first lines of all contributed RST
Rich Bennett1da30462017-08-24 12:11:36 -0400143files:
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 Bennettd504dc82018-05-31 08:40:36 -0400153When there are subsequent, significant contributions to a source file
154from a different contributor, a new copyright line may be appended
155after the last existing copyright line.