Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
16 changes: 11 additions & 5 deletions .github/workflows/modular-docs-publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# This workflow will generate modular docs and publish to the modular-docs branch

name: Modular docs publish
name: Downstream docs publish

# on:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will be enabled once approved. We use other trigger for testing

# push:
# tags:
# - 'v*'

## For testing
on:
push:
branches: [ main ]
branches: [ adoc-modular ]

jobs:
build:
Expand All @@ -16,10 +22,10 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- run: make generate-modular-docs
name: Generate modular-docs
- run: make generate-downstream-docs
name: Generate generate-downstream-docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.9
with:
branch: modular-docs # The branch the action should deploy to.
branch: downstream-docs # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,18 @@
"--yes"
]
},
{
"name": "Docs",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/rhoas",
"env": {},
"args": [
"docs",
"--file-format", "adoc",
"--dir", "./docs/commands"
]
},
]
}
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ check-docs: generate-docs ## Check whether reference documentation needs to be g

generate-docs: ## Generate command-line reference documentation
rm -rf ./docs/commands/*
go run ./cmd/rhoas docs --dir ./docs/commands --file-format adoc
go run ./cmd/rhoas docs --dir ./docs/commands --file-format md
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Markdown by default - same rules as with adoc (already replaced in the PR).
Downstream gets adoc files that are pushed to separate branch that no one will see.

Copy link
Contributor

Choose a reason for hiding this comment

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

tip: md is already the default value, so you could omit it, if you wanted to.

.PHONY: generate-docs

generate-modular-docs: generate-docs ## Generate modular command-line reference documentation
SRC_DIR=$$(pwd)/docs/commands DEST_DIR=$$(pwd)/dist go run ./cmd/modular-docs
.PHONY: generate-modular-docs
generate-downstream-docs: ## Generate command-line reference documentation in adoc format
rm -rf ./docs/commands/*
go run ./cmd/rhoas docs --dir ./dist --file-format adoc
Comment on lines +92 to +93
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this removing ./docs/commands, but then generating the documentation into a completely different directory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Very good question. I think I need to provide documentation for that in the contributing to make it clear.

So the new workflow will split upstream and downstream:

  1. We will have markdown ./docs/commands/ (./docs/commands/rhoas-cluster.md).
    I did not push that markdown here due to number of files created that will obfuscate already large PR
    Phase 2 for this would be to use that markdown with docusaurus website and create couple other placeholders like CLI guidelines etc.

  2. We will have adoc/downstream pushed to different branch (only on releases) - for that we use ./dist/ folder that is gitignored so we can use it to push entire content to the new branch using github action.

.PHONY: generate-downstream-docs

lint-lang: ## Lint i18n files
go install github.com/redhat-developer/app-services-go-linter/cmd/app-services-go-linter@latest
Expand Down
16 changes: 0 additions & 16 deletions cmd/modular-docs/main.go

This file was deleted.

107 changes: 0 additions & 107 deletions docs/commands/rhoas.adoc

This file was deleted.

78 changes: 0 additions & 78 deletions docs/commands/rhoas_cluster.adoc

This file was deleted.

66 changes: 0 additions & 66 deletions docs/commands/rhoas_cluster_bind.adoc

This file was deleted.

52 changes: 0 additions & 52 deletions docs/commands/rhoas_cluster_clean.adoc

This file was deleted.

Loading