Giter Club home page Giter Club logo

pandoc-types's Introduction

Rust port of pandoc-types Build status

This library provides a Rust port of the pandoc-types Haskell package.

To install, add the following to your Cargo.toml:

[dependencies]
pandoc_types = "0.5"

What this library is for

The purpose of pandoc-types is to allow Rust programs to natively manipulate Pandoc documents. Using this library, Rust programs should be able to create and modify Pandoc documents in a principled way (i.e. via ASTs, not text). This library can also be used along with serde_json to serialize and deserialize Pandoc documents to and from Pandoc's JSON format.

What this library is NOT for

This library does not provide a way of calling the Pandoc executable itself. If that's what you're looking for, consider the rust-pandoc library.

Compatibility

The current version is compatible with Haskell pandoc-types 1.22. This is the most recent version at the time of writing.

Supported modules

The following modules from pandoc-types are supported:

  • Haskell Text.Pandoc.Definition (as pandoc_types::definition in Rust)

Note that Text.Pandoc.JSON is unnecessary in Rust because all types implement Serialize and Deserialize from serde and can be used directly with serde_json.

Example usage

let para = Block::Para(vec![Inline::Str("b".to_owned())]);

let s = serde_json::to_string(&para)?;
println!("serialized = {}", s);

let d: Block = serde_json::from_str(&s)?;
println!("deserialized = {:?}", d);

For a full example, see examples/definition.rs.

License

This library is licensed under the Apache License, Version 2.0 (see LICENSE.txt).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.