Skip to content

Plugin for section number references #905

Answered by Lakitna
Lakitna asked this question in Ideas
Discussion options

You must be logged in to vote

I've been able to make a pretty nice implementation for this myself :) Since there is no directive store (or similar) that I know of, I'll share it here for posterity.

Example

Input:

## 1.2. My amazing section

Lorum ipsum...

## 1.3. Another section

This elaborates on :section[1.2.].

Output:

## 1.2. My amazing section

Lorum ipsum...

## 1.3. Another section

This elaborates on [1.2. My amazing section](#12-my-amazing-section).

Options

The directive plugin takes the following options:

key type default description
strict boolean false When true will throw an error when encountering a bad section reference.
When false will log a warning instead.

Implementation

👉 Click to expand …

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@Lakitna
Comment options

Comment options

You must be logged in to vote
4 replies
@wooorm
Comment options

@Lakitna
Comment options

@wooorm
Comment options

@Lakitna
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Lakitna
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants