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

Markdown output #51

Closed
WyriHaximus opened this issue Aug 7, 2023 · 6 comments
Closed

Markdown output #51

WyriHaximus opened this issue Aug 7, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@WyriHaximus
Copy link

Been using this tool to generate changes for automated PR's like this one: php-api-clients/github-root#438
It doesn't look pretty but it pains a clear enough picture. Would you be open for a PR adding a markdown as an output?

@daveshanley
Copy link
Member

Oh wow, this is great! I would love to see a markdown output for the summary command. It would be a great upgrade!

@WyriHaximus
Copy link
Author

Great, let me brush up my Go and see how far I get with a first iteration. No clue how to visualise it yet tho.

@WyriHaximus
Copy link
Author

Been digging through the source to see how it all works. Don't get everything yet, but I did already start working on possible outputs. These are all based on php-api-clients/github-root#482 as base reference how I'm using this tool now:

Same as summary but wrapping the tree in ```

Detected Schema changes:

└─┬Paths
  ├─┬/repos/{owner}/{repo}/actions/secrets/{secret_name}
  │ └─┬PUT
  │   └──[M] description (17035:20)
  ├─┬/orgs/{org}/dependabot/secrets/{secret_name}
  │ └─┬PUT
  │   └──[M] description (9305:20)
  ├─┬/orgs/{org}/actions/secrets/{secret_name}
  │ └─┬PUT
  │   └──[M] description (8734:20)
  ├─┬/repos/{owner}/{repo}/dependabot/secrets/{secret_name}
  │ └─┬PUT
  │   └──[M] description (22969:20)
  └─┬/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}
    └─┬PUT
      └──[M] description (33241:20)

Date: 08/01/23 | Commit: New: etc/specs/GitHubEnterprise-3.7/previous.spec.yaml, Original: etc/specs/GitHubEnterprise-3.7/current.spec.yaml
Document Element | Total Changes | Breaking Changes
paths | 5 | 0
INFO: Total Changes: 5
INFO: Modifications: 5

Using markdown to build the tree structure

Detected Schema changes:

  • Paths
    • /repos/{owner}/{repo}/actions/secrets/{secret_name}
      • PUT
        • [M] description (17035:20)
    • /orgs/{org}/dependabot/secrets/{secret_name}
      • PUT
        • [M] description (9305:20)
    • /orgs/{org}/actions/secrets/{secret_name}
      • PUT
        • [M] description (8734:20)
    • /repos/{owner}/{repo}/dependabot/secrets/{secret_name}
      • PUT
        • [M] description (22969:20)
    • /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}
      • PUT
        • [M] description (33241:20)

Date: 08/01/23 | Commit: New: etc/specs/GitHubEnterprise-3.7/previous.spec.yaml, Original: etc/specs/GitHubEnterprise-3.7/current.spec.yaml
Document Element | Total Changes | Breaking Changes
paths | 5 | 0
INFO: Total Changes: 5
INFO: Modifications: 5

Using markdown to build the tree structure with emoji

Detected Schema changes:

  • Paths
    • /repos/{owner}/{repo}/actions/secrets/{secret_name}
      • PUT
        • [🔀] description (17035:20)
    • /orgs/{org}/dependabot/secrets/{secret_name}
      • PUT
        • [🔀] description (9305:20)
    • /orgs/{org}/actions/secrets/{secret_name}
      • PUT
        • [🔀] description (8734:20)
    • /repos/{owner}/{repo}/dependabot/secrets/{secret_name}
      • PUT
        • [🔀] description (22969:20)
    • /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}
      • PUT
        • [🔀] description (33241:20)

Date: 08/01/23 | Commit: New: etc/specs/GitHubEnterprise-3.7/previous.spec.yaml, Original: etc/specs/GitHubEnterprise-3.7/current.spec.yaml
Document Element | Total Changes | Breaking Changes
paths | 5 | 0
INFO: Total Changes: 5
INFO: Modifications: 5

@daveshanley daveshanley added the enhancement New feature or request label Aug 25, 2023
@ppmathis
Copy link

ppmathis commented Mar 7, 2024

@WyriHaximus Is this something you're still working on? Do you need any help with it? I've been looking into using openapi-changes in a similar matter, although for GitLab, and would also love a proper Markdown representation. Currently I'm just wrapping the whole thing inside a code block, which works but is obviously not as pretty.

@WyriHaximus
Copy link
Author

@ppmathis I still want to complete this, but honestly, my Go isn't that great, and this project may be more than I can chew on right now. Will have a look at this again this weekend. Been using it a lot on https://github.com/php-api-clients/github-root

daveshanley added a commit that referenced this issue Mar 24, 2024
using the `—markdown`  / `-m` flag will render the summary output as CI/CD friendly markdown, using emojis in the tree view. As requested in issue #51

Signed-off-by: quobix <dave@quobix.com>
daveshanley added a commit that referenced this issue Mar 24, 2024
using the `—markdown`  / `-m` flag will render the summary output as CI/CD friendly markdown, using emojis in the tree view. As requested in issue #51

Signed-off-by: quobix <dave@quobix.com>
@daveshanley
Copy link
Member

There is a new flag available in v0.0.56 for the summary command.

--markdown or -m will render the tree, tables and summary as markdown and uses emojis.

Docs have been updated

https://pb33f.io/openapi-changes/summary/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants