https://github.com/kkestell/md
Quickly converts a simplified dialect of Markdown to HTML
https://github.com/kkestell/md
c html markdown utf-8
Last synced: 2 months ago
JSON representation
Quickly converts a simplified dialect of Markdown to HTML
- Host: GitHub
- URL: https://github.com/kkestell/md
- Owner: kkestell
- License: 0bsd
- Created: 2024-02-12T19:21:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-26T18:27:46.000Z (almost 2 years ago)
- Last Synced: 2025-06-23T05:46:38.825Z (about 1 year ago)
- Topics: c, html, markdown, utf-8
- Language: C++
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `md`
Quickly converts a simplified dialect of Markdown to HTML.
## Features
* Minimal dependencies
* Reasonably fast (~2 million lines per second on an i7-10700K)
* No runtime memory allocation
* UTF-8 support
* Simplified Markdown dialect
* Headers
* Paragraphs
* Inline formatting: bold, italic, code
* Hyperlinks
* Ordered and unordered lists
* Multi-line blockquotes
* Code blocks
* Tables
* Horizontal rules
* Embedded HTML
## Usage
```
md [-i input_file] [-o output_file]
```
If `-i` is not specified, `md` reads from `stdin`. If `-o` is not specified, `md` writes to `stdout`.
## Example
### Markdown
~~~
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
Paragraphs are *separated by a _blank_ line*.
Single `newlines are treated as line breaks`. Separate  with a blank line.
* This is a list item
* This is another list item
### Tables
| Name | Price |
|------|-------|
| A | 1 |
| B | 2 |
| C | 3 |
## UTF-8
∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β),
ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (A ⇔ B),
2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm
((V⍳V)=⍳⍴V)/V←,V ←⍳→⍴∆∇⊃‾⍎⍕⌈
### Multibyte Characters
中英文均可混在⼀起 한국어조차도 가능합니다.
> “The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures.”
> ― Frederick P. Brooks
1. This is a numbered list item
2. This is another numbered list item
```
def hello_world():
print("Hello World!")
```
Hello
World
~~~
### HTML
```
Header 1
Header 2
Header 3
Header 4
Header 5
Header 6
Paragraphs are separated by a blank line.
Single newlines are treated as line breaks. Separate block elements with a blank line.
- This is a list item
- This is another list item
Tables
NamePrice
A1
B2
C3
UTF-8
∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β),
ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (A ⇔ B),
2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm
((V⍳V)=⍳⍴V)/V←,V ←⍳→⍴∆∇⊃‾⍎⍕⌈
Multibyte Characters
中英文均可混在⼀起 한국어조차도 가능합니다.
“The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures.”
― Frederick P. Brooks
- This is a numbered list item
- This is another numbered list item
def hello_world():
print("Hello World!")
Hello
World
```