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

Example Usage Templates #102

Open
natescherer opened this issue Nov 16, 2022 · 2 comments
Open

Example Usage Templates #102

natescherer opened this issue Nov 16, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@natescherer
Copy link

natescherer commented Nov 16, 2022

Wanted to get some thoughts about maybe adding templates for the Example Usage section, similar to the use of NOTES.md. As it stands now, this action overwrites the Example Usage section each time it runs, which is less than ideal.

I was thinking maybe an EXAMPLES.json file like the following:

{
    "optionSets": [
        {
            "optionOne": "valueOne"
        },
        {
            "optionTwo": "valueTwo"
        }
    ]
}

If this seems agreeable, I could cook up a PR for this, I think.

@joshspicer
Copy link
Member

joshspicer commented Nov 16, 2022

That seems super reasonable, thanks for offering to contribute it!

Given the current auto-generated example:

"features": {
    "ghcr.io/devcontainers/features/desktop-lite:1": {}
}

I agree that some file (EXAMPLES.json) could look something like:

[
  "With a version": {
     "version": "1.0.0"
  },
  "With a version and password": {
     "version": "1.0.0",
     "password": "vscode"
  },

]

...To then generate markdown like:


Example Usage

With a version

"features": {
    "ghcr.io/devcontainers/features/desktop-lite:1": {
       "version": "1.0.0"
    }
}

With a version and password

"features": {
    "ghcr.io/devcontainers/features/desktop-lite:1": {
       "version": "1.0.0",
       "password": "vscode"
    }
}

@joshspicer
Copy link
Member

I've also tossed around the idea of putting all of a Feature's default options into the value object, but landed on the empty object for copy/paste simplicity. Effectively, putting all options at the default value resolves to exactly the same as placing nothing.

That said, I like your idea of giving the author the choice. (Could be cool to do some simple validation on the output to ensure those options exist in the devcontainer-feature.json)

@joshspicer joshspicer added the enhancement New feature or request label Nov 16, 2022
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

2 participants