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

Support [data-callout-metadata] #1110

Closed
MasssiveJuice08 opened this issue Apr 28, 2024 · 3 comments
Closed

Support [data-callout-metadata] #1110

MasssiveJuice08 opened this issue Apr 28, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@MasssiveJuice08
Copy link
Sponsor

MasssiveJuice08 commented Apr 28, 2024

Many Obsidian themes and CSS snippets utilize [data-callout-metadata] to give users fine-grained control over how callouts are displayed. A simple use-case would be to use metadata to specify that a callout should float left or right. For example:

> [!note|left] Title
> content

In the above example, text after the pipe (|) denotes metadata.

Callout metadata can also be stacked, so the callout example above could also contain |left noborder largetitle], where each phrase applies specific styling to the callout.

The above can be achieved already simply by defining a new callout type for each desired variation in styling, but this is limiting. For example, if I wanted to make it so that any existing callout type already supported by Quartz can float left or right, I would need to define unique callouts in CSS for each one, tripling the number of callout types (e.g., [data-callout="note"], [data-callout="note_left"], [data-callout="note_right"] and so on.). By allowing callout metadata, a much more modular approach can be taken.

@MasssiveJuice08 MasssiveJuice08 added the enhancement New feature or request label Apr 28, 2024
@saberzero1
Copy link
Contributor

I'll look into extracting the metadata from callouts.

I'm not sure if it is desirable to implement a standard list of options (such as left, right, noborder, etc.) unless Obsidian has a predefined list of standard supported options.

That being said, the option to extending through custom css would remain.

@MasssiveJuice08 are you aware of a standard list that (most) themes implement for callout options/could you give me an example or two of Obsidian themes that make use of data-callout-metadata for reference? Thanks!

@MasssiveJuice08
Copy link
Sponsor Author

Hi Saber! So sorry I missed your response!

I'm not sure if it is desirable to implement a standard list of options (such as left, right, noborder, etc.) unless Obsidian has a predefined list of standard supported options.

I agree that it would not be desirable to implement a standard list, as vanilla Obsidian without plugins/themes does not implement this. As far as I understand, it just implements the framework of callout metadata, and plugins/themes can utilise this.

Perhaps [data-callout-metadata] can be just thought of as Markdown alt text? It follows similar syntax, using a vertical pipe after the callout name.

could you give me an example or two of Obsidian themes that make use of data-callout-metadata for reference?

@jackyzha0
Copy link
Owner

marking as closed in #1172 and #1174, feel free to reopen if this isn't sufficient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants