alkhe / techdown

Markdown + LaTeX + nomnoml = <3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

techdown

A markdown flavor for technical documents, using katex and nomnoml.

Get

$ yarn add techdown

Use

notes.md

```chart
[Price]->[Total Benefit]
[Quantity]->[Total Benefit]
[Fixed Cost]->[Total Cost]
[Variable Cost]->[Total Cost]
[Total Benefit]->[Total Profit]
[Total Cost]->[Total Profit]
```
<center>*Relationship between $P$, $Q$, $B$, $C_0$, $C_V$, $C$, and $\Pi$.*</center>

script.js

const techdown = require('techdown')
const fs = require('fs')

const render = techdown()

const md = fs.readFileSync('./notes.md')

const output = render(md)

console.log(output) // <center><svg version="1.1" baseProfile="full" width="673"...

Dump the output of render into an HTML file, and include the katex stylesheet (necessary to display LaTeX content properly):

<html>
  <head>
    <link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css' integrity='sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq' crossorigin='anonymous'>
    <script src='https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js' integrity='sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz' crossorigin='anonymous'></script>
  </head>
  <body>
    <!-- render output goes here -->
  </body>
</html>

About

Markdown + LaTeX + nomnoml = <3


Languages

Language:HTML 72.8%Language:JavaScript 25.0%Language:CSS 2.2%Language:TeX 0.1%