https://github.com/mlange-42/yarner-block-links
Yarner plugin that creates links to all referenced end referencing blocks
https://github.com/mlange-42/yarner-block-links
Last synced: 6 months ago
JSON representation
Yarner plugin that creates links to all referenced end referencing blocks
- Host: GitHub
- URL: https://github.com/mlange-42/yarner-block-links
- Owner: mlange-42
- License: mit
- Created: 2021-02-21T00:07:04.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-09T22:25:56.000Z (over 4 years ago)
- Last Synced: 2025-03-28T06:47:29.085Z (6 months ago)
- Language: Rust
- Homepage:
- Size: 50.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yarner-block-links
[](https://github.com/mlange-42/yarner-block-links/actions/workflows/tests.yml)
[](https://github.com/mlange-42/yarner-block-links)
[](https://crates.io/crates/yarner-block-links)
[](https://github.com/mlange-42/yarner-block-links/blob/main/LICENSE)A [Yarner](https://github.com/mlange-42/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:
```rust
//- Main block
fn main() {
// ==> Block A.
// ==> Block B.
}
```> Macros: [`Block A`](#yarner-block-block-a) [`Block B`](#yarner-block-block-b)
Blocks that are referenced by other blocks get a list of usages added.
The first referenced block:
```rust
//- Block A
print!("Hello");
```> Usage: [`Main block`](#yarner-block-main-block)
The second referenced block:
```rust
//- Block B
println!(" World!");
```> Usage: [`Main block`](#yarner-block-main-block)
## Installation
**Binaries**
1. Download the [latest binaries](https://github.com/mlange-42/yarner-block-links/releases) 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`:
```toml
[plugin.block-links]
```## Options
The plugin provides optional configuration for link formatting. Defaults are as follows (but all options can be left out):
```toml
[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 |