blob: 70e98ad93476347afa482b4bdf9380e4bb0890bf [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
Spencer Seidelf7100652017-09-06 12:39:15 -040020Why reStructuredText/Sphinx?
21~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22
Rich Bennettd504dc82018-05-31 08:40:36 -040023In the past, standard documentation methods included ad-hoc Word documents,
24PDFs, poorly organized Wikis, and other, often closed, tools like
25Adobe FrameMaker. The rise of DevOps, Agile, and Continuous Integration,
26however, created a paradigm shift for those who care about documentation
27because:
Spencer Seidelf7100652017-09-06 12:39:15 -040028
Rich Bennettd504dc82018-05-31 08:40:36 -0400291. Documentation must be tightly coupled with code/product releases.
30 In many cases, particularly with open-source products, many different
31 versions of the same code can be installed in various production
32 environments. DevOps personnel must have access to the correct version
33 of documentation.
Spencer Seidelf7100652017-09-06 12:39:15 -040034
352. Resources are often tight, volunteers scarce. With a large software base
Rich Bennettd504dc82018-05-31 08:40:36 -040036 like ONAP, a small team of technical writers, even if they are also
37 developers, cannot keep up with a constantly changing, large code base.
38 Therefore, those closest to the code should document it as best they can,
39 and let professional writers edit for style, grammar, and consistency.
Spencer Seidelf7100652017-09-06 12:39:15 -040040
Rich Bennettd504dc82018-05-31 08:40:36 -040041Plain-text formatting syntaxes, such as reStructuredText, Markdown,
42and Textile, are a good choice for documentation because:
Rich Bennett5baea462017-09-13 03:19:19 -040043
44a. They are editor agnostic
Rich Bennettd504dc82018-05-31 08:40:36 -040045
Rich Bennett5baea462017-09-13 03:19:19 -040046b. The source is nearly as easy to read as the rendered text
Rich Bennettd504dc82018-05-31 08:40:36 -040047
Rich Bennett5baea462017-09-13 03:19:19 -040048c. Documentation can be treated exactly as source code is (e.g. versioned,
Rich Bennettd504dc82018-05-31 08:40:36 -040049 diff'ed, associated with commit messages that can be included
50 in rendered docs)
51
Rich Bennett5baea462017-09-13 03:19:19 -040052d. Shallow learning curve
Spencer Seidelf7100652017-09-06 12:39:15 -040053
Rich Bennettd504dc82018-05-31 08:40:36 -040054The documentation team chose reStructuredText largely because of Sphinx,
55a Python-based documentation build system, which uses reStructuredText
56natively. In a code base as large as ONAP's, cross-referencing between
57component documentation was deemed critical. Sphinx and reStructuredText
58have built-in functionality that makes collating and cross-referencing
59component documentation easier.
Spencer Seidelf7100652017-09-06 12:39:15 -040060
61Which docs should go where?
62~~~~~~~~~~~~~~~~~~~~~~~~~~~
63
Rich Bennettd504dc82018-05-31 08:40:36 -040064Frequently, developers ask where documentation should be created. Should
65they always use reStructuredText/Sphinx? Not necessarily. Is the wiki
66appropriate for anything at all? Yes.
Spencer Seidelf7100652017-09-06 12:39:15 -040067
68It's really up to the development team. Here is a simple rule:
69
Rich Bennettd504dc82018-05-31 08:40:36 -040070The more tightly coupled the documentation is to a particular version
71of the code, the more likely it is that it should be stored with the
72code in reStructuredText.
Spencer Seidelf7100652017-09-06 12:39:15 -040073
Rich Bennettd504dc82018-05-31 08:40:36 -040074The doc team encourages component teams to store as much documentation
75as reStructuredText as possible because:
Spencer Seidelf7100652017-09-06 12:39:15 -040076
Rich Bennettd504dc82018-05-31 08:40:36 -0400771. It is easier to edit component documentation for grammar,
78 spelling, clarity, and consistency.
Spencer Seidelf7100652017-09-06 12:39:15 -040079
Rich Bennettd504dc82018-05-31 08:40:36 -0400802. A consistent formatting syntax across components will allow
81 flexibility in producing different kinds of output.
Spencer Seidelf7100652017-09-06 12:39:15 -040082
Rich Bennettd504dc82018-05-31 08:40:36 -0400833. It is easier to re-organize the documentation.
Spencer Seidelf7100652017-09-06 12:39:15 -040084
Rich Bennettd504dc82018-05-31 08:40:36 -0400854. Wiki articles tend to grow in size and not maintained making it hard
86 to find current information.
Rich Bennettac93e0e2017-07-19 01:36:52 -040087
Rich Bennett1da30462017-08-24 12:11:36 -040088Structure
89---------
Rich Bennettd504dc82018-05-31 08:40:36 -040090A top level master document structure is used to organize all
91documents created by ONAP projects and this resides in the gerrit doc
92repository. Complete documents or guides may reside here and
93reference parts of source for documentation from other project
94repositories. Other ONAP projects will provide content that
95is referenced from this structure.
Rich Bennettac93e0e2017-07-19 01:36:52 -040096
97::
98
Rich Bennett7fc6d942018-11-27 09:36:32 -050099 docs
Rich Bennettd504dc82018-05-31 08:40:36 -0400100 ├── guides
101 │   ├── onap-developer
102 │   │   ├── apiref
103 │   │   ├── architecture
104 │   │   ├── developing
105 │   │   ├── how-to-use-docs
106 │   │   ├── settingup
Rich Bennett7fc6d942018-11-27 09:36:32 -0500107 │   │   ├── tutorials
108 │   │   └── use-cases
109 │   ├── onap-provider
Rich Bennettd504dc82018-05-31 08:40:36 -0400110 │   └── onap-user
Rich Bennettd504dc82018-05-31 08:40:36 -0400111 ├── release
Rich Bennett7fc6d942018-11-27 09:36:32 -0500112 └── templates
113    ├── collections
114    └── sections
Rich Bennett1da30462017-08-24 12:11:36 -0400115
116Source Files
117------------
Rich Bennettd504dc82018-05-31 08:40:36 -0400118All documentation for project repositories should be structured and stored
Rich Bennett1da30462017-08-24 12:11:36 -0400119in or below `<your_project_repo>/docs/` directory as Restructured Text.
120ONAP jenkins jobs that verify and merge documentation are triggered by
Rich Bennett5baea462017-09-13 03:19:19 -0400121RST file changes in the top level docs directory and below.
Rich Bennett1da30462017-08-24 12:11:36 -0400122
Rich Bennett5baea462017-09-13 03:19:19 -0400123Licensing
Rich Bennett1da30462017-08-24 12:11:36 -0400124---------
125All contributions to the ONAP project are done in accordance with the
126ONAP licensing requirements. Documentation in ONAP is contributed
127in accordance with the `Creative Commons 4.0 <https://creativecommons.org/licenses/by/4.0/>`_ license.
Rich Bennettd504dc82018-05-31 08:40:36 -0400128All documentation files need to be licensed using the text below.
129The license may be applied in the first lines of all contributed RST
Rich Bennett1da30462017-08-24 12:11:36 -0400130files:
131
132.. code-block:: bash
133
134 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
Rich Bennettc5995662017-10-18 15:27:52 -0400135 .. http://creativecommons.org/licenses/by/4.0
136 .. Copyright YEAR ONAP or COMPANY or INDIVIDUAL
Rich Bennett1da30462017-08-24 12:11:36 -0400137
138 These lines will not be rendered in the html and pdf files.
139
Rich Bennettd504dc82018-05-31 08:40:36 -0400140When there are subsequent, significant contributions to a source file
141from a different contributor, a new copyright line may be appended
142after the last existing copyright line.