-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make images consistent on home page #4287
Conversation
WalkthroughThe changes involve updates to multiple files, including the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
github.py (2)
139-142
: LGTM! Consider a minor readability improvement.The changes improve the flexibility of handling
category
anddark_invert
properties. The logic now correctly handles cases with 4 or 5 columns in the input.For improved readability, consider extracting the column count check into a separate variable:
- if len(row) == 4: + column_count = len(row) + if column_count == 4: if row[3].strip() == "dark-invert": dark_invert = True else: category = row[3].strip() - if len(row) == 5 and row[4].strip() == "dark-invert": + if column_count == 5 and row[4].strip() == "dark-invert": category = row[3].strip() dark_invert = TrueThis change would make the logic more explicit and easier to maintain if additional columns need to be handled in the future.
Line range hint
228-273
: LGTM! Consider adding flexibility for column headers.The rewrite of the
PinTableDirective
class significantly improves the table generation process. The new implementation is more structured and handles different input formats effectively.To increase flexibility, consider allowing custom column headers:
+ option_spec = { + 'headers': directives.unchanged, + } def run(self): items = [] + headers = self.options.get('headers', 'Pin,Function').split(',') data = list(csv.reader(self.content)) for row in data: if not row: continue if len(row) == 3: items.append((row[0], row[1], True)) else: items.append((row[0], row[1], False)) - col_widths = self.get_column_widths(2) + col_widths = self.get_column_widths(len(headers)) title, messages = self.make_title() table = nodes.table() # Set up column specifications based on widths - tgroup = nodes.tgroup(cols=2) + tgroup = nodes.tgroup(cols=len(headers)) table += tgroup tgroup.extend(nodes.colspec(colwidth=col_width) for col_width in col_widths) thead = nodes.thead() tgroup += thead trow = nodes.row() thead += trow - trow.extend( - nodes.entry(h, nodes.paragraph(text=h)) for h in ("Pin", "Function") - ) + trow.extend( + nodes.entry(h, nodes.paragraph(text=h)) for h in headers + )This change allows users to specify custom headers when using the directive, making it more versatile for different use cases.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (2)
images/gpio.svg
is excluded by!**/*.svg
images/pin.svg
is excluded by!**/*.svg
📒 Files selected for processing (5)
- components/binary_sensor/gpio.rst (1 hunks)
- components/output/gpio.rst (1 hunks)
- components/switch/gpio.rst (1 hunks)
- github.py (1 hunks)
- index.rst (18 hunks)
✅ Files skipped from review due to trivial changes (2)
- components/binary_sensor/gpio.rst
- components/output/gpio.rst
🚧 Files skipped from review as they are similar to previous changes (1)
- index.rst
🧰 Additional context used
📓 Path-based instructions (2)
components/switch/gpio.rst (1)
Pattern
**
: - Do not generate or add any sequence diagramsgithub.py (1)
Pattern
**
: - Do not generate or add any sequence diagrams
🔇 Additional comments (1)
components/switch/gpio.rst (1)
6-6
: LGTM! Verify the new image file exists.The change from
pin.svg
togpio.svg
improves the specificity of the image reference for the GPIO switch documentation. This is a good improvement.Let's verify that the new image file exists in the correct location:
If the script doesn't find the file, please ensure that
gpio.svg
has been added to the repository in the correct location.✅ Verification successful
✅ Verification Successful:
images/gpio.svg
exists.The new image file
images/gpio.svg
has been successfully found in the repository, confirming the documentation update.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if the gpio.svg file exists in the expected location # Test: Search for gpio.svg file fd -t f "gpio.svg" # If the above command doesn't find the file, it might be in a different directory. # Let's search for any SVG files with "gpio" in the name: fd -t f -e svg "gpio"Length of output: 150
Description:
Fixes a bunch of SVGs on the home page so they're consistent.
Related issue (if applicable): fixes
Pull request in esphome with YAML changes (if applicable): esphome/esphome#
Checklist:
I am merging into
next
because this is new documentation that has a matching pull-request in esphome as linked above.or
I am merging into
current
because this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.Link added in
/index.rst
when creating new documents for new components or cookbook.