A Rust program that converts Org-mode text to HTML with syntax highlighting. It reads Org-mode content from standard input and outputs HTML to standard output with syntaxh highlighted code blocks.
This is a very small simple binary that I'm using in Chalsedony.
git clone https://github.com/RyanGreenup/orghtml
cargo install --path .
org2html < ~/Agenda/todo.org > /tmp/file.html
firefox /tmp/file.html
The program reads Org-mode content from stdin and writes the HTML output to stdout. Code blocks in your Org file should specify the language using the standard Org-mode syntax:
#+TITLE: An example for the Readme
* Code Block
Here is a code block:
#+begin_src python
def hello():
print("Hello, World!")
#+end_src
<main>
<section></section>
<h1>Code Block</h1>
<section>
<p></p>
<p>Here is a code block:
</p>
<pre>
<code class="language-python">
<span style="font-weight:bold;color:#a71d5d;">
def </span><span style="font-weight:bold;color:#323232;">hello</span><span style="color:#323232;">():
</span><span style="color:#62a35c;">print</span><span style="color:#323232;">(</span><span style="color:#183691;">"Hello, World!"</span><span style="color:#323232;">)
</span></code></pre></section>
</main>
This project is open source and available under the GPL3 License.