Skip to content

Future Documentation workflow #1352

Merged
wtrocki merged 19 commits intomainfrom
adoc-modular
Jan 7, 2022
Merged

Future Documentation workflow #1352
wtrocki merged 19 commits intomainfrom
adoc-modular

Conversation

@wtrocki
Copy link
Collaborator

@wtrocki wtrocki commented Dec 16, 2021

Resolves #1225 #1226

Motivation

  1. Provide number of modifications in the CLI so we have level of flexibility when generating content and do not need 2 phase generator.
  2. Avoid having generated documentation in main branch (as main branch will have unreleased changes
  3. Provide solution for generating documentation on release for downstream and upstream - meeting all requirements.

I have removed generate-modular docs and will have content generation.
I still have docs in the repository present

How to support downstream

I think we can have dedicated branch that can be updated on the release of the CLI that will have generated content that is very specific to downstream. Our upstream content then will not be used by downstream if needed.

Tasks

  • refactor codebase to support different requirements
  • Drop rhoas prefix from titles
  • Support generation of the index/assembly file from make generateDocs
  • Integrate with content team requirements (regenerate proper content)
  • [ ]

@wtrocki wtrocki requested a review from pmuir December 16, 2021 16:58
@pmuir
Copy link
Collaborator

pmuir commented Dec 16, 2021

Looks great generally.

@wtrocki wtrocki force-pushed the adoc-modular branch 5 times, most recently from eb723f9 to 815d03a Compare December 21, 2021 12:55
@wtrocki
Copy link
Collaborator Author

wtrocki commented Dec 21, 2021

My overal suggestion would be to see if we can:

  • Format content to be downstream specific and do not present it in github main branch
  • Push content to separate branch rather than keep it on main (automatically updated)
  • Remove need for developers to push content itself to the main repo - we might need separate job to push it to our website as markdown files - this means that users can view released documentation and not what is currently in the development. This will mean less conflicts on documentation etc.

How this would work

I think we can have documentation for the CLI or think about webpage for RHOAS services.
if we keep documentation for CLI we can have job that triggers gh-pages update with markdown containing upstream docs. The same job can generate downstream specific docs on the downstream-docs branch.

FYI @rkpattnaik780 @craicoverflow

@wtrocki wtrocki changed the title Improve workflow for modular docs generation Future Documentation workflow Dec 22, 2021
@bhardesty
Copy link
Contributor

@wtrocki Thanks, I think this should work for the downstream. Would it be possible to tweak the file names and directories? Right now, it looks like all of the downstream command files and the readme are located in docs/commands/. Do you plan to have that on the main branch? I think it would work better with our downstream tooling if we put it on a separate branch, like we do now for modular-docs (that might be what you meant when you said something about a dedicated branch for downstream-specific content).

Could we also use the same directory structure and naming conventions that we currently use in modular-docs? That would mean:

  • docs/commands/README.adoc -> assemblies/assembly-cli-command-reference.adoc
  • docs/commands/.adoc -> modules/ref-.adoc (note the "ref-" prefix on each of these)
  • In README.adoc, the include paths should all be include::../modules/ref-<command-name>.adoc[leveloffset=+1]

@wtrocki
Copy link
Collaborator Author

wtrocki commented Jan 5, 2022

What I have done in this PR is to enable us to use released version of rhoas cli to generate docs (with some of the work done before by @craicoverflow)

So to answer your questions: all is possible by using cli command. I see next step to remove adoc documentation completely from main branch and replace it by markdown one.

How donwstream job works? Does it clone our repository? Does it call some make targets etc?

@wtrocki wtrocki requested a review from a team as a code owner January 6, 2022 17:02
@wtrocki
Copy link
Collaborator Author

wtrocki commented Jan 6, 2022

Screenshot 2022-01-06 at 17 02 16

File format and structure is now corrected. Downstream build is setup.
I will now remove adoc files and replace them with markdown

@wtrocki
Copy link
Collaborator Author

wtrocki commented Jan 6, 2022

@bhardesty Please view https://github.com/redhat-developer/app-services-cli/tree/downstream-docs

that is the new branch that contains freshly generated content based on this PR.

@wtrocki wtrocki requested a review from craicoverflow January 6, 2022 17:09
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

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.

@@ -0,0 +1,47 @@
## rhoas completion
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually I will remove markdown files and generate them in separate PR

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 obviously fail the build so I will generate docs as last step before merge :D

@wtrocki
Copy link
Collaborator Author

wtrocki commented Jan 6, 2022

Also let me know if we need more categories for subcomands etc. - That will be trivial to add on the same levels.

Nested levels in the index are separeate feature request :P

@wtrocki
Copy link
Collaborator Author

wtrocki commented Jan 6, 2022

Found small bug in links on github, but that part will go away anyway.

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
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.

Comment on lines +92 to +93
rm -rf ./docs/commands/*
go run ./cmd/rhoas docs --dir ./dist --file-format adoc
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.

@wtrocki
Copy link
Collaborator Author

wtrocki commented Jan 7, 2022

@bhardesty
Copy link
Contributor

@wtrocki This looks awesome! I just have one small modification: for each included file, can you change the leveloffset from 1 to 2? For example: include::../modules/ref-completion.adoc[leveloffset=+2].

@wtrocki wtrocki merged commit 9de0060 into main Jan 7, 2022
@wtrocki wtrocki deleted the adoc-modular branch January 7, 2022 20:08
@wtrocki
Copy link
Collaborator Author

wtrocki commented Jan 7, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group commands in the CLI reference guide

4 participants