### Run examples with cargo Source: https://github.com/whosowsee/mdv/blob/main/vendor/minus/README.md Run the provided examples in the `examples` directory using `cargo run --example --features=`. For example, run `dyn_tokio` with `dynamic_output` and `search` features. ```bash cargo run --example --features= # for example to try the `dyn_tokio` example cargo run --example dyn_tokio --features=dynamic_output,search ``` -------------------------------- ### Rust hello world Source: https://github.com/whosowsee/mdv/blob/main/docs/examples/sample.md Rust example printing a greeting to the console. ```rust fn main() { println!("Hello from Rust!"); } ``` -------------------------------- ### Install mdv from source Source: https://github.com/whosowsee/mdv/blob/main/README.md Builds mdv from source and places the binary into the Cargo bin directory (usually ~/.cargo/bin). ```bash git clone https://github.com/WhoSowSee/mdv.git cd mdv cargo install --path . ``` -------------------------------- ### Install mdv with Nix (Flake) Source: https://github.com/whosowsee/mdv/blob/main/README.md The Nix flake builds mdv from flake.nix and installs the mdv binary into the Nix profile. Use nix run to try it without installing, or nix profile install for a persistent install. ```bash nix run github:WhoSowSee/mdv nix profile install github:WhoSowSee/mdv ``` -------------------------------- ### Install mdv from crates.io Source: https://github.com/whosowsee/mdv/blob/main/README.md Installs the latest published release of mdv from crates.io into the Cargo bin directory. ```bash cargo install mdv ``` -------------------------------- ### Diff example Source: https://github.com/whosowsee/mdv/blob/main/docs/examples/sample.md Diff block showing a change from debug to release output. ```diff - println!("Debug output"); + println!("Release output"); ``` -------------------------------- ### Create a user theme with extends: monokai Source: https://github.com/whosowsee/mdv/blob/main/README.md Example user theme file that extends the built-in monokai theme and overrides a few fields. Place it in /themes/ as a .yaml file to register it; the filename becomes the theme name. Demonstrates the pager_status_bar_transparent, inline_style, and syntax overrides. ```yaml # /themes/warm.yaml name: warm description: Warm red accent layered on top of monokai. extends: monokai pager_status_bar_transparent: true h1: "#ff5577" link: "#66ccff" background: "#1c1c1c" inline_style: code: backticks: false underline: true syntax: keyword: "#ff5577" ``` -------------------------------- ### Run mdv locally without installing Source: https://github.com/whosowsee/mdv/blob/main/README.md Builds mdv in release mode and runs the binary from target/release directly, or you can add it to your PATH. ```bash cargo build --release ./target/release/mdv README.md ``` -------------------------------- ### mdv default configuration template Source: https://github.com/whosowsee/mdv/blob/main/README.md Default configuration template for mdv. Shows all top-level settings with their default values. Use as a starting point for custom configuration files. ```yaml theme: "terminal" code_theme: null inline_style: {} wrap: "char" table_wrap: "fit" pretty_table: false heading_layout: "level" smart_indent: false block_spacing: null code_wrap_indent: "double" link_style: "clickable" link_truncation: "wrap" ``` -------------------------------- ### User preset YAML file (project-docs.yaml) Source: https://github.com/whosowsee/mdv/blob/main/README.md User preset file that must be placed under /presets/ with a .yaml or .yml extension. Accepts the same keys as docs/examples/config.yaml plus a required non-empty name field. Acts as a partial layer: omitted settings remain unchanged, while explicit values (including false, defaults, and null) override the configuration beneath it. A user preset with the same name as a built-in replaces the built-in. ```yaml # /presets/project-docs.yaml name: project-docs theme: monokai wrap: word reflow: true table_wrap: wrap link_style: inlinetable inline_style: code: backticks: false ``` -------------------------------- ### mdv stdin and pipeline usage Source: https://github.com/whosowsee/mdv/blob/main/README.md Shows how to read from standard input (stdin) and work in pipelines. ```text mdv [OPTIONS] - cat | mdv ``` -------------------------------- ### mdv usage syntax Source: https://github.com/whosowsee/mdv/blob/main/README.md Basic usage syntax for mdv, showing the command-line options and the help command. ```text mdv [OPTIONS] [FILE] mdv help ``` -------------------------------- ### Standard project commands Source: https://github.com/whosowsee/mdv/blob/main/docs/modules/testing.md Commands to run formatting checks, linting, tests, and a release build. Use `cargo test -- --nocapture` to inspect a specific test's standard output. ```text cargo fmt --all -- --check cargo clippy --all-targets -- -D warnings cargo test --no-fail-fast cargo build --release ``` -------------------------------- ### Rust main function printing hello Source: https://github.com/whosowsee/mdv/blob/main/tests/files/color-mode.md A minimal Rust program that prints 'hello' to standard output. This is the only code snippet on the page, presented in a markdown code block. ```rust fn main() { println!("hello"); } ``` -------------------------------- ### SQL query for active users Source: https://github.com/whosowsee/mdv/blob/main/docs/examples/sample.md SQL query selecting active users ordered by creation date. ```sql SELECT id, username, created_at FROM users WHERE active = TRUE ORDER BY created_at DESC; ``` -------------------------------- ### Add minus as a dependency Source: https://github.com/whosowsee/mdv/blob/main/vendor/minus/README.md Use `cargo add minus` to add the `minus` crate as a dependency in your Cargo.toml file. Then enable features as needed: `static_output` for static data, `dynamic_output` for dynamic data, `search` for search support, and `clipboard` for clipboard support. ```bash cargo add minus ``` -------------------------------- ### Configure mdv-minus dependency Source: https://github.com/whosowsee/mdv/blob/main/vendor/minus/MDV_PATCH.md Add the mdv-minus package to your Cargo.toml file to use the fork under the original minus library name. ```toml minus = { package = "mdv-minus", version = "5.7.3" } ``` -------------------------------- ### Fenced Math Block: Integral Equation Source: https://github.com/whosowsee/mdv/blob/main/docs/examples/sample.md Display math using a fenced code block with the 'math' language. Renders the definite integral equation. ```math \int_a^b f(x)\,dx = F(b) - F(a) ``` -------------------------------- ### Python greeting function Source: https://github.com/whosowsee/mdv/blob/main/docs/examples/sample.md Python function that returns a greeting and prints it when run as a script. ```python def greet(name: str) -> str: """Return a friendly greeting.""" return f"Hello, {name}!" if __name__ == "__main__": print(greet("Markdown Reader")) ``` -------------------------------- ### YAML Metadata Block Source: https://github.com/whosowsee/mdv/blob/main/docs/examples/sample.md Metadata style block in YAML format, showing title, author, and tags. Useful for front matter in Markdown files. ```yaml title: Sample Markdown Metadata author: Example Author tags: - markdown - reference ``` -------------------------------- ### Plain fenced code block Source: https://github.com/whosowsee/mdv/blob/main/docs/examples/sample.md Fenced code block without a language identifier. Use when syntax highlighting is not required. ```plaintext Plain fenced block with backticks. Use this when syntax highlighting is not required. ``` -------------------------------- ### Indented JSON code block Source: https://github.com/whosowsee/mdv/blob/main/docs/examples/sample.md Indented code block using four spaces. Demonstrates JSON formatting without a language identifier. ```json { "name": "Indented JSON", "purpose": "Demonstrate four-space indentation" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.