Custom heading IDs for Foliant.
Project description
# СustomIDs
CustomIDs is a preprocessor that allows to define custom identifiers (IDs) for headings in Markdown source by using Pandoc-style syntax in projects built with MkDocs or another backend that provides HTML output. These IDs may be used in hyperlinks that refer to a specific part of a page.
## Installation
```bash
$ pip install foliantcontrib.customids
```
## Usage
To enable the preprocessor, add `customids` to `preprocessors` section in the project config:
```yaml
preprocessors:
- customids
```
The preprocessor supports the option:
```
- customids:
targets:
- pre
- mkdocs
- site
- ghp
```
`targets`
: Allowed targets for the preprocessor. If not specified (by default), the preprocessor applies to all targets.
Custom ID may be specified after a heading content at the same line. Examples of Markdown syntax:
```markdown
# Heading 1 {#custom_id_for_first_heading}
A paragraph.
## Heading 2 {#custom_id_for_second_heading}
Some another paragraph.
```
Custom IDs must not contain spaces and non-ASCII characters.
Examples of hyperlinks that refer to custom IDs:
```markdown
[Link to Heading 1](#custom_id_for_first_heading)
[Link to Heading 2 in some document at the current site](/some/page/#custom_id_for_second_heading)
[Link to some heading with custom ID at an external site](https://some.site/path/to/the/page/#some_custom_id)
```
CustomIDs is a preprocessor that allows to define custom identifiers (IDs) for headings in Markdown source by using Pandoc-style syntax in projects built with MkDocs or another backend that provides HTML output. These IDs may be used in hyperlinks that refer to a specific part of a page.
## Installation
```bash
$ pip install foliantcontrib.customids
```
## Usage
To enable the preprocessor, add `customids` to `preprocessors` section in the project config:
```yaml
preprocessors:
- customids
```
The preprocessor supports the option:
```
- customids:
targets:
- pre
- mkdocs
- site
- ghp
```
`targets`
: Allowed targets for the preprocessor. If not specified (by default), the preprocessor applies to all targets.
Custom ID may be specified after a heading content at the same line. Examples of Markdown syntax:
```markdown
# Heading 1 {#custom_id_for_first_heading}
A paragraph.
## Heading 2 {#custom_id_for_second_heading}
Some another paragraph.
```
Custom IDs must not contain spaces and non-ASCII characters.
Examples of hyperlinks that refer to custom IDs:
```markdown
[Link to Heading 1](#custom_id_for_first_heading)
[Link to Heading 2 in some document at the current site](/some/page/#custom_id_for_second_heading)
[Link to some heading with custom ID at an external site](https://some.site/path/to/the/page/#some_custom_id)
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for foliantcontrib.customids-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1dbc002d25f909621b537931aee9cc95d40823e76a14e5c0ede1a7c667131e |
|
MD5 | 172f0a9556581903fb72f5b7ae0d54f5 |
|
BLAKE2b-256 | 3bcc15eba706ba94f28d8ce11e011308d1f34c9a8539c0a642daefb249338054 |