From 3105b8c311e51cd27dbfec6185cab57c18775d52 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sat, 18 Dec 2021 01:28:02 -0500 Subject: [PATCH] Add README and promote to its own repo! At this point, I want to preserve its history beyond the life of my site :) I suspect it may not be used for alexkarle.com OR there will be another iteration.. keeping it in its own repo will allow shareability beyond its actual use. --- .gitignore | 1 + LICENSE | 21 +++++++++++++++++++++ Makefile | 9 +++++++++ README | 40 ++++++++++++++++++++++++++++++++++++++++ blag.c | 24 ------------------------ 5 files changed, 71 insertions(+), 24 deletions(-) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87f647d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +blag diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2732b68 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021, Alex Karle + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4d22fc8 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +# blag makefile +CFLAGS = -g -O2 -Wall -Wpedantic -Wextra + +blag: blag.c + $(CC) $(CFLAGS) -o $@ blag.c + +.PHONY: clean +clean: + rm -f blag diff --git a/README b/README new file mode 100644 index 0000000..b10ac0e --- /dev/null +++ b/README @@ -0,0 +1,40 @@ +# blag + +> "because markdown isn't in base!" +> ~akarle + +## Description + +blag 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 +publishable under *only the OpenBSD base system*. Since there's +no markdown parser in base, I had to write my own! + +## Usage + +`blag` 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 + +## Support + +- #|##|### headers +-

tags around paragraphs (allowed to wrap!) +- - bullets, breaks allowed if indented +- 1. numerical lists, breaks allowed if indented +- > quotes +- TAB code blocks +- Inline `code`, _italics_, and *bold* +- 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.c b/blag.c index ec9f5d9..57d9bbe 100644 --- a/blag.c +++ b/blag.c @@ -3,30 +3,6 @@ * ~akarle, MIT License * * "because markdown isn't in base!" - * - * Support: - * -------- - * #|##|### headers - * - *

tags around paragraphs - * - * - bullets, breaks allowed if indented - * - * 1. numerical lists, breaks allowed if indented - * - * > quotes - * - * TAB code blocks - * - * Inline `code`, _italics_, and *bold* - * - * Escaping via \ - * - * Links: [url desc] or [url] - * - * TODO: - * ----- - * - error reporting for malformed blocks */ #include #include -- libgit2 1.1.1