Allows the use of { .class id='id' data=value }
Pandoc-style markdown attributes inside Obsidian.md.
This plugin is currently proof of concept; however, no loss of data should occur. It is possible that rendering errors may happen. If so, please create an issue including the source text that caused the issue.
Add your attributes inside a curly bracket with a colon, like this:
{ .class }
See below for usage with specific elements.
Currently, the ID attribute must be set using id=value
due to Obsidian's tags. This may change in a future release.
Inline text elements such as italics, bold, highlight, etc. should have their attributes placed inside the symbol:
I'm normal text, but *I'm italic { class='italics' }*, **I'm bold { .bold }** and ==I'm highlighted { id=highlight }==.
Paragraph attributes should be placed after the last line of the block.
This is a paragraph.
This is another line of the paragraph.
This is the last line.
{ id=my_paragraph .class }
Attributes must be added to headers at the end of the line.
### A Header { id=header .header-class }
Attributes can be added to the <table>
element by placing the attribute on the line below it.
| header1 | header2 |
| ------- | ------- |
| column1 | column2 |
{ .table-class}
Attributes can be added to individual table cells like so:
| header1 { .class} | header2 |
| ------------------ | ---------------------- |
| column1 | column2 { .class-two} |
It is not currently possible to add attributes to <tr>
or <thead>
elements.
Both Wikilinks and markdown syntax links may have attributes placed on them.
[link](http://example.com){ class="foo bar" title="Some title!" }
[[Test 123]] { .wikilink}
Lists may have attributes placed on each individual list item.
- item { .item}
- nested item { .nested}
- nested item 2 { id="item 2" }
Attributes can only be applied to the final nested list by placing the attribute on the line immediately following the last item.
- item 1 { .item}
- item 2 { id=item }
- item 3 { data-item=3 }
{ .top-level-ul }
- item { .item}
- nested item { .nested}
- nested item 2 { id="item 2" }
{ .nested-ul}
Code blocks should have their attributes placed after the initial three ticks.
```python { data-python="code" .class }
nums = [x for x in range(10)]
```
Please note that at the moment, changes to code block attributes will not take effect until you reload the note.
Block quotes can by targeted by placing the attributes directly after the last line of the quote.
> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
{ .class }
- Release
From Obsidian v0.9.8, you can activate this plugin within Obsidian by doing the following:
- Open Settings > Third-party plugin
- Make sure Safe mode is off
- Click Browse community plugins
- Search for this plugin
- Click Install
- Once installed, close the community plugins window and activate the newly installed plugin
- Download the Latest Release from the Releases section of the GitHub Repository
- Extract the plugin folder from the zip to your vault's plugins folder:
<vault>/.obsidian/plugins/
Note: On some machines the.obsidian
folder may be hidden. On MacOS you should be able to pressCommand+Shift+Dot
to show the folder in Finder. - Reload Obsidian
- If prompted about Safe Mode, you can disable safe mode and enable the plugin. Otherwise head to Settings, third-party plugins, make sure safe mode is off and enable the plugin from there.
You can follow the same procedure to update the plugin
This plugin comes with no guarantee of stability and bugs may delete data. Please ensure you have automated backups.