This goldmark extension extend commonmark syntax:
- uses Markdown's image syntax
![]()to support other objects. - adds highlight syntax for inline text.
- adds title to links
- supports pandoc-style fenced divs in goldmark.
- supports github-style callouts in goldmark.
- YouTube Video
- Bilibili Video
- X(formly Twitter)'s Tweet Oembed Widget
- TradingView Chart
- Quaily List and Article
- Add options to images
- dify.ai Widget
- Spotify Embed
- Podbean Embed
- html5 audio
import (
enclave "github.com/quailyquaily/goldmark-enclave"
"github.com/yuin/goldmark"
)
// ...
markdown := goldmark.New(
goldmark.WithExtensions(
enclave.New(),
),
)And then you can use it like this:
Youtube Video:

Bilibili Video:

Twitter Tweet:

TradingView Chart:

Quail List and Post


Image with caption and giving it a width:

Dify Widget

Spotify Embed

Podbean Embed

Podbean also supports the `eas` URL variant:

Podbean Dark Theme

HTML5 Audio
Some objects support options:
theme: The theme of the TradingView chart, twitter tweet, Podbean player and Quaily widget. Default:light- e.g.
or
- e.g.
width/wandheight/h: The width and height of images. Default:auto- e.g.
 - Please refer to image size and alignment
- e.g.
Obsidian-style image syntax
It supports two forms of Obsidian-style image syntax:

or

Units
To specify the unit of the width and height, you can use the following units:
px: pixelsrem: rem%: percentage
Alignment
The align parameter is used to specify the alignment of the image. Supported values are left, right and center. The default value is center.
import (
enclaveMark "github.com/quailyquaily/goldmark-enclave/mark"
"github.com/yuin/goldmark"
)
// ...
markdown := goldmark.New(
goldmark.WithExtensions(
enclaveMark.New(),
),
)This is a ==highlighted text==.will be rendered as:
<p>This is a <mark>highlighted text</mark>.</p>import (
enclaveHref "github.com/quailyquaily/goldmark-enclave/href"
"github.com/yuin/goldmark"
)
// ...
markdown := goldmark.New(
goldmark.WithExtensions(
enclaveHref.New(&enclaveHref.Config{}),
),
)[Quail](/blog "Quail Blog")will be rendered as:
<a href="https://quaily.com/blog" title="Quail Blog">Quail</a>import (
enclaveFence "github.com/quailyquaily/goldmark-enclave/fence"
"github.com/yuin/goldmark"
)
// ...
markdown := goldmark.New(
goldmark.WithExtensions(
enclaveFence.New(),
),
)import (
enclaveCallout "github.com/quailyquaily/goldmark-enclave/callout"
"github.com/yuin/goldmark"
)
// ...
markdown := goldmark.New(
goldmark.WithExtensions(
enclaveCallout.New(),
),
)Github-style
> [!NOTE]
> This is a note callout.Simple
WARNING
This is a warning callout.Simple Inline
WARNING: This is a warning callout.go get github.com/quailyquaily/goldmark-enclave