Skip to content

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

Merged
merged 9 commits into from
Jun 26, 2025

Conversation

fmenezes
Copy link
Collaborator

@fmenezes fmenezes commented Jun 24, 2025

Proposed changes

change markup for code blocks in Atlas CLI generated docs

Jira ticket: CLOUDP-317123

Closes #[issue number]

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation in document requirements section listed in CONTRIBUTING.md (if appropriate)
  • I have addressed the @mongodb/docs-cloud-team comments (if appropriate)
  • I have updated test/README.md (if an e2e test has been added)
  • I have run make fmt and formatted my code

Further comments

Ignore commits with "update docs" or "gen docs", these are auto generated text files, feel free to ignore .json or .sh files.

@fmenezes fmenezes changed the title CLOUDP 317123 CLOUDP-317123 change markup for code blocks in Atlas CLI generated docs Jun 24, 2025
@fmenezes fmenezes force-pushed the CLOUDP-317123 branch 5 times, most recently from 21dd5ef to d452809 Compare June 24, 2025 15:18
@fmenezes fmenezes force-pushed the CLOUDP-317123 branch 2 times, most recently from 93e6ca4 to d9f30f8 Compare June 24, 2025 17:24
@fmenezes fmenezes marked this pull request as ready for review June 24, 2025 17:24
@fmenezes fmenezes requested review from a team as code owners June 24, 2025 17:24
}
sb.WriteString(".. Code end marker, please don't delete this comment\n\n")
sb.WriteString(" :language: shell\n")
Copy link
Contributor

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

Suggested change
sb.WriteString(" :language: shell\n")
sb.WriteString(" :language: shell\n")

}
sb.WriteString(fmt.Sprintf(" literalinclude:: /includes/%s\n", includePayloadFileName))
Copy link
Contributor

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

Suggested change
sb.WriteString(fmt.Sprintf(" literalinclude:: /includes/%s\n", includePayloadFileName))
sb.WriteString(fmt.Sprintf(" .. literalinclude:: /includes/%s\n", includePayloadFileName))

sb.WriteString(" --" + flagName + " " + ex.Flags[flagName])
}
sb.WriteString("\n\n")
sb.WriteString(fmt.Sprintf("literalinclude:: /includes/%s\n", includeCommandFileName))
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Suggested change
sb.WriteString(fmt.Sprintf("literalinclude:: /includes/%s\n", includeCommandFileName))
sb.WriteString(fmt.Sprintf(".. literalinclude:: /includes/%s\n", includeCommandFileName))

if tabs {
sb.WriteString(" ")
}
sb.WriteString(".. Code end marker, please don't delete this comment\n\n")
sb.WriteString(":language: shell\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Suggested change
sb.WriteString(":language: shell\n")
sb.WriteString(" :language: shell\n")

@fmenezes
Copy link
Collaborator Author

@jwilliams-mongo do you want to double check again?

@@ -25,13 +25,18 @@ import (
"github.com/spf13/cobra"
)

const (
docsPath = "./docs/command"
includesPath = "./docs/command/includes"
Copy link
Contributor

@jwilliams-mongo jwilliams-mongo Jun 25, 2025

Choose a reason for hiding this comment

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

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

Copy link
Contributor

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

}
sb.WriteString(fmt.Sprintf(" .. literalinclude:: /includes/%s\n", includePayloadFileName))
Copy link
Contributor

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

Suggested change
sb.WriteString(fmt.Sprintf(" .. literalinclude:: /includes/%s\n", includePayloadFileName))
sb.WriteString(fmt.Sprintf(" .. literalinclude:: /includes/atlas-cli-examples/%s\n", includePayloadFileName))

sb.WriteString(" --" + flagName + " " + ex.Flags[flagName])
}
sb.WriteString("\n\n")
sb.WriteString(fmt.Sprintf(".. literalinclude:: /includes/%s\n", includeCommandFileName))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
sb.WriteString(fmt.Sprintf(".. literalinclude:: /includes/%s\n", includeCommandFileName))
sb.WriteString(fmt.Sprintf(".. literalinclude:: /includes/atlas-cli-examples/%s\n", includeCommandFileName))

@fmenezes
Copy link
Collaborator Author

@fmenezes fmenezes requested a review from jwilliams-mongo June 26, 2025 14:52
Copy link
Contributor

@jwilliams-mongo jwilliams-mongo left a 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!

Copy link
Contributor

Coverage Report 📉

Branch Commit Coverage
master ff05591 25.8%
CLOUDP-317123 73fa7aa 25.7%
Difference -.1%

Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

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

LGTM

@fmenezes fmenezes merged commit 891d09f into master Jun 26, 2025
22 checks passed
@fmenezes fmenezes deleted the CLOUDP-317123 branch June 26, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants