blob: 44a543c34fa1517cc0845121549ff87af8705c18 [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
Andrea Visnyeia2eb2e22020-09-25 12:23:47 +020020When is documentation required?
21~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22All ONAP project contributions should have corresponding documentation.
23This includes all new features and changes to features that impact users.
24
25How do I create ONAP documentation?
26~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27ONAP documentation is written in ReStructuredText_ (an easy-to-read,
28what-you-see-is-what-you-get, plain text markup syntax). The process for
29creating ONAP documentation and what documents are required are
30described in later sections of this Developer Documentation Guide.
31
32.. _ReStructuredText: http://docutils.sourceforge.net/rst.html
33
Spencer Seidelf7100652017-09-06 12:39:15 -040034Why reStructuredText/Sphinx?
35~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36
Rich Bennettd504dc82018-05-31 08:40:36 -040037In the past, standard documentation methods included ad-hoc Word documents,
38PDFs, poorly organized Wikis, and other, often closed, tools like
39Adobe FrameMaker. The rise of DevOps, Agile, and Continuous Integration,
40however, created a paradigm shift for those who care about documentation
41because:
Spencer Seidelf7100652017-09-06 12:39:15 -040042
Rich Bennettd504dc82018-05-31 08:40:36 -0400431. Documentation must be tightly coupled with code/product releases.
44 In many cases, particularly with open-source products, many different
45 versions of the same code can be installed in various production
46 environments. DevOps personnel must have access to the correct version
47 of documentation.
Spencer Seidelf7100652017-09-06 12:39:15 -040048
492. Resources are often tight, volunteers scarce. With a large software base
Rich Bennettd504dc82018-05-31 08:40:36 -040050 like ONAP, a small team of technical writers, even if they are also
51 developers, cannot keep up with a constantly changing, large code base.
52 Therefore, those closest to the code should document it as best they can,
53 and let professional writers edit for style, grammar, and consistency.
Spencer Seidelf7100652017-09-06 12:39:15 -040054
Rich Bennettd504dc82018-05-31 08:40:36 -040055Plain-text formatting syntaxes, such as reStructuredText, Markdown,
56and Textile, are a good choice for documentation because:
Rich Bennett5baea462017-09-13 03:19:19 -040057
58a. They are editor agnostic
Rich Bennettd504dc82018-05-31 08:40:36 -040059
Rich Bennett5baea462017-09-13 03:19:19 -040060b. The source is nearly as easy to read as the rendered text
Rich Bennettd504dc82018-05-31 08:40:36 -040061
Rich Bennett5baea462017-09-13 03:19:19 -040062c. Documentation can be treated exactly as source code is (e.g. versioned,
Rich Bennettd504dc82018-05-31 08:40:36 -040063 diff'ed, associated with commit messages that can be included
64 in rendered docs)
65
Rich Bennett5baea462017-09-13 03:19:19 -040066d. Shallow learning curve
Spencer Seidelf7100652017-09-06 12:39:15 -040067
Rich Bennettd504dc82018-05-31 08:40:36 -040068The documentation team chose reStructuredText largely because of Sphinx,
69a Python-based documentation build system, which uses reStructuredText
70natively. In a code base as large as ONAP's, cross-referencing between
71component documentation was deemed critical. Sphinx and reStructuredText
72have built-in functionality that makes collating and cross-referencing
73component documentation easier.
Spencer Seidelf7100652017-09-06 12:39:15 -040074
75Which docs should go where?
76~~~~~~~~~~~~~~~~~~~~~~~~~~~
77
Rich Bennettd504dc82018-05-31 08:40:36 -040078Frequently, developers ask where documentation should be created. Should
79they always use reStructuredText/Sphinx? Not necessarily. Is the wiki
80appropriate for anything at all? Yes.
Spencer Seidelf7100652017-09-06 12:39:15 -040081
82It's really up to the development team. Here is a simple rule:
83
Rich Bennettd504dc82018-05-31 08:40:36 -040084The more tightly coupled the documentation is to a particular version
85of the code, the more likely it is that it should be stored with the
86code in reStructuredText.
Spencer Seidelf7100652017-09-06 12:39:15 -040087
Rich Bennettd504dc82018-05-31 08:40:36 -040088The doc team encourages component teams to store as much documentation
89as reStructuredText as possible because:
Spencer Seidelf7100652017-09-06 12:39:15 -040090
Rich Bennettd504dc82018-05-31 08:40:36 -0400911. It is easier to edit component documentation for grammar,
92 spelling, clarity, and consistency.
Spencer Seidelf7100652017-09-06 12:39:15 -040093
Rich Bennettd504dc82018-05-31 08:40:36 -0400942. A consistent formatting syntax across components will allow
95 flexibility in producing different kinds of output.
Spencer Seidelf7100652017-09-06 12:39:15 -040096
Rich Bennettd504dc82018-05-31 08:40:36 -0400973. It is easier to re-organize the documentation.
Spencer Seidelf7100652017-09-06 12:39:15 -040098
Rich Bennettd504dc82018-05-31 08:40:36 -0400994. Wiki articles tend to grow in size and not maintained making it hard
100 to find current information.
Rich Bennettac93e0e2017-07-19 01:36:52 -0400101
Rich Bennett1da30462017-08-24 12:11:36 -0400102Structure
103---------
Rich Bennettd504dc82018-05-31 08:40:36 -0400104A top level master document structure is used to organize all
105documents created by ONAP projects and this resides in the gerrit doc
106repository. Complete documents or guides may reside here and
107reference parts of source for documentation from other project
108repositories. Other ONAP projects will provide content that
109is referenced from this structure.
Rich Bennettac93e0e2017-07-19 01:36:52 -0400110
111::
112
Rich Bennett7fc6d942018-11-27 09:36:32 -0500113 docs
Rich Bennettd504dc82018-05-31 08:40:36 -0400114 ├── guides
115 │   ├── onap-developer
116 │   │   ├── apiref
117 │   │   ├── architecture
118 │   │   ├── developing
119 │   │   ├── how-to-use-docs
120 │   │   ├── settingup
Rich Bennett7fc6d942018-11-27 09:36:32 -0500121 │   │   ├── tutorials
122 │   │   └── use-cases
123 │   ├── onap-provider
Rich Bennettd504dc82018-05-31 08:40:36 -0400124 │   └── onap-user
Rich Bennettd504dc82018-05-31 08:40:36 -0400125 ├── release
Rich Bennett7fc6d942018-11-27 09:36:32 -0500126 └── templates
127    ├── collections
128    └── sections
Rich Bennett1da30462017-08-24 12:11:36 -0400129
130Source Files
131------------
Rich Bennettd504dc82018-05-31 08:40:36 -0400132All documentation for project repositories should be structured and stored
Rich Bennett1da30462017-08-24 12:11:36 -0400133in or below `<your_project_repo>/docs/` directory as Restructured Text.
134ONAP jenkins jobs that verify and merge documentation are triggered by
Rich Bennett5baea462017-09-13 03:19:19 -0400135RST file changes in the top level docs directory and below.
Rich Bennett1da30462017-08-24 12:11:36 -0400136
Rich Bennett5baea462017-09-13 03:19:19 -0400137Licensing
Rich Bennett1da30462017-08-24 12:11:36 -0400138---------
139All contributions to the ONAP project are done in accordance with the
140ONAP licensing requirements. Documentation in ONAP is contributed
141in accordance with the `Creative Commons 4.0 <https://creativecommons.org/licenses/by/4.0/>`_ license.
Rich Bennettd504dc82018-05-31 08:40:36 -0400142All documentation files need to be licensed using the text below.
143The license may be applied in the first lines of all contributed RST
Rich Bennett1da30462017-08-24 12:11:36 -0400144files:
145
146.. code-block:: bash
147
148 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
Rich Bennettc5995662017-10-18 15:27:52 -0400149 .. http://creativecommons.org/licenses/by/4.0
150 .. Copyright YEAR ONAP or COMPANY or INDIVIDUAL
Rich Bennett1da30462017-08-24 12:11:36 -0400151
152 These lines will not be rendered in the html and pdf files.
153
Rich Bennettd504dc82018-05-31 08:40:36 -0400154When there are subsequent, significant contributions to a source file
155from a different contributor, a new copyright line may be appended
156after the last existing copyright line.