Add height option to stlite directive#38
Open
tkoyama010 wants to merge 2 commits intoatsphinx:mainfrom
Open
Conversation
- Add :height: option to customize iframe height - Support units (px, rem) and numeric values (auto-convert to px) - Update documentation with usage examples - Add test cases for height option parsing - Add custom-height.rst example page
There was a problem hiding this comment.
Pull request overview
This PR adds a :height: option to the stlite directive, allowing users to customize the iframe height using inline styles. This provides a cleaner alternative to the existing workaround of using raw HTML and CSS (as seen in plot-histogram-chart.rst).
Changes:
- Added
:height:directive option that accepts CSS units (px, rem) or numeric values (auto-converted to px) - Implemented inline style generation for iframe elements when height is specified
- Added comprehensive documentation and example page
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/atsphinx/stlite/directives.py |
Adds :height: option to directive's option_spec and default options |
src/atsphinx/stlite/nodes.py |
Implements inline style attribute generation for custom heights |
tests/test_directives.py |
Adds parametrized tests for height option parsing (px, rem, numeric) |
docs/guide.rst |
Documents the new :height: directive option with examples |
docs/examples/custom-height.rst |
Provides practical examples demonstrating height customization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
:height:option to customize iframe height.Usage
Supports CSS units (
px,rem) and numeric values (auto-converted topx).Changes
:height:option to directiveBackward compatible - default behavior unchanged.
Reference
tkoyama010/awesome-sphinx-revealjs#4