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

Custom page preview: Display page preview in embeds #2

Open
dxcore35 opened this issue Mar 9, 2023 · 2 comments
Open

Custom page preview: Display page preview in embeds #2

dxcore35 opened this issue Mar 9, 2023 · 2 comments

Comments

@dxcore35
Copy link

dxcore35 commented Mar 9, 2023

I was thinking can your code be adapted to show this view also when the note is embedded? Instead of seeing the whole note content I would like to see only the summary and image. Also I was thinking if we can get this running via DV.VIEW it will be nice to get the image automatically from the note's body like it is done here:

https://github.com/702573N/Obsidian-Notes-List

@zamsyt
Copy link
Owner

zamsyt commented Mar 9, 2023

A couple of days ago I made a separate snippet for similar cards which aren't used as the page preview. I haven't published it on this repo because I've been thinking I could rather make a more flexible snippet that combines the functionality of these snippets as well as providing control of various properties of the card/callout.

  • whether it's used as the page preview
  • whether it's hidden in reading view
  • whether the callout title is shown?
  • horizontal vs vertical (allow image on left/right/top/bottom)
  • image size

As well as the option in embeds to display the card (like you suggest)

I don't yet know what the syntax will be exactly, but basically it would be some list of keywords in the callout type.

Thanks for your suggestions. I'll be looking at automatic generation of the previews too.

@dxcore35
Copy link
Author

dxcore35 commented Mar 10, 2023

I made something for begining:

  • fixed square image in page preview
  • fit image inside when inserted inside Kanban
  • add task progress bar (only tasks inside project note are recognized)
  • add summary from YAML header

DataviewJS code in note's body

dv.span(dv.sectionLink("cover.jpg", "#cover", true))

Custom dataview you need to copy (and set folder in dataview)

dx_Project_header.zip

Custom CSS need to copy to Snippets folder

[ui] Auto image blend.css.zip

Results

Screenshot 2023-03-10 at 16 04 00

Screen.Recording.2023-03-10.at.15.59.12.mov

Original image

cover

@zamsyt zamsyt changed the title Add custom view for embedded notes Custom page preview: Display page preview in embeds Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants