An Obsidian extension for the goldmark markdown parser.
- Autolinks (GFM):
https://example.com - Internal links:
[[Link]] - Embed files:
![[Link]] - Block references:
![[Link#^id]] - Defining a block:
^id - Comments (block, inline):
%%Text%% - Strikethroughs (GFM):
~~Text~~ - Highlights:
==Text== - Code blocks:
``` - Incomplete task (GFM):
- [ ] - Completed task (GFM):
- [x] - Callouts:
> [!note] - Tables (GFM)
- Footnotes (reference):
Example[^1]. - Footnotes (inline):
Example. ^[This is an inline footnote.] - Diagrams (Mermaid):
```mermaid - LaTeX (MathJax):
$$ - Tags:
#tag - Properties (metadata):
---at the very beginning of a file
Known inconsistencies with Obsidian:
- Properties may start and end with at least 1 dash, not exactly 3 (---).
- Tags defined in properties are not applied to document in same way as other tags.
- Document aliases defined in properties are not processed as internal link targets.
TODO:
- Add basic tests for all syntax used in Obsidian Help.
- Add support for comments (both block and inline).
- Add support for highlights.
- Add support for callouts.
Not planned (PR is welcome):
- Support for inline footnotes.
Obsidian plugin Tasks
- Supported task formats:
- Tasks Emoji Format - the default format
- Dataview Format
- Optional Global Filter
- Dates:
- Cancelled date
- Detecting invalid dates
- Priority
- Recurring Tasks
- Recurrence rule text is processed as is, without parsing a rule itself
- On Completion
- Statuses
- Use Filename as Default Date
- Task Dependencies
TODO:
- Add an option to support Global Filter (with tag removal).
- Add an option to set a Default Date.
Not planned (PR is welcome):
- Dataview Format.
go get github.com/powerman/goldmark-obsidiansource := []byte(`
- [ ] Happy New Year π
2025-01-01 ^first-task
- [x] Happy Old Year π
2024-01-01
`)
md := goldmark.New(
goldmark.WithExtensions(
obsidian.NewPlugTasks(),
obsidian.NewObsidian(),
),
)
err := md.Convert(source, os.Stdout)
if err != nil {
fmt.Println(err)
}
// Output:
// <ul class="contains-task-list">
// <li data-task="" class="task-list-item" id="^first-task"><input disabled="" type="checkbox" class="task-list-item-checkbox"> Happy New Year π
2025-01-01</li>
// <li data-task="x" class="task-list-item is-checked"><input checked="" disabled="" type="checkbox" class="task-list-item-checkbox"> Happy Old Year π
2024-01-01</li>
// </ul>