yarner-block-links

Crates.ioyarner-block-links
lib.rsyarner-block-links
version0.1.2
sourcesrc
created_at2021-03-04 23:53:09.483643
updated_at2021-03-09 22:28:35.389407
descriptionA Yarner plugin that adds to each code block a list of links to all referenced and all referencing blocks
homepagehttps://github.com/mlange-42/yarner-block-links/
repositoryhttps://github.com/mlange-42/yarner-block-links/
max_upload_size
id363976
size20,935
Martin Lange (mlange-42)

documentation

README

yarner-block-links

Test status GitHub Crate MIT license

A Yarner plugin that adds to each code block a list of links to all referenced and all referencing blocks.

Example:

A list of links is placed under each code block that references other blocks:

//- Main block
fn main() {
    // ==> Block A.
    // ==> Block B.
}

Macros: Block A Block B

Blocks that are referenced by other blocks get a list of usages added.

The first referenced block:

//- Block A
print!("Hello");

Usage: Main block

The second referenced block:

//- Block B
println!(" World!");

Usage: Main block

Installation

Binaries

  1. Download the latest binaries for your platform
  2. Unzip somewhere
  3. Add the parent directory of the executable to your PATH environmental variable

Using cargo

> cargo install yarner-block-links

Usage

Add a section plugin.block-links to your Yarner.toml:

[plugin.block-links]

Options

The plugin provides optional configuration for link formatting. Defaults are as follows (but all options can be left out):

[plugin.block-links]
template = "{{#if usage}}> Usage: {{usage}}  \n{{/if}}{{#if macros}}> Macros: {{macros}}{{/if}}"
join = " "
label = "`{{label}}`"
Option Details
template Template for formatting of the links section(s)
join Separator between links
label Formatting of link labels
Commit count: 26

cargo fmt