Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/13rac1/goldmark-wikilink
A Wikilink extension for the goldmark markdown parser.
https://github.com/13rac1/goldmark-wikilink
goldmark goldmark-extension markdown wikilink
Last synced: about 1 month ago
JSON representation
A Wikilink extension for the goldmark markdown parser.
- Host: GitHub
- URL: https://github.com/13rac1/goldmark-wikilink
- Owner: 13rac1
- License: mit
- Created: 2020-12-20T16:54:00.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T00:27:42.000Z (over 3 years ago)
- Last Synced: 2024-09-29T09:19:50.031Z (about 2 months ago)
- Topics: goldmark, goldmark-extension, markdown, wikilink
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# goldmark-wikilink
goldmark-wikilink is an extension for the [goldmark][goldmark] library that extends
Markdown to support `[[title]]` [Wikilink][help-link] style links with a new AST
type and HTML Renderer.[goldmark]: http://github.com/yuin/goldmark
[help-link]: https://en.wikipedia.org/wiki/Help:Link
[goldmark-wikilinks]: https://github.com/dangoor/goldmark-wikilinks## Demo
This markdown:
```md
# Hello goldmark-wikilink[[Example Link]]
```Becomes this HTML, with the default Normalizer:
```html
Hello goldmark-wikilink
```### Installation
```bash
go get github.com/13rac1/goldmark-wikilink
```## Usage
```go
markdown := goldmark.New(
goldmark.WithExtensions(
wikilink.Extension,
),
)
var buf bytes.Buffer
if err := markdown.Convert([]byte(source), &buf); err != nil {
panic(err)
}
fmt.Print(buf)
}
```## TODO
* Support [Piped Links][piped-link] in the form `[target|displayed text]`.
* Support [Section linking][section-linking] in the forms:
* External link: `[[Page name#Section name|displayed text]]`
* Internal link: `[[#Section name|displayed text]]`[piped-link]: https://en.wikipedia.org/wiki/Help:Link#Piped_link
[section-linking]: https://en.wikipedia.org/wiki/Help:Link#Section_linking_(anchors)## License
MIT
## Author
Brad Erickson & Kevin Dangoor
Fork of [dangoor/goldmark-wikilinks][goldmark-wikilinks]. Adds
a Wikilink AST type to ease extending and removes the _WikilinkTracker_ which
can implemented in a separate AST walker.