Skip to content
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

Add wikilink syntax to control width of pictures in markdown preview #1328

Open
sahil48 opened this issue Feb 1, 2024 · 3 comments
Open
Labels
foam-core Related to API, core model or feature foam-vscode Foam for VSCode extension in packages/foam-vscode good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@sahil48
Copy link

sahil48 commented Feb 1, 2024

Is your feature request related to a problem? Please describe.

On really large monitors, the pictures added using ![[picture.png]] syntax take up the full width. The pictures are too large and make it difficult to read the document.

image

The extension below offers a solution by appending =##x syntax ![pic](./picture.png =##x). However, this syntax does not work with wiki link syntax

https://marketplace.visualstudio.com/items?itemName=bierner.markdown-image-size

Describe the solution you'd like

Support Obsidian syntax for adjusting width of embedded images

https://help.obsidian.md/Linking+notes+and+files/Embed+files#Embed+an+image+in+a+note
image

Describe alternatives you've considered

Tried to use the ![pic](./picture.png =##x) syntax. Disadvantage is that foam does not renaming relative paths when a file is renamed, only the wikilinks. It would also be good for foam to auto-update relative paths to files in addition to the wikilinks. I can set up a separate issue for this if this would be of interest.

Screenshots or Videos

All needed pictures were added in the description.

@sahil48 sahil48 changed the title Add wikilink syntax to control width of pictures Add wikilink syntax to control width of pictures in markdown preview Feb 1, 2024
@riccardoferretti riccardoferretti added foam-vscode Foam for VSCode extension in packages/foam-vscode foam-core Related to API, core model or feature labels Feb 4, 2024
@riccardoferretti riccardoferretti added this to the backlog milestone Feb 4, 2024
@riccardoferretti
Copy link
Collaborator

Thanks for reporting this, I agree with the idea and the approach

@riccardoferretti riccardoferretti added help wanted Extra attention is needed good first issue Good for newcomers labels Feb 4, 2024
@aflip
Copy link

aflip commented Mar 27, 2024

How can this be fixed? Interested in submitting PR, but do not know exactly how to find the place that implements this and what changes are needed

@riccardoferretti
Copy link
Collaborator

Thanks for taking a look @aflip - I would start by looking at how images are embedded in the preview, see https://github.com/foambubble/foam/blob/db7eb9775f0a94e99ea73e17b64e1360a831e99e/packages/foam-vscode/src/features/preview/wikilink-embed.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
foam-core Related to API, core model or feature foam-vscode Foam for VSCode extension in packages/foam-vscode good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants