Skip to content

Commit 6916e45

Browse files
Merge pull request #39093 from vikram-redhat/move_topic_maps
Moved topic map in main, updated builds and instructions
2 parents fb13691 + 6971e10 commit 6916e45

File tree

4 files changed

+50
-7
lines changed

4 files changed

+50
-7
lines changed
File renamed without changes.

build.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import time
2323
import yaml
2424
import requests
25+
import tempfile
2526

2627
from aura import cli
2728

@@ -151,9 +152,25 @@ def find_build_config_file():
151152
"""
152153
Finds the build config file to use, as it might be _topic_map.yml or _build_cfg.yml
153154
"""
154-
config = os.path.abspath(os.path.join(CLONE_DIR, "_topic_map.yml"))
155+
156+
# updated 23rd Nov to support files in _topic_maps folder
157+
158+
# load everything from the _topic_maps folder
159+
file_list = os.listdir(os.path.join(CLONE_DIR, "_topic_maps"))
160+
161+
# create a temp file combining all values from that folder
162+
# don't delete it immediately, and give it a suffix of swp which makes it ignored by git
163+
with tempfile.NamedTemporaryFile(dir=CLONE_DIR, delete=False, suffix=".swp") as tmp:
164+
for f in file_list:
165+
with open(os.path.join(CLONE_DIR, "_topic_maps", f), "rb") as infile:
166+
tmp.write(infile.read())
167+
168+
config = os.path.abspath(tmp.name)
169+
log.info(config)
170+
171+
# backup look for a single _topic_map in the cloned directory
155172
if not os.path.isfile(config):
156-
config = os.path.abspath(os.path.join(CLONE_DIR, "_build_cfg.yml"))
173+
config = os.path.abspath(os.path.join(CLONE_DIR, "_topic_map.yml"))
157174

158175
return config
159176

build_for_portal.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import time
1616
import yaml
1717
import requests
18+
import tempfile
1819

1920
from aura import cli
2021

@@ -144,13 +145,28 @@ def find_build_config_file():
144145
"""
145146
Finds the build config file to use, as it might be _topic_map.yml or _build_cfg.yml
146147
"""
147-
config = os.path.abspath(os.path.join(CLONE_DIR, "_topic_map.yml"))
148+
149+
# updated 23rd Nov to support files in _topic_maps folder
150+
151+
# load everything from the _topic_maps folder
152+
file_list = os.listdir(os.path.join(CLONE_DIR, "_topic_maps"))
153+
154+
# create a temp file combining all values from that folder
155+
# don't delete it immediately, and give it a suffix of swp which makes it ignored by git
156+
with tempfile.NamedTemporaryFile(dir=CLONE_DIR, delete=False, suffix=".swp") as tmp:
157+
for f in file_list:
158+
with open(os.path.join(CLONE_DIR, "_topic_maps", f), "rb") as infile:
159+
tmp.write(infile.read())
160+
161+
config = os.path.abspath(tmp.name)
162+
log.info(config)
163+
164+
# backup look for a single _topic_map in the cloned directory
148165
if not os.path.isfile(config):
149-
config = os.path.abspath(os.path.join(CLONE_DIR, "_build_cfg.yml"))
166+
config = os.path.abspath(os.path.join(CLONE_DIR, "_topic_map.yml"))
150167

151168
return config
152169

153-
154170
def parse_build_config(config):
155171
"""
156172
Parses the build config and returns a tree based structure for the config.

contributing_to_docs/contributing.adoc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ contain all the images and modules for the collection.
5656

5757
== Version management
5858
Most of the content applies to all five OpenShift products: OKD, OpenShift
59-
Online, OpenShift Dedicated, Azure Red Hat OpenShift and OpenShift Container Platform. While a large
59+
Online, OpenShift Dedicated, ROSA and OpenShift Container Platform. While a large
6060
amount of content is reused for all product collections, some information
6161
applies to only specific collections. Content inclusion and exclusion is managed
6262
on the assembly level by specifying distributions in the
63-
`_topic_map.yml` file or by using `ifdef/endif` statements in individual
63+
`_topic_map.yml` files in the `_topic_maps` folder or by using `ifdef/endif` statements in individual
6464
files.
6565

6666
////
@@ -88,6 +88,7 @@ are:
8888
* _openshift-dedicated_
8989
* _openshift-aro_
9090
* _openshift-webscale_
91+
* _openshift-rosa_
9192

9293
These attributes can be used by themselves or in conjunction to conditionalize
9394
text within an assembly or module.
@@ -164,12 +165,18 @@ file to determine which topic files to include. Therefore, all new assemblies th
164165
are created must be included in the `_topic_map.yml` file in
165166
order to be processed by the build system.
166167

168+
For all supported versions, the topic map files are available in the `_topic_maps` folder. Older versions support `_topic_map.yml` file in the root folder.
169+
170+
OpenShift Dedicated and OpenShift ROSA have their own topic maps: `_topic_map_osd.yml` and `_topic_map_rosa.yml`. Edits to these files should be coordinated with Service Delivery documentation team members as that team is primarily responsible for maintaining this content.
171+
167172
[NOTE]
168173
====
169174
Module files are included in the appropriate assembly files. Modules are not added directly to the `_topic_map.yml` file.
170175
====
171176

172177
=== Topic map file format
178+
For supported branches the `_topic_map.yml` is based in the `_topic_maps` folder in the root directory and are organized (primarily) by distributions.
179+
173180
The `_topic_map.yml` file uses the following format:
174181

175182
----
@@ -204,13 +211,16 @@ topic or topic group will appear in all product documentation versions.
204211
_openshift-origin,openshift-enterprise,openshift-online,openshift-dedicated,openshift-aro,openshift-webscale_.
205212
* The *all* value overrides other values, so _openshift-online,all_ is processed
206213
as *all*.
214+
* Do not use _openshift-dedicated_ or _openshift-rosa_ in the main `_topic_map.yml` file. Use the distribution specific topic map file.
207215
<5> Assembly name.
208216
<6> Assembly file under the topic group dir without `.adoc`.
209217
<7> This topic is actually a subtopic group. Instead of a `File` path it has a
210218
`Dir` path and `Topics`, just like a top-level topic group.
211219
<8> Assemblies belonging to a subtopic group are listed just like regular assemblies
212220
with a `Name` and `File`.
213221

222+
223+
214224
== Next steps
215225
* First, you should link:tools_and_setup.adoc[install and set up the tools and software]
216226
on your workstation so that you can contribute.

0 commit comments

Comments
 (0)