Not documented: how to set the size of an image
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 470
- PR merge metrics
- No merged PRs in 30d
Description
By default, ImageBlocks take up the entire width of the page. If you have a small image, this can look terrible.
You can set the dimensions of an image by setting its width, like so:
image_block = row.children.add_new(ImageBlock)
image_block.width = 250
Notion will automatically scale the height to keep the aspect ratio.
Be sure to set the size after uploading an image:
image_block = row.children.add_new(ImageBlock)
image_block.upload_file(f)
image_block.width = 250
Mostly making an issue because I couldn't find the information in this repo. Hopefully this helps someone else.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No documentation file or test is named in the issue. Locate the existing ImageBlock documentation, use the supplied width and upload-order examples as the source, and verify that the resulting guidance explains how to set image dimensions while preserving the aspect ratio.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100