Shiva library: Implementation in Rust of a parser and generator for documents of any type

Related tags

Command-line shiva
Overview

Shiva

shiva

Shiva library: Implementation in Rust of a parser and generator for documents of any type

Features

  • Common Document Model (CDM) for all document types
  • Parsers produce CDM
  • Generators consume CDM

Common Document Model

Common Document Model

Supported document types

Document type Parse Generate
Plain text + +
Markdown + +
HTML + +
PDF + +
JSON + +
XML + +
CSV + +
RTF + -
DOCX + +
XLS + -
XLSX + +
ODS + +
Typst - +

Parse document features

Document type Header Paragraph List Table Image Hyperlink PageHeader PageFooter
Plain text - + - - - - - -
Markdown + + + + + + - -
HTML + + + + + + - -
PDF - + + - - - - -
DOCX + + + + - + - -
RTF + + + + - + + +
JSON + + + + - + + +
XML + + + + + + + +
CSV - - - + - - - -
XLS - - - + - - - -
XLSX - - - + - - - -
ODS - - - + - - - -

Generate document features

Document type Header Paragraph List Table Image Hyperlink PageHeader PageFooter
Plain text + + + + - + + +
Markdown + + + + + + + +
HTML + + + + + + - -
PDF + + + + + + + +
JSON + + + + - + + +
XML + + + + + + + +
CSV - - - + - - - -
XLSX - - - + - - - -
ODS - - - + - - - -
Typst + + + + + + + +
DOCX + + + + + + - -

Usage Shiva library

Cargo.toml

[dependencies]
shiva = {  version = "1.1.1", features = ["html", "markdown", "text", "pdf", "json", 
    "csv", "rtf", "docx", "xml", "xls", "xlsx", "ods", "typst"] }

main.rs

fn main() {
    let input_vec = std::fs::read("input.html").unwrap();
    let input_bytes = bytes::Bytes::from(input_vec);
    let document = shiva::html::Transformer::parse(&input_bytes).unwrap();
    let output_bytes = shiva::markdown::Transformer::generate(&document).unwrap();
    std::fs::write("out.md", output_bytes).unwrap();
}

Shiva CLI & Server

Build executable Shiva CLI and Shiva Server

git clone https://github.com/igumnoff/shiva.git
cd shiva/cli
cargo build --release

Run executable Shiva CLI

cd ./target/release/
./shiva --input-format=markdown --output-format=html --input-file=README.md --output-file=README.html

Run Shiva Server

cd ./target/release/
./shiva-server --port=8080 --host=127.0.0.1

Who uses Shiva

Contributing

I would love to see contributions from the community. If you experience bugs, feel free to open an issue. If you would like to implement a new feature or bug fix, please follow the steps:

  1. Read "Contributor License Agreement (CLA)"
  2. Contact with me via telegram @ievkz or discord @igumnovnsk
  3. Confirm e-mail invitation in repository
  4. Do "git clone" (You don't need to fork!)
  5. Create branch with your assigned issue
  6. Create pull request to main branch

For contributors

If you would like add new document type, you need to implement the following traits:

Required: shiva::core::TransformerTrait

pub trait TransformerTrait {
    fn parse(document: &Bytes) -> anyhow::Result<Document>;
    fn generate(document: &Document) -> anyhow::Result<Bytes>;
}

Optional: shiva::core::TransformerWithImageLoaderSaverTrait (If images store outside of document for example: HTML, Markdown)

pub trait TransformerWithImageLoaderSaverTrait {
    fn parse_with_loader<F>(document: &Bytes,  image_loader: F) -> anyhow::Result<Document>
        where F: Fn(&str) -> anyhow::Result<Bytes>;
    fn generate_with_saver<F>(document: &Document,  image_saver: F) -> anyhow::Result<Bytes>
        where F: Fn(&Bytes, &str) -> anyhow::Result<()>;
}
Comments
  • docx parser skips content in separate runs

    docx parser skips content in separate runs

    I'm having issues with the docx parser skipping over content when it's placed in the docx file in separate runs, but appears in the same line or paragraph.

    In following example I'm looking for Part of docx I'm testing looks like this in the document.xml:

            <w:p>
                <w:pPr>
                    <w:pStyle w:val="Normal" />
                    <w:jc w:val="right" />
                    <w:rPr>
                        <w:szCs w:val="22" />
                    </w:rPr>
                </w:pPr>
                <w:r>
                    <w:rPr>
                        <w:szCs w:val="22" />
                    </w:rPr>
                    <w:t xml:space="preserve">Warszawa, dnia </w:t>
                </w:r>
                <w:r>
                    <w:rPr>
                        <w:b />
                        <w:bCs />
                        <w:szCs w:val="22" />
                        <w:shd w:fill="FFFF00" w:val="clear" />
                    </w:rPr>
                    <w:t>{{</w:t>
                </w:r>
                <w:r>
                    <w:rPr>
                        <w:b />
                        <w:bCs />
                        <w:szCs w:val="22" />
                        <w:shd w:fill="FFFF00" w:val="clear" />
                    </w:rPr>
                    <w:t>DATA</w:t>
                </w:r>
                <w:r>
                    <w:rPr>
                        <w:b />
                        <w:bCs />
                        <w:szCs w:val="22" />
                        <w:shd w:fill="FFFF00" w:val="clear" />
                    </w:rPr>
                    <w:t>}}</w:t>
                </w:r>
                <w:r>
                    <w:rPr>
                        <w:szCs w:val="22" />
                    </w:rPr>
                    <w:t xml:space="preserve"> r. </w:t>
                </w:r>
            </w:p>
    

    And output of document.elements looks like this:

    Document { elements: [Text { text: "", size: 16 }, Text { text: "Warszawa, dnia ", size: 16} [... array elements continue]
    

    This is just the first instance of the text being skipped over by the parser, there's a few more in the same file. I can't provide the file itself, as it's proprietary, but if needed I'd try to reproduce on a fresh file.

    opened by magikmw 4
  • Added non-inline HyperLink generation for 'pdf' module.

    Added non-inline HyperLink generation for 'pdf' module.

    • Added main.rs to .gitignore for local testing purposes.
    • Added non-inline HyperLink generation to 'pdf' module.
      • Non-inline (i.e In-text) hyperlinks are not supported yet.
    opened by BilakshanP 4
  • Add width, height and align to Image

    Add width, height and align to Image

    1. core.rs change Image:

    width, height should be Optional

    align should be Enum (left, right, center)

    1. add implementation for HTML, PDF

    2. Tests requered

    opened by evgenyigumnov 2
  • RTF parser

    RTF parser

    1. Implement "RTF parser" (parse function)
    pub trait TransformerTrait {
        fn parse(document: &Bytes, images: &HashMap<String, Bytes>) -> anyhow::Result<Document>;
        fn generate(document: &Document) -> anyhow::Result<(Bytes, HashMap<String, Bytes>)>;
    }
    
    
    1. Units test requered for this new feature

    recommended crates:

    rtf-parser = "0.3.0"

    opened by evgenyigumnov 2
  • XML parser and generator change from default Document struct to programmaticaly

    XML parser and generator change from default Document struct to programmaticaly

    1. replace parser logic from
            let doc: Document = from_str(&doc_string)?;
    

    to

    use quick_xml::Reader;
    use quick_xml::events::Event;
    
    let mut reader = Reader::from_str(xml_data);
    
    1. generate logic in the same way
    2. units test requered for this refactoring

    PS not completed task in commit https://github.com/igumnoff/shiva/commit/1ba567e7864f72e3690fab2a14831bb65cbebc19

    opened by evgenyigumnov 1
  • Issue16

    Issue16

    Fixed incorrect white space and indent parsing for elements which are not usually nested (i.e headings). The list of elements which needs this check can be added later.

    Currently, only headings were present in the parser.

    opened by BilakshanP 1
  • error build cli

    error build cli

    v0.2.0 tar.gz rust 1.77.2

    cd cli
    cargo buil --release
    
    error: couldn't read lib/src/../README.md: No such file or directory (os error 2)
     --> lib/src/lib.rs:3:10
      |
    3 | #![doc = include_str!("../README.md")]
      |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error: could not compile `shiva` (lib) due to 1 previous error
    warning: build failed, waiting for other jobs to finish...
    error: Bad exit status from /var/tmp/rpm-tmp.77941 (%build)
    
    
    opened by SergeyDjam 1
  • Rest API Server

    Rest API Server

    1. Use https://crates.io/crates/axum
    2. Look at https://github.com/igumnoff/shiva/tree/main/cli for understanding
    3. In first version do not care about images
    4. POST request example http://127.0.0.1/transform
    5. Units test requered for this new feature
    opened by evgenyigumnov 1
  • PageHeader and PageFooter for text module in generate function

    PageHeader and PageFooter for text module in generate function

    1. Inplementation of "PageHeader and PageFooter for text module in generate function"
    2. Units test requered for this new feature

    Look at markdown module like for example...

    opened by evgenyigumnov 1
  • Fix #46 - Add width, height and align to Image

    Fix #46 - Add width, height and align to Image

    • Added width, height, and align attributes to the Image component for improved styling flexibility.

    • Not all file types (e.g., typst, markdon) have been tested with images due to their specific requirements. Testing these types would involve creating separate tickets for those like(make image work on parse and generate for docx).

    This pull request enhances the Image component by introducing attributes that allow setting dimensions (width and height) and alignment (align).

    opened by joserochadocarmo 0
  • Refactor DocumentType enum

    Refactor DocumentType enum

    Summary This Pull Request refactors the DocumentType enum to leverage the strum crate for deriving additional functionality, ensuring a more DRY (Don't Repeat Yourself) codebase. This improvement retains compatibility with clap for command-line argument parsing. Also simplifying operations like parse, generate, or match document types.

    opened by joserochadocarmo 0
  • Markdown generate function need rewrite with

    Markdown generate function need rewrite with "comrak" crate

    Example code:

    use comrak::nodes::{AstNode, NodeHeading, NodeList, NodeTable, NodeValue};
    use comrak::{Options, format_commonmark};
    fn generate_md() -> String {
    
        let root = AstNode::from(NodeValue::Document);
    
    
    
        let h1 = AstNode::from(NodeValue::Heading(NodeHeading { level: 1 , setext: true}));
        let h1_text = AstNode::from(NodeValue::Text("Header text".to_string()));
        h1.append(&h1_text);
        root.append(&h1);
        let p = AstNode::from(NodeValue::Paragraph);
        let text = AstNode::from(NodeValue::Text("Hello, world".to_string()));
        p.append(&text);
        root.append(&p);
    
    
        let table = AstNode::from(NodeValue::Table(NodeTable { alignments: vec![], num_columns: 2, num_rows: 2, num_nonempty_cells: 4 }));
        let tr = AstNode::from(NodeValue::TableRow(false));
        let td = AstNode::from(NodeValue::TableCell);
        let td_text = AstNode::from(NodeValue::Text("Cell 1".to_string()));
        td.append(&td_text);
        tr.append(&td);
        let td = AstNode::from(NodeValue::TableCell);
        let td_text = AstNode::from(NodeValue::Text("Cell 2".to_string()));
        td.append(&td_text);
        tr.append(&td);
        table.append(&tr);
        let tr = AstNode::from(NodeValue::TableRow(false));
        let td = AstNode::from(NodeValue::TableCell);
        let td_text = AstNode::from(NodeValue::Text("Cell 3".to_string()));
        td.append(&td_text);
        tr.append(&td);
        let td = AstNode::from(NodeValue::TableCell);
        let td_text = AstNode::from(NodeValue::Text("Cell 4".to_string()));
        td.append(&td_text);
        tr.append(&td);
        table.append(&tr);
        root.append(&table);
    
        let list = AstNode::from(NodeValue::List(NodeList { list_type: Default::default(), marker_offset: 0, padding: 0, start: 0, delimiter: Default::default(), bullet_char: 0, tight: false }));
        let item = AstNode::from(NodeValue::Item(NodeList { list_type: Default::default(), marker_offset: 0, padding: 0, start: 0, delimiter: Default::default(), bullet_char: 0, tight: false }));
        let p = AstNode::from(NodeValue::Paragraph);
        let text = AstNode::from(NodeValue::Text("List item 1".to_string()));
        p.append(&text);
        item.append(&p);
        list.append(&item);
        let item = AstNode::from(NodeValue::Item(NodeList { list_type: Default::default(), marker_offset: 0, padding: 0, start: 0, delimiter: Default::default(), bullet_char: 0, tight: false }));
        let p = AstNode::from(NodeValue::Paragraph);
        let text = AstNode::from(NodeValue::Text("List item 2".to_string()));
        p.append(&text);
        item.append(&p);
        list.append(&item);
    
        root.append(&list);
    
        println!("{:#?}", root);
    
        let mut md = vec![];
        format_commonmark(&root, &Options::default(), &mut md).unwrap();
    
        String::from_utf8(md).unwrap()
    }
    
    fn main() {
        let md = generate_md();
    
        println!("{}", md);
    }
    
    opened by evgenyigumnov 0
  • HTML to markdown

    HTML to markdown

    I have a html file

    <html>
      <head>
        <title>Chew dad's slippers</title>
      </head>
      <body>
        <h1>
          Instead of drinking water from the cat bowl, make sure to steal water from
          the toilet
        </h1>
        <h2>Chase the red dot</h2>
        <p>
          Munch, munch, chomp, chomp hate dogs. Spill litter box, scratch at owner,
          destroy all furniture, especially couch get scared by sudden appearance of
          cucumber cat is love, cat is life fat baby cat best buddy little guy for
          catch eat throw up catch eat throw up bad birds jump on fridge. Purr like
          a car engine oh yes, there is my human woman she does best pats ever that
          all i like about her hiss meow .
        </p>
        <p>
          Dead stare with ears cocked when owners are asleep, cry for no apparent
          reason meow all night. Plop down in the middle where everybody walks favor
          packaging over toy. Sit on the laptop kitty pounce, trip, faceplant.
        </p>
      </body>
    </html>
    

    parse document is good (but don't undstand )</p> <pre><code>{ "elements": [ { "Text": { "text": "Chew dad's slippers", "size": 8 } }, { "Header": { "level": 1, "text": "Instead of drinking water from the cat bowl, make sure to steal water from\n the toilet" } }, { "Header": { "level": 2, "text": "Chase the red dot" } }, { "Paragraph": { "elements": [ { "Text": { "text": "\n Munch, munch, chomp, chomp hate dogs. Spill litter box, scratch at owner,\n destroy all furniture, especially couch get scared by sudden appearance of\n cucumber cat is love, cat is life fat baby cat best buddy little guy for\n catch eat throw up catch eat throw up bad birds jump on fridge. Purr like\n a car engine oh yes, there is my human woman she does best pats ever that\n all i like about her hiss meow .\n ", "size": 8 } } ] } }, { "Paragraph": { "elements": [ { "Text": { "text": "\n Dead stare with ears cocked when owners are asleep, cry for no apparent\n reason meow all night. Plop down in the middle where everybody walks favor\n packaging over toy. Sit on the laptop kitty pounce, trip, faceplant.\n ", "size": 8 } } ] } } ], "page_width": 210.0, "page_height": 297.0, "left_page_indent": 10.0, "right_page_indent": 10.0, "top_page_indent": 10.0, "bottom_page_indent": 10.0, "page_header": [], "page_footer": [] } </code></pre> <p>generate as text is ok</p> <pre><code class="language-text">Chew dad's slippers Instead of drinking water from the cat bowl, make sure to steal water from the toilet Chase the red dot Munch, munch, chomp, chomp hate dogs. Spill litter box, scratch at owner, destroy all furniture, especially couch get scared by sudden appearance of cucumber cat is love, cat is life fat baby cat best buddy little guy for catch eat throw up catch eat throw up bad birds jump on fridge. Purr like a car engine oh yes, there is my human woman she does best pats ever that all i like about her hiss meow . Dead stare with ears cocked when owners are asleep, cry for no apparent reason meow all night. Plop down in the middle where everybody walks favor packaging over toy. Sit on the laptop kitty pounce, trip, faceplant. </code></pre> <p>BUT as md , miss a lot</p> <pre><code class="language-md">Chew dad's slippers # Instead of drinking water from the cat bowl, make sure to steal water from the toilet ## Chase the red dot </code></pre> </article> </div> <span class="publish py-3 d-inline-block w-100"> opened by cgisky1980 <i class="fa fa-commenting" aria-hidden="true"></i> 1 </span> </div> </div> </li> <li> <div class="d-flex"> <div class="left"> <span> <img data-original="https://avatars.githubusercontent.com/u/10693931?v=4" class="lazy profile-pict-img img-fluid" alt="log replace println!"> </span> </div> <div class="right"> <h4> <a href="https://github.com/igumnoff/shiva/issues/101" rel="nofollow"> log replace println! </a> </h4> <div class="review-description"> <article class="markdown-body text-wrap"> <p>Could you remove all of println?</p> <p>Add "log = "0.4.20" to Cargo.toml please</p> <p>Probably better way to inform about problems should look like this:</p> <p>log::warn!("No align value for image");</p> <p>you should understand what for printing logs you could use other crate</p> <p>for example "env_logger = "0.10.0""</p> <p>please add this create only for tests like a developer dependency</p> </article> </div> <span class="publish py-3 d-inline-block w-100"> opened by evgenyigumnov <i class="fa fa-commenting" aria-hidden="true"></i> 0 </span> </div> </div> </li> <li> <div class="d-flex"> <div class="left"> <span> <img data-original="https://avatars.githubusercontent.com/u/10693931?v=4" class="lazy profile-pict-img img-fluid" alt="JSON parser and generator change from default Document struct to programmaticaly"> </span> </div> <div class="right"> <h4> <a href="https://github.com/igumnoff/shiva/issues/93" rel="nofollow"> JSON parser and generator change from default Document struct to programmaticaly </a> </h4> <div class="review-description"> <article class="markdown-body text-wrap"> <p>examples</p> <pre><code class="language-rust">extern crate serde_json; use serde_json::{Value, json}; fn main() { let data = r#" { "name": "John Doe", "age": 30, "phones": [ "+1234567890", "+0987654321" ] }"#; let v: Value = serde_json::from_str(data).unwrap(); println!("Name: {}", v["name"]); println!("Age: {}", v["age"]); println!("Tel:"); for phone in v["phones"].as_array().unwrap() { println!("{}", phone); } } </code></pre> <pre><code class="language-rust">use serde_json::{Map, Value}; fn main() { // Пример JSON в виде строки let data = r#" { "name": "Jane Doe", "age": 25, "is_student": false }"#; let parsed: Map<String, Value> = serde_json::from_str(data).unwrap(); if let Some(name) = parsed.get("name") { println!("Name: {}", name); } } </code></pre> </article> </div> <span class="publish py-3 d-inline-block w-100"> opened by evgenyigumnov <i class="fa fa-commenting" aria-hidden="true"></i> 0 </span> </div> </div> </li> <li> <div class="d-flex"> <div class="left"> <span> <img data-original="https://avatars.githubusercontent.com/u/10693931?v=4" class="lazy profile-pict-img img-fluid" alt="create unit tests for all document types"> </span> </div> <div class="right"> <h4> <a href="https://github.com/igumnoff/shiva/issues/91" rel="nofollow"> create unit tests for all document types </a> </h4> <div class="review-description"> <article class="markdown-body text-wrap"> <p>Order for tests:</p> <ol> <li>Markdown</li> <li>Plain text</li> <li>PDF</li> <li>XLS</li> <li>XLSX</li> <li>CSV</li> <li>ODS</li> <li>Typst</li> <li>RTF</li> <li>DOCX</li> <li>JSON</li> <li>XML</li> </ol> <p>Before create test you should check parser/generate file. for example markdown.rs have already some test. Just move unit test to your file. Integration test do not move</p> </article> </div> <span class="publish py-3 d-inline-block w-100"> opened by evgenyigumnov <i class="fa fa-commenting" aria-hidden="true"></i> 0 </span> </div> </div> </li> </ul> </div> </div> </div> <div id="releases" class="card mt-3"> <div class="card-header"><h5>Releases(v0.4.0)</h5></div> <div class="card-body"> <div class="review-list"> <ul> <li> <div class="d-flex"> <div class="right"> <h4> v0.4.0(May 31, 2024) </h4> <div class="review-description"> <article class="markdown-body"> <ul> <li>Feature: RTF Parser</li> <li>Feature: Docx Parser</li> <li>Feature: XML Generator/Parser</li> <li>Feature: CSV Parser</li> <li>Feature: Add image support into PDF Generator</li> <li>Feature: Rest API Server</li> <li>Feature: Add "clap" to "server" mode</li> <li>Bugfix: Document Whitespace and Indent parsing for HTML</li> <li>Improvements: Refactoring MarkDown Parser with using: pulldown-cmark crate</li> <li>Improvements: "fonts" folder in pdf.rs</li> <li>Improvements: "test" module with unit tests for HTML</li> </ul> <p>Thanks for contributors:</p> <p>@Longlom @whereasjovially @0xshodan @BilakshanP @develop-build @takahiro6730 @Lucky-49 @Christiantyemele @Dandiggas @gitksqc</p> <i class="fa fa-file-code-o m-r-xs" aria-hidden="true"></i><a href="https://api.github.com/repos/igumnoff/shiva/tarball/v0.4.0">Source code(tar.gz)</a><br><i class="fa fa-file-code-o m-r-xs" aria-hidden="true"></i><a href="https://api.github.com/repos/igumnoff/shiva/zipball/v0.4.0">Source code(zip)</a><br> </article> </div> </div> </div> </li> <li> <div class="d-flex"> <div class="right"> <h4> v0.3.0(Apr 25, 2024) </h4> <div class="review-description"> <article class="markdown-body"> <ul> <li>JSON parse/generate support</li> <li>List generation for PDF</li> <li>Hyperlink generation for PDF</li> <li>Text generation improvement</li> </ul> <p>Thanks for contributors:</p> <p>@0xshodan @Longlom @BilakshanP @ScriptHound</p> <i class="fa fa-file-code-o m-r-xs" aria-hidden="true"></i><a href="https://api.github.com/repos/igumnoff/shiva/tarball/v0.3.0">Source code(tar.gz)</a><br><i class="fa fa-file-code-o m-r-xs" aria-hidden="true"></i><a href="https://api.github.com/repos/igumnoff/shiva/zipball/v0.3.0">Source code(zip)</a><br> </article> </div> </div> </div> </li> </ul> </div> </div> </div> </div> <div class="col-lg-4 right"> <div id="basic" class="tab-pane fade show active"> <div class="box shadow-sm rounded bg-white mb-3"> <div class="box-title border-bottom p-3"> <h6 class="m-0">Owner </h6> </div> <div class="d-flex align-items-center p-3 job-item-header"> <div class="overflow-hidden mr-2"> <h6 class="font-weight-bold -dark mb-0 text-truncate"> Igumnoff Software </h6> <div class="small text-gray-500"> Software Development Sole Proprietorship specializing in the Rust language </div> </div> <img class="img-fluid ml-auto" style="border-radius: 50%;" src="https://avatars.githubusercontent.com/u/163889976?v=4&s=60" alt="Igumnoff Software"> </div> <div class="box-body p-3"> <a href="https://github.com/igumnoff/shiva" rel="nofollow" target="_blank" class="btn btn-lg btn-block btn-dark mb-3"><i class="fa fa-github" aria-hidden="true"></i> GitHub </a> <a href="https://docs.rs/shiva" rel="nofollow" target="_blank" class="btn btn-lg btn-block btn-dark mb-3"><i class="fa fa-home" aria-hidden="true"></i> https://docs.rs/shiva</a> </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/calebwin-stdg-rust-command-line"><h6 class="font-weight-bold ">Standard Graphics is a command-line tool for printing 2D graphics from any language to any screen. </h6></a> <p class="mb-0 text-muted">2D graphics in any programming language with just print statements!</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/20741909?v=4&s=40" alt="Caleb Winston" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 123 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Nov 20, 2022 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/a-crate-that-allows-you-to-mostlysafely-cast-one-type-into-another-type"><h6 class="font-weight-bold ">A crate that allows you to mostly-safely cast one type into another type.</h6></a> <p class="mb-0 text-muted">A crate that allows you to mostly-safely cast one type into another type. This is mostly useful for generic functions, e.g. pub fn foo<S>(s: S) { </p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/67441074?v=4&s=40" alt="Bincode" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 3 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Sep 23, 2023 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/convert-markdown-documents-into-themed-html-pages-with-support-for-code-syntax-highlighting-latex-and-mermaid-diagrams"><h6 class="font-weight-bold ">🏭 Convert Markdown documents into themed HTML pages with support for code syntax highlighting, LaTeX and Mermaid diagrams.</h6></a> <p class="mb-0 text-muted">Marky Markdown Magician ?? Features Hot reload previewing ?? Conversion to HTML / PDF ?? Themes! ✨ Extensions - Math, diagrams, syntax-highlighting ??</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/62389790?v=4&s=40" alt="Vadim" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 12 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Feb 19, 2023 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/a-tool-to-format-codeblocks-inside-markdown-and-org-documents"><h6 class="font-weight-bold ">A tool to format codeblocks inside markdown and org documents.</h6></a> <p class="mb-0 text-muted">cbfmt (codeblock format) A tool to format codeblocks inside markdown, org, and restructuredtext documents. It iterates over all codeblocks, and format</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/12900252?v=4&s=40" alt="Lukas Reineke" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 126 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> May 26, 2023 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/0918nobita-cli-compose"><h6 class="font-weight-bold ">Next-generation, type-safe CLI parser for Rust</h6></a> <p class="mb-0 text-muted">Next-generation, type-safe CLI parser for Rust </p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/8453302?v=4&s=40" alt="0918nobita" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 19 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Jul 20, 2022 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/a-tool-to-compare-how-typst-documents-would-look-using-different-fonts-or-font-variants"><h6 class="font-weight-bold ">A tool to compare how Typst documents would look using different fonts or font variants.</h6></a> <p class="mb-0 text-muted">typst-font-compare A tool to compare how Typst documents would look using different fonts or font variants. Installation cargo install --path . Usage </p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/44589151?v=4&s=40" alt="null" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 3 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Feb 15, 2024 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/a-language-parser-tool-to-build-recursive-descent-top-down-parser"><h6 class="font-weight-bold ">A language parser tool to build recursive descent top down parser.</h6></a> <p class="mb-0 text-muted">lang-pt A language parser tool to generate recursive descent top down parser. Overview Parsers written for the languages like Javascript are often cus</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/22768173?v=4&s=40" alt="Creative Forest" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 7 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Jan 4, 2023 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/use-any-async-rust-library-from-php"><h6 class="font-weight-bold ">Use any async Rust library from PHP!</h6></a> <p class="mb-0 text-muted">php-tokio - Use any async Rust library from PHP! Created by Daniil Gentili (@danog). This library allows you to use any async rust library from PHP, a</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/7339644?v=4&s=40" alt="Daniil Gentili" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 242 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Sep 7, 2023 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/b23r0-abcdict"><h6 class="font-weight-bold ">A better customization password dictionary generator implementation by Rust.</h6></a> <p class="mb-0 text-muted">abcdict A better customization password dictionary generator implementation by Rust. Features Cli Faster Customize Rules Build & Installation $> cargo</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/35518985?v=4&s=40" alt="b23r0" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 6 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Jun 2, 2022 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/ustato-a-powerful-threadsafe-global-state-management-library-for-rust-applications-offering-typesafe-reactive-state-handling-with-an-easytouse-macrob"><h6 class="font-weight-bold ">Rustato: A powerful, thread-safe global state management library for Rust applications, offering type-safe, reactive state handling with an easy-to-use macro-based API.</h6></a> <p class="mb-0 text-muted">Rustato State Manager A generical thread-safe global state manager for Rust Introduction • Features • Installation • Usage • Advanced Usage • Api Refe</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/164587854?v=4&s=40" alt="BiteCraft" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 8 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Sep 16, 2024 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/webbased-tool-that-allows-browsing-and-comparing-symbol-and-type-information-of-microsoft-windows-binaries-across-different-versions-of-the-os"><h6 class="font-weight-bold ">Web-based tool that allows browsing and comparing symbol and type information of Microsoft Windows binaries across different versions of the OS.</h6></a> <p class="mb-0 text-muted">WinDiff About WinDiff is an open-source web-based tool that allows browsing and comparing symbol and type information of Microsoft Windows binaries ac</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/7239307?v=4&s=40" alt="Erwan Grelet" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 208 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Jun 15, 2023 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/fschutt-rust-fontconfig"><h6 class="font-weight-bold ">Pure-Rust rewrite of the Linux fontconfig library (no system dependencies) - using ttf-parser and allsorts</h6></a> <p class="mb-0 text-muted">rust-fontconfig Pure-Rust rewrite of the Linux fontconfig library (no system dependencies) - using allsorts as a font parser in order to parse .woff, </p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/12084016?v=4&s=40" alt="Felix Schütt" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 28 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Oct 29, 2022 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/lucawen-rbtc-rust-command-line"><h6 class="font-weight-bold ">RBTC is cli to convert BTC to any currency and vice-versa.</h6></a> <p class="mb-0 text-muted">RBTC RBTC is cli to convert BTC to any currency and vice-versa. Building for source For build the binary just: $ cargo build To run as debug, just run</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/1365208?v=4&s=40" alt="Luca Lacerda" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 5 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Nov 8, 2021 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/skmendez-tree-sitter-traversal"><h6 class="font-weight-bold ">Traversal of tree-sitter Trees and any arbitrary tree with a TreeCursor-like interface</h6></a> <p class="mb-0 text-muted">tree-sitter-traversal Traversal of tree-sitter Trees and any arbitrary tree with a TreeCursor-like interface. Using cursors, iteration over the tree c</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/11880824?v=4&s=40" alt="Sebastian Mendez" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 12 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Jan 8, 2023 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/kaplanelad-shellfirm"><h6 class="font-weight-bold ">Shellfirm - Intercept any risky patterns (default or defined by you) and prompt you a small challenge for double verification</h6></a> <p class="mb-0 text-muted">shellfirm Opppppsss you did it again? ?? ?? ?? Protect yourself from yourself! rm -rf * git reset --hard before saving? kubectl delete ns which going </p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/1224389?v=4&s=40" alt="elad" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 652 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Dec 29, 2022 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/starship-starship"><h6 class="font-weight-bold ">☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell</h6></a> <p class="mb-0 text-muted">☄??️ The minimal, blazing-fast, and infinitely customizable prompt for any shell</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/49654870?v=4&s=40" alt="Starship Command" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 31.6k <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Dec 30, 2022 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/that-program-use-on-platform-windows-and-if-you-write-any-text-on-uncorrect-keyboard-layout-that-program-for-that"><h6 class="font-weight-bold ">That program use on platform windows. And if you write any text on uncorrect keyboard layout, that program for that. </h6></a> <p class="mb-0 text-muted">?? This program is designed to translate text into the correct layout when typing is incorrect. ?? Example ghbdtn -> привет Just (by default) pressing</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/66124279?v=4&s=40" alt="Gest Se" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 5 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Jan 26, 2023 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/kusa-is-a-simple-cli-tool-that-works-on-any-platform-and-displays-github-contribution-graphs"><h6 class="font-weight-bold ">Kusa is a simple CLI tool that works on any platform and displays GitHub contribution graphs.</h6></a> <p class="mb-0 text-muted">Kusa is a simple CLI tool that works on any platform and displays GitHub contribution graphs. Installation Homebrew (only macOS) $ brew tap Ryu0118/Ku</p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/87907656?v=4&s=40" alt="Ryu" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 103 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Jun 18, 2023 </div> </div> <div class="box shadow-sm mb-3 rounded bg-white ads-box"> <div class="p-3 border-bottom"> <a href="/repo/atch-tailwindcss-errors--at-compiletime-before-they-catch-you-without-making-any-change-to-your-code--supports-overriding-extending-custom-classes-cu"><h6 class="font-weight-bold ">Catch Tailwindcss Errors at Compile-Time Before They Catch You, without making any change to your code! Supports overriding, extending, custom classes, custom modifiers, Plugins and many more 🚀🔥🦀</h6></a> <p class="mb-0 text-muted">twust Twust is a powerful static checker in rust for TailwindCSS class names at compile-time. Table of Contents Overview Installation Usage Statement </p> </div> <div class="p-2"> <img class="lazy img-fluid mr-3" style="border-radius: 50%;max-width: 15%" data-original="https://avatars.githubusercontent.com/u/31687368?v=4&s=40" alt="null" > <i class="fa fa-star ml-3" aria-hidden="true"></i> 15 <i class="fa fa-clock-o ml-3" aria-hidden="true"></i> Nov 8, 2023 </div> </div> </div> </div> </div> </div> <!-- footer --> <footer class="bg-white"> <div class="container"> <div class="copyright"> <div class="logo"> <a href="/"> <img src="/assets/images/logo_rustrepo.png"> </a> </div> <p>2022.RustRepo </p> </div> </div> </footer> <!-- footer--> <!-- Bootstrap core JavaScript --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha512-bnIvzh6FU75ZKxp0GXLH9bewza/OIw6dLVh9ICg0gogclmYGguQJWl8U30WpbsGTqbIiAwxTsbe76DErLq5EDQ==" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.bundle.min.js" integrity="sha512-Oy5BruJdE3gP9+LMJ11kC5nErkh3p4Y0GawT1Jrcez4RTDxODf3M/KP3pEsgeOYxWejqy2SPnj+QMpgtvhDciQ==" crossorigin="anonymous"></script> <!-- select2 Js --> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js" integrity="sha512-2ImtlRlf2VVmiGZsjm9bEyhjGW4dU7B6TNwh/hx/iSByxNENtj3WVE6o/9Lj4TJeVXPi4bnOIMXFIJJAeufa0A==" crossorigin="anonymous"></script> <!-- Custom --> <script src="/assets/js/custom.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script> <script> $(function() { $("img.lazy").lazyload({ threshold :180, failurelimit :20, effect : "fadeIn" }); }); </script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script> <script> hljs.initHighlightingOnLoad(); </script> </body> </html><script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="464323d487b9e109b628496d-|49" defer></script>