https://github.com/mlange-42/yarner-fold-code
Yarner plugin that puts all code blocks into collapsed <details> tags
https://github.com/mlange-42/yarner-fold-code
Last synced: 6 months ago
JSON representation
Yarner plugin that puts all code blocks into collapsed <details> tags
- Host: GitHub
- URL: https://github.com/mlange-42/yarner-fold-code
- Owner: mlange-42
- License: mit
- Created: 2021-02-21T22:11:50.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-09T22:25:40.000Z (over 4 years ago)
- Last Synced: 2025-03-28T09:38:18.311Z (6 months ago)
- Language: Rust
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yarner-fold-code
[](https://github.com/mlange-42/yarner-fold-code/actions/workflows/tests.yml)
[](https://github.com/mlange-42/yarner-fold-code)
[](https://crates.io/crates/yarner-fold-code)
[](https://github.com/mlange-42/yarner-fold-code/blob/main/LICENSE)A [Yarner](https://github.com/mlange-42/yarner) plugin that puts all code blocks into collapsed `` tags.
Example:
All code blocks are collapsed in details tags.
Main code block
```rust
//- Main code block
fn main() {
println!("Hello world!");
}
```## Installation
**Binaries**
1. Download the [latest binaries](https://github.com/mlange-42/yarner-fold-code/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-fold-code
```## Usage
Add a section `plugin.fold-code` to your `Yarner.toml`:
```toml
[plugin.fold-code]
```## Options
The plugin allows for different options, which are all optional:
```toml
[plugin.fold-code]
min-lines = "10"
languages = ["java", "rust"]
ignore-languages = ["c", "python"]
```| Option | Details | Default |
|--------------------|-------------------------------------------------------|---------|
| `min-lines` | Do not fold code blocks shorter than that | `0` |
| `languages` | Only fold code blocks in these languages (if present) | none |
| `ignore-languages` | Do not fold code blocks in these languages | none |