nihdoc

WIP markup parser (txt -> html)
git clone git://git.alexkarle.com.com/blag
Log | Files | Refs | README | LICENSE

commit 94c419801a05f1442182b0752fef0d89489b75b7 (patch)
parent f61637850b788d1805392e7633151c8c381327a6
Author: Alex Karle <alex@alexkarle.com>
Date:   Mon, 27 Dec 2021 12:09:25 -0500

Rebrand blag -> nihdoc

The new name is a play on mdoc(7), jokingly pointing fun at the decision
to "invent here" instead of use markdown.

Diffstat:
M.gitignore | 2+-
MMakefile | 20++++++++++----------
MREADME | 20+++++++++++---------
Rblag.1 -> nihdoc.1 | 0
Rblag.c -> nihdoc.c | 0
Mtest/big.html | 2+-
Mtest/big.txt | 2+-
7 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,4 +1,4 @@ -blag +nihdoc # test file input diff --git a/Makefile b/Makefile @@ -1,30 +1,30 @@ -# blag makefile +# nihdoc makefile CFLAGS = -g -O2 -Wall -Wpedantic -Wextra -blag: blag.c - $(CC) $(CFLAGS) -o $@ blag.c +nihdoc: nihdoc.c + $(CC) $(CFLAGS) -o $@ nihdoc.c .PHONY: check -check: blag +check: nihdoc @for f in test/*.txt; do \ printf "$$f ... "; \ base=$$(basename $$f txt)html; \ if [ -z $(GENBASE) ]; then \ - ./blag < $$f > /tmp/$$base; \ + ./nihdoc < $$f > /tmp/$$base; \ diff -u test/$$base /tmp/$$base; \ echo "success!"; \ else \ - ./blag < $$f > test/$$base; \ + ./nihdoc < $$f > test/$$base; \ echo "generated!"; \ fi; \ done .PHONY: clean clean: - rm -f blag + rm -f nihdoc .PHONY: install -install: blag +install: nihdoc mkdir -p $(HOME)/bin $(HOME)/share/man/man1 - install -m 555 blag $(HOME)/bin - install -m 444 blag.1 $(HOME)/share/man/man1 + install -m 555 nihdoc $(HOME)/bin + install -m 444 nihdoc.1 $(HOME)/share/man/man1 diff --git a/README b/README @@ -1,11 +1,16 @@ -# blag +# nihdoc + + Not Invented Here Doc + - - - --- > "because markdown isn't in base!" -> ~akarle +> +> ~akarle + ## Description -blag is my take at a light markup language to improve my +nihdoc is my take at a light markup language to improve my time-to-publish on blog posts. I concede up front that others should likely use markdown, which is both prettier and more well-known, but as a personal challenge I try to keep my blog @@ -14,11 +19,11 @@ no markdown parser in base, I had to write my own! ## Usage -`blag` reads from stdin and prints HTML snippets to stdout. No +`nihdoc` reads from stdin and prints HTML snippets to stdout. No arguments are read and no files are accessible (on OpenBSD this is enforced via pledge(2)). Common usage is: - $ (cat header.html; blag < file.txt; cat footer.html) > file.html + $ (cat header.html; nihdoc < file.txt; cat footer.html) > file.html ## Support @@ -29,12 +34,9 @@ is enforced via pledge(2)). Common usage is: - > quotes - TAB code blocks - Inline `code`, _italics_, and *bold* -- Escaping via \ +- Escaping via \\ - Links: [https://alexkarle.com my site] or [https://alexkarle.com] ## TODO - Mixed lists -- Lots of code cleanup -- Error reporting on malformed blocks -- Tests diff --git a/blag.1 b/nihdoc.1 diff --git a/blag.c b/nihdoc.c diff --git a/test/big.html b/test/big.html @@ -1,6 +1,6 @@ <h1>hello world</h1> <p> -This is an example blag file! +This is an example nihdoc file! </p> <p> <em>This should be emphasized within a paragraph</em> diff --git a/test/big.txt b/test/big.txt @@ -1,6 +1,6 @@ # hello world -This is an example blag file! +This is an example nihdoc file! _This should be emphasized within a paragraph_