Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering for Director Operator docs variant #753

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ docs: docs-dependencies docs-user-all-variants docs-dev ## Build documentation
docs-user-all-variants:
cd docs_user; BUILD=upstream $(MAKE) html
cd docs_user; BUILD=downstream $(MAKE) html
cd docs_user; BUILD=downstream BUILD_VARIANT=ospdo $(MAKE) html

docs-user:
cd docs_user; $(MAKE) html
Expand Down
10 changes: 6 additions & 4 deletions docs_user/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
BUILD ?= upstream
BUILD_VARIANT ?=
BUILD_VARIANT_WITH_SEPARATOR ?= $(if $(strip $(BUILD_VARIANT)),-$(BUILD_VARIANT),)
BUILD_DIR = ../docs_build
ROOTDIR = $(realpath .)
NAME = adoption-user
DEST_DIR = $(BUILD_DIR)/$(NAME)
DEST_HTML = $(DEST_DIR)/index-$(BUILD).html
DEST_PDF = $(BUILD_DIR)/$(NAME)-$(BUILD).pdf
DEST_HTML = $(DEST_DIR)/index-$(BUILD)$(BUILD_VARIANT_WITH_SEPARATOR).html
DEST_PDF = $(BUILD_DIR)/$(NAME)-$(BUILD)$(BUILD_VARIANT_WITH_SEPARATOR).pdf
IMAGES_DIR = $(DEST_DIR)/images
IMAGES_TS = $(DEST_DIR)/.timestamp-images
MAIN_SOURCE = main.adoc
Expand Down Expand Up @@ -56,7 +58,7 @@ $(IMAGES_TS): $(IMAGES)
touch $(IMAGES_TS)

$(DEST_HTML): $(ALL_SOURCES)
$(BUNDLE_EXEC) asciidoctor -a source-highlighter=highlightjs -a highlightjs-languages="yaml,bash" -a highlightjs-theme="monokai" --failure-level WARN -a build=$(BUILD) -b xhtml5 -d book -o $@ $(MAIN_SOURCE)
$(BUNDLE_EXEC) asciidoctor -a source-highlighter=highlightjs -a highlightjs-languages="yaml,bash" -a highlightjs-theme="monokai" --failure-level WARN -a build=$(BUILD) -a build_variant=$(BUILD_VARIANT) -b xhtml5 -d book -o $@ $(MAIN_SOURCE)

$(DEST_PDF): $(ALL_SOURCES)
$(BUNDLE_EXEC) asciidoctor-pdf -a build=$(BUILD) -d book -o $@ $(MAIN_SOURCE) $(IMAGES)
$(BUNDLE_EXEC) asciidoctor-pdf -a build=$(BUILD) -a build_variant=$(BUILD_VARIANT) -d book -o $@ $(MAIN_SOURCE) $(IMAGES)
5 changes: 5 additions & 0 deletions docs_user/adoption-attributes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ ifeval::["{build}" == "downstream"]
:telemetry: Telemetry service
endif::[]

ifeval::["{build}-{build_variant}" == "downstream-ospdo"]
:OpenStackPreviousInstaller: director_operator
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this so that the ifevals from Pini's patches that say

ifeval::["{OpenStackPreviousInstaller}" == "director_operator"]

take effect. However, the OpenStackPreviousInstaller variable is not just used for the conditional, but also in the text. So it actually renders the "director_operator" value into the docs in several places like that, including the underscore.

We should probably replace all the

ifeval::["{OpenStackPreviousInstaller}" == "director_operator"]

with

ifeval::["{build_variant}" == "ospdo"]

and then set the OpenStackPreviousInstaller variable to something that looks nice in the rendered docs? @klgill @pinikomarov

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, OpenStackPreviousInstaller = director in the rendered downstream docs, and "TripleO" in the upstream rendered docs. This was done because downstream and upstream refer to the installer differently.

TBH I'm not sure why OpenStackPreviousInstaller was being used for the ifeval statement for OSPdO docs. Does the OSPdO content need its own value for the OpenStackPreviousInstaller variable in the text itself? Currently, we've just written the terms "director Operator" and "OSPdO" as is because the content is conditionalized for OSPdO anyway. I could be misunderstanding though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used OpenStackPreviousInstaller as a method to differentiate ospdo from regular director , that method could be any thing actually , as long as it preserves the logic

endif::[]


// Common URLs. Do not override. Do not delete.
:base_url: https://access.redhat.com/documentation
:defaultURL: https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/{rhos_curr_ver}/html
Expand Down
Loading