- Debian Package
- Fedora package comming soon
If you want to stay in sync with the git-repo, use the
install-dev.sh script instead of the Debian or Fedora package. note:
install-dev.sh just creates a symbolic link
transpile that points to the current location of
cd git clone https://github.com/rusthon/Rusthon.git cd Rusthon sudo ./install-dev.sh
To see all the command line options run
cd myproject transpile mymarkdown.md
Above will compile everything in mymarkdown.md:
- if the markdown contains an html page, it will be opened with NW.js or your system default web browser.
- otherwise, if the markdown contains: C++, Rust, or Go code, it will be compiled, and the exe is run.
Mini-macros help you make your code more readable, and hide ugly APIs like HTML DOM. note: you can use unicode for macro names.
with 𝕄 as "_=document.createElement(%s); _.setAttribute('id',%s); %s.appendChild(_)": 𝕄( 'div', 'someid1', document.body ) 𝕄( 'img', 'someid2', document.body )
You can also use the
-> right arrow syntax as a shortcut on DOM elements for appending, setting attributes,
and creating text nodes. You can also define
__right_arrow__ on your own classes to customize what
-> will do,
for more info see: here
The example above could be rewritten as:
with 𝕄 as "document.createElement(%s)": document.body->( 𝕄('div')->(id='someid1'), 𝕄('img')->(id='someid2') )
You can also do the same thing as above using pure python syntax.
a = document.createElement('div') a.setAttribute('id', 'someid1') b = document.createElement('img') b.setAttribute('id', 'someid2') document.body.appendChild(a) document.body.appendChild(b)
The C++11 backend is the most mature of the native compiled backends. All the backends are regression tested, and the tests results are here:
C++ Backend Docs
note: this and other backends are still a work in progress.