Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add support for metadata comments in samples #230

Merged
merged 3 commits into from
Apr 24, 2019
Merged

Conversation

bcoe
Copy link
Contributor

@bcoe bcoe commented Apr 23, 2019

This adds support for providing additional sample meta-information, based on comments embedded within sample files, like so:

// sample-metadata:
//   title: ACL (Access Control)
//   description: Demonstrates setting access control rules.

Fields we currently intend to support:

  • title: a human readable title for the sample.
  • description: description of a sample.
  • usage: usage instructions for a sample, e.g., node sample.js --hello.
  • api_version: what version of the API does this sample apply to, e.g., v1beta, v2.

Future Work

We would like to eventually also support a snippets field, which includes meta information about individual snippets, if multiple snippets are included in the sample file; this has not yet been implemented, as it's not currently used in Node's samples/README.md or README.md, which will be the first two consumers of this functionality.

Note

It's our hope that in the future this meta information will be automatically populated as samples are generated.

CC: @beccasaurus who was also involved in this discussion.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 23, 2019
@@ -0,0 +1,29 @@
/**
* Copyright 2017, Google, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can we use the 2019 version of the license?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants