-
Notifications
You must be signed in to change notification settings - Fork 88
CLOUDP-317123 change markup for code blocks in Atlas CLI generated docs #4006
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
Conversation
21dd5ef
to
d452809
Compare
93e6ca4
to
d9f30f8
Compare
tools/cmd/docs/transformations.go
Outdated
} | ||
sb.WriteString(".. Code end marker, please don't delete this comment\n\n") | ||
sb.WriteString(" :language: shell\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would have to be indented three additional spaces to account for directive syntax change
sb.WriteString(" :language: shell\n") | |
sb.WriteString(" :language: shell\n") |
tools/cmd/docs/transformations.go
Outdated
} | ||
sb.WriteString(fmt.Sprintf(" literalinclude:: /includes/%s\n", includePayloadFileName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tweak to adhere to restructured text directive syntax
sb.WriteString(fmt.Sprintf(" literalinclude:: /includes/%s\n", includePayloadFileName)) | |
sb.WriteString(fmt.Sprintf(" .. literalinclude:: /includes/%s\n", includePayloadFileName)) |
tools/cmd/docs/transformations.go
Outdated
sb.WriteString(" --" + flagName + " " + ex.Flags[flagName]) | ||
} | ||
sb.WriteString("\n\n") | ||
sb.WriteString(fmt.Sprintf("literalinclude:: /includes/%s\n", includeCommandFileName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
sb.WriteString(fmt.Sprintf("literalinclude:: /includes/%s\n", includeCommandFileName)) | |
sb.WriteString(fmt.Sprintf(".. literalinclude:: /includes/%s\n", includeCommandFileName)) |
tools/cmd/docs/transformations.go
Outdated
if tabs { | ||
sb.WriteString(" ") | ||
} | ||
sb.WriteString(".. Code end marker, please don't delete this comment\n\n") | ||
sb.WriteString(":language: shell\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
sb.WriteString(":language: shell\n") | |
sb.WriteString(" :language: shell\n") |
@jwilliams-mongo do you want to double check again? |
tools/cmd/docs/main.go
Outdated
@@ -25,13 +25,18 @@ import ( | |||
"github.com/spf13/cobra" | |||
) | |||
|
|||
const ( | |||
docsPath = "./docs/command" | |||
includesPath = "./docs/command/includes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
includesPath = "./docs/command/includes" | |
includesPath = "./docs/includes" |
the includes are being nested within the command directory. For docs-mongodb-internal, the command directory is not within includes, so the docs build is not able to find the files. For cloud-docs, the includes are nested too deeply and the build is not able to find them without updating the paths to be more specific.
this will make it easier to place the includes in the right folder in the destination repositories as part of a separate workflow and have a single includes path in the commands that can apply to both docs repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in addition to this change, I believe we can add new workflows in https://github.com/mongodb/mongodb-atlas-cli/edit/master/build/ci/copy.bara.sky.template to add new destination_files and new transformations.
the new transformation would move the includes into this new subdirectory, called something like includes/atlas-cli-examples
tools/cmd/docs/transformations.go
Outdated
} | ||
sb.WriteString(fmt.Sprintf(" .. literalinclude:: /includes/%s\n", includePayloadFileName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we likely need to amend this as well if we add a new workflow that adds a subdirectory for these examples under includes
sb.WriteString(fmt.Sprintf(" .. literalinclude:: /includes/%s\n", includePayloadFileName)) | |
sb.WriteString(fmt.Sprintf(" .. literalinclude:: /includes/atlas-cli-examples/%s\n", includePayloadFileName)) |
tools/cmd/docs/transformations.go
Outdated
sb.WriteString(" --" + flagName + " " + ex.Flags[flagName]) | ||
} | ||
sb.WriteString("\n\n") | ||
sb.WriteString(fmt.Sprintf(".. literalinclude:: /includes/%s\n", includeCommandFileName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sb.WriteString(fmt.Sprintf(".. literalinclude:: /includes/%s\n", includeCommandFileName)) | |
sb.WriteString(fmt.Sprintf(".. literalinclude:: /includes/atlas-cli-examples/%s\n", includeCommandFileName)) |
latest copybara tests are https://github.com/10gen/cloud-docs/pull/7371 and https://github.com/10gen/docs-mongodb-internal/pull/12512 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fmenezes thanks for your efforts here. LGTM!
Coverage Report 📉
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Proposed changes
change markup for code blocks in Atlas CLI generated docs
Jira ticket: CLOUDP-317123
Closes #[issue number]
Checklist
make fmt
and formatted my codeFurther comments
Ignore commits with "update docs" or "gen docs", these are auto generated text files, feel free to ignore
.json
or.sh
files.