[docs] Document MDX component reuse and Markdown preferences#6695
Conversation
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis pull request updates ChangesContributing Guide Enhancements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Proposal — adding three MDX-style sections and four "Before Submitting" checklist items to
CONTRIBUTING.md, triggered by feedback on #6692.In #6692 I wrote about 300 lines of inline
<style>and duplicated HTML tables in MDX rather than extracting an Astro component, and used<table>HTML where native Markdown tables would have rendered the same. @jesserockz refactored both in a follow-up commit on the PR. The patterns aren't covered inCONTRIBUTING.mdtoday, so this PR proposes language to capture them.Changes:
LightEffectPreviewas the example, defers new-component decisions to maintainers, and discourages large inline<style>blocks<style>blocksThis is a proposal, not a finished change. Open to wording changes, scope cuts, or rephrasing — if maintainers prefer to leave new-component decisions implicit (and just refactor in review like #6692 went), that subsection can be cut. Submitting per the "prefer small, focused PRs" guidance this PR adds, so
AGENTS.mdis in a separate PR.Related issue (if applicable): n/a
Pull request in esphome with YAML changes (if applicable): n/a
Checklist
I am merging into
nextbecause this is new documentation that has a matching pull-request in esphome as linked above.or
I am merging into
currentbecause this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.Link added in
/src/content/docs/components/index.mdxwhen creating new documents for new components or cookbook.New Component Images
If you are adding a new component to ESPHome, you can automatically generate a standardized black and white component name image for the documentation.
To generate a component image:
Comment on this pull request with the following command, replacing
component_namewith your component name in lower_case format with underscores (e.g.,bme280,sht3x,dallas_temp):The ESPHome bot will respond with a downloadable ZIP file containing the SVG image.
Extract the SVG file and place it in the
/public/images/folder of this repository.Use the image in your component's index table entry in
/src/content/docs/components/index.mdx.Example: For a component called "DHT22 Temperature Sensor", use:
Note: All images used in ImgTable components must be placed in
/public/images/as the component resolves them to absolute paths.