Giter VIP home page Giter VIP logo

qara2rust's Introduction

qara2rust

Qaraidel to Rust transpiler.

What is Qaraidel?

Qaraidel is a tool that generates code from Markdown documents written in a special way. Its goal to make literate programming and documentation easier and more straight-forward using familiar markdown syntax.

From this:

## enum Weather
- Rainy
- Sunny

To this:

enum Weather {
    Rainy,
    Sunny
}

The more complicated example can be found here:

What is qara2rust?

This is the first implementation of Qaraidel for Rust programming language written in Perl.

How do I use it?

Qara2rust reads source text from stdin and outputs text after processing to stdout. You can pipe the output to rustfmt, for example.

This would read file main.md and save it to main.rs:

cat main.md | qara2rust > main.rs

This would also format the resulting code nicely and detect any errors Rust compiler would:

cat main.md | qara2rust | rustfmt > main.rs

What language elements are supported?

  • Enums
  • Structs
  • Impl blocks
  • Modules
  • Functions

You can also write Rust code directly, of course.

Installation

Save file qara2rust.pl somewhere in your $PATH (in this example I save it as ~/bin/qara2rust, change as you wish):

git clone https://github.com/bouncepaw/qara2rust.git
cd qara2rust
mv qara2rust.pl ~/bin/qara2rust

Contributing

If there is a bug or a feature you would like to see, open an issue or make a pull request.

qara2rust's People

Contributors

bouncepaw avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.