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
📖 updated extension generator markdown template #25459
📖 updated extension generator markdown template #25459
Conversation
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 overall. I'll let other reviewers approve the contents.
Can you sanity check this to make sure the extension generator doesn't conflict with prettier?
# Generate an extension
gulp make-extension --name amp-crystal
# Make sure there are no formatting errors
gulp prettify --files "extensions/amp-crystal/**.md"
If all goes well, the second step should not yield any formatting errors.
If there are errors, you'll have to either adjust extension-doc.template.md
, or modify this code:
amphtml/build-system/tasks/extension-generator/index.js
Lines 76 to 81 in 185493b
const getMarkdownDocFile = async name => | |
(await fs.readFile(`${__dirname}/extension-doc.template.md`)) | |
.toString('utf-8') | |
.replace(/\\\$category/g, '$category') | |
.replace(/\\?\${name}/g, name) | |
.replace(/\\?\${year}/g, year); |
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
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.
Left a few comments. I think it'd be good to simplify the structure:
- only once include an executable example template. If it makes sense, mention it in the section description instead.
- explicitly mark all optional sections
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
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.
Thanks for all the due diligence!
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
@@ -79,6 +151,114 @@ FILL THIS IN. Does this extension allow for properties to configure? | |||
</tr> | |||
</table> | |||
|
|||
### optional-attribute-name (optional) | |||
|
|||
Here, I write what optional-attribute-name will do to amp-component-name. |
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.
nit: wrap the attribute names in `
|
||
### action-name | ||
|
||
Description of action. Use cases of action-name. Include all the nuances, such as: amp-component-name needs to be identified with an `id` to work. |
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.
nit: wrap the action names in `
|
||
Description of attribute. Use cases for this attribute. | ||
|
||
- attribute-value-option-one (default): attribute-option-one-value does this to amp-component-name. |
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.
should the value be wrappen in `?
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
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.
Few nits left. Otherwise LGTM
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
@@ -73,6 +71,11 @@ limitations under the License. | |||
|
|||
[/example][/filter] |
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.
add line break before filter
build-system/tasks/extension-generator/extension-doc.template.md
Outdated
Show resolved
Hide resolved
* updated template * prettiefied woot * fixed prettify generation * updated template * prettyfied template * moved problem paragraph under frontmatter * spacing issue * resolved comments * removed table option and excess example blocks * fixed nits
This PR updates the template used to create reference documentation for new amp components.