https://github.com/amdev9/markdown-it-wikicustom
Wiki custom style links for the markdown-it
https://github.com/amdev9/markdown-it-wikicustom
Last synced: about 10 hours ago
JSON representation
Wiki custom style links for the markdown-it
- Host: GitHub
- URL: https://github.com/amdev9/markdown-it-wikicustom
- Owner: amdev9
- License: mit
- Created: 2019-02-08T15:27:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-11T13:52:35.000Z (over 7 years ago)
- Last Synced: 2025-10-19T07:37:00.277Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Markdown-It Wiki Custom Links
Renders Wiki-like links in [markdown-it](https://github.com/markdown-it/markdown-it). This is useful for making Markdown-based wikis.
## Usage
Install this into your project:
```bash
npm --save install markdown-it-wikicustom
```
...and *use* it:
```js
const wikilinks = require('markdown-it-wikicustom')(options)
const md = require('markdown-it')()
.use(wikilinks)
.render('Click [[Wiki Links|here]] to learn about [[/Wiki]] links.')
```
**Output:**
```html
Click here to learn about Wiki links.
```
## Options
### `baseURL`
**Default:** ``
The base URL for absolute wiki links.
```js
const html = require('markdown-it')()
.use(require('markdown-it-wikicustom')({ baseURL: '/wiki/' }))
.render('[[Main Page]]')
//
```
### `relativeBaseURL`
**Default:** ``
The base URL for relative wiki links.
```js
const html = require('markdown-it')()
.use(require('markdown-it-wikicustom')({ relativeBaseURL: '#', suffix: '' }))
.render('[[Main Page]]')
//
```
### `makeAllLinksAbsolute`
**Default:** `false`
Render all wiki links as absolute links.
### `uriSuffix`
**Default:** ``
Append this suffix to every URL.
```js
const html = require('markdown-it')()
.use(require('markdown-it-wikicustom')({ uriSuffix: '.php', relativeBaseURL: './' }))
.render('[[Main Page]]')
//
```
### `htmlAttributes`
**Default:** `{}`
An object containing HTML attributes to be applied to every link.
```js
const attrs = {
'class': 'wikilink',
'rel': 'nofollow'
}
const html = require('markdown-it')()
.use(require('markdown-it-wikicustom')({ htmlAttributes: attrs }))
.render('[[Main Page]]')
//
```