You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+81-16Lines changed: 81 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,6 @@ This repo contains the documentation for
8
8
9
9
The documentation is sourced in http://www.methods.co.nz/asciidoc/[AsciiDoc] and transformed into HTML/CSS and other formats through http://asciidoctor.org/[AsciiDoctor]-based automation.
10
10
11
-
== Branches
12
-
13
-
Documentation for different OpenShift distributions is handled on different branches.
14
-
15
-
* `master` - OpenShift Origin latest code
16
-
* `openshift-origin-release-N` - OpenShift Origin most recent stable release
17
-
* `openshift-online` - OpenShift Online most recent release
18
-
* `enterprise-N.N` - OpenShift Enterprise support releases
19
-
20
11
== Repo Organization
21
12
22
13
Each directory of the repo represents a different collection of topics (you can think of directories as books). The exception is the `build_system` directory, which contains the code used to generate the finished documentation. Within each 'book' directory, topics exist as separate asciidoc files and an `images` directory contains any images that are included in the topics.
@@ -33,27 +24,101 @@ Each directory of the repo represents a different collection of topics (you can
33
24
/bookN
34
25
----
35
26
36
-
== Metadata
27
+
== Version Management
28
+
The overlap of documentation across OpenShifts Origin, Online and Enterprise is no less than 80%. In many cases, this means that individual topics may need to include or exclude individual paragraphs with respect to a specific OpenShift distribution. While it is _possible_ to accomplish this solely by using git branches to maintain slightly different versions of a given topic, doing so would make the task of maintaining internal consistency extrememely difficult for content contributors.
29
+
30
+
Git branching is still extremely valuable, and serves the important role of tracking the release versions of documentation for the various OpenShift distributions.
31
+
32
+
=== Distribution-Specific Conditionals
33
+
OpenShift documentation uses AsciiDoc's `ifdef/endif` macro to conditionalize document segments for specific OpenShift distributions down to the single-line level.
34
+
35
+
The supported distribution attributes used in the OpenShift document generator are:
36
+
37
+
* `openshift-origin`
38
+
* `openshift-online`
39
+
* `openshift-enterprise`
40
+
41
+
These attributes can be used alone or together to conditionalize text within a topic document.
42
+
43
+
Here is an example of this concept in use:
44
+
45
+
----
46
+
This first line is unconditionalized, and will appear for all versions.
47
+
48
+
\ifdef::openshift-online[]
49
+
This line will only appear for OpenShift Online.
50
+
\endif::[]
51
+
52
+
\ifdef::openshift-enterprise[]
53
+
This line will only appear for OpenShift Enterprise.
54
+
\endif::[]
55
+
56
+
\ifdef::openshift-origin,openshift-enterprise[]
57
+
This line will appear for OpenShift Origin and Enterprise, but not for OpenShift Online.
58
+
\endif::[]
59
+
----
60
+
61
+
Two important points to keep in mind:
62
+
63
+
* The `ifdef/endif` blocks have no size limit, however they should _not_ be used to conditionalize an entire topic. If an entire topic file is specific to a given OpenShift distribution, refer to the link:#document-set-metadata[Document Set Metadata] section for information on how to conditionalize at the whole-topic level.
64
+
65
+
* The `ifdef/endif` blocks _cannot be nested_. In other words, one conditional block cannot contain other conditional blocks.
66
+
67
+
=== Release Branches
68
+
Through the use of link:#distribution-specific-conditionals[Distribution-Specific Conditionals] and link:#document-set-metadata[Document Set Metadata], the master branch of this repository always contains a complete set of documentation that includes all of the OpenShift distributions. However, when and as new versions of the OpenShift distros are released, the master branch is merged down to new or existing release branches. Here is the general naming scheme used in the branches:
69
+
70
+
* `master` - OpenShift Origin latest code
71
+
* `origin-N.N` - OpenShift Origin most recent stable release
72
+
* `online` - OpenShift Online most recent release
73
+
* `enterprise-N.N` - OpenShift Enterprise support releases
74
+
75
+
On a nightly basis, the documentation is rebuilt for each of these branches. In this manner, documentation for released versions of OpenShift will remain the same even as development continues on master. Additionally, any corrections or additions that are "cherry-picked" into the release branches will show up in the release documentation the next day.
76
+
77
+
== Document Set Metadata
78
+
In order to construct the documentation site from these sources, the build system looks at the `_build_cfg.yml` metdata file. The build system _only_ looks in this file for information on which files to include, so any new file submissions must be accompanied by an update to this metadata file.
37
79
38
-
In order to construct the documentation site from these sources, the build system looks at the `_build_cfg.yml` metdata file. The format of this files is as indicated:
<1> Record separator at the top of each topic group
51
97
<2> Display name of topic group
52
98
<3> Directory name of topic group
53
-
<4> Topic name
54
-
<5> Topic file under the topic group dir withour without '.adoc'
99
+
<4> Which OpenShift versions this topic group is part of
100
+
<5> Topic name
101
+
<6> Topic file under the topic group dir without '.adoc'
102
+
<7> Which OpenShift versions this topic is part of
103
+
104
+
=== Notes on "Distros"
105
+
106
+
* The "Distros" setting is optional for topic groups and topic items. When the "Distros" setting is absent, the system treats the topic group or topic as though the user had set "Distros: all".
107
+
* The "all" value for "Distros" is a synonym for "openshift-origin,openshift-enterprise,openshift-online".
108
+
* The "all" value trumps other values, so "openshift-online,all" is treated as "all"
109
+
110
+
== Understanding the Complete Distribution Condition Chain
111
+
It is important to understand the ordering of distribution conditionals in determining whether or not a specific piece of content appears in the documentation set. The hierarchy is fairly straightforward:
112
+
113
+
1. Topic group "Distros" setting from `_build_cfg.yml`
114
+
2. Topic item "Distros" setting from `_build_cfg.yml`
115
+
3. Document-level `ifdef/endif` blocks
116
+
117
+
In this manner:
118
+
119
+
* If a topic group is configured with "Distros: openshift-online", the entire group will be skipped for OpenShift Enterprise and OpenShift Origin, regardless of the Topic-level and document-level content rules within that group.
55
120
56
-
The build system only looks in this file for information on which files to include, so any new file submissions must be accompanied by an update to this metadata file.
121
+
* When a topic group is available to all Distros, but a specific topic item is limited, the topic group will appear for all distros and the specific topic item will only appear for the indicated distros.
57
122
58
123
== Live Editing
59
124
If you would like to work on one of the documentation files in an editing environment that automatically redraws the resulting HTML, follow these steps.
raise"In #{build_config_file}, the Distros value #{topic_group['Distros'].inspect} for topic group #{topic_group['Name']} is not valid. Legal values are 'all', #{key_list}, or a comma-separated list of legal values."
if not File.exists?(File.join(source_dir,topic_group['Dir'],"#{topic['File']}.adoc"))
91
181
raise"In #{build_config_file}, could not find file #{topic['File']} under directory #{topic_group['Dir']} for topic #{topic['Name']} in topic group #{topic_group['Name']}."
raise"In #{build_config_file}, the Distros value #{topic_group['Distros'].inspect} for topic item #{topic['Name']} in topic group #{topic_group['Name']} is not valid. Legal values are 'all', #{key_list}, or a comma-separated list of legal values."
187
+
end
188
+
topic['Distros']=parse_distros(topic['Distros'])
189
+
else
190
+
topic['Distros']=parse_distros('all')
191
+
end
93
192
end
94
193
end
95
194
config_data
96
195
end
97
196
98
-
defnav_tree
197
+
defnav_treedistro
99
198
@nav_tree ||= begin
100
199
navigation=[]
101
200
build_config.eachdo |topic_group|
201
+
nextif not topic_group['Distros'].include?(distro)
0 commit comments