MulleWeb / mulle-markdown

πŸ‘― mulle-markdown turns markdown into HTML (as a static executable)
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

mulle-markdown

πŸ‘― mulle-markdown turns markdown into HTML

mulle-markdown uses the hoedown library wrapped into MulleHoedown to convert Markdown into HTML.

You can get mulle-markdown to add a stylesheet to your HTML output. That makes it convenient for quick previewing of markdown files.

Executables

Executable Description
mulle-markdown Markdown to HTML converter
mulle-markdown-preview Render markdown into temporary file and open in web browser

Usage

Usage:
   mulle-markdown [options]

   Reads markdown from stdin, writes it to stdout.

Options:
   -c         : emit link to "style.css" (implies -w)
   -i         : inline "style.css" into HTML head (implies -w)
   -m         : inline a hardcoded style.css (implies -w)
   -t <title> : set title of HTML document (implies -w)
   -w         : wrap with HTML header and footer
   --version  : print program version and exit

Example

Preview README.md

Produces a nicely styled and readable HTML output file and open it in a browser (linux/macos):

mulle-markdown-preview README.md

Arbitrary markdown

echo "# hello" | mulle-markdown -c

emits

<html>
<head>
<link rel="stylesheet" href="https://github.com/MulleWeb/mulle-markdown/blob/release/style.css">
</head>
<body>
<h1>hello</h1>
</body>
</html>

Note

mulle-markdown does not pretty print the resulting HTML. You may want to chain it with mulle-tidy for nicer output.

mulle-markdown as a musl or cosmopolitan static executable

mulle-markdown is a small showcase on how to compile mulle-objc with musl or cosmopolitan into a standalone static/cross-platform executable. The craft for musl or cosmopolitan must be done on linux though. The C libraries are considered SDKs and can be selected with:

mulle-sde env --os-linux set MULLE_CRAFT_SDKS "cosmopolitan:musl:default"

SDK selection via sourcetree

See mulle-sourcetree list --output-format cmd on how to add cosmopolitan or musl to a sourcetree. Pay attention to the only-craft-sdk-<name> marks.

You are here

Overview

Add

Use mulle-sde to add mulle-markdown to your project:

mulle-sde add github:MulleWeb/mulle-markdown

Install

Install with mulle-sde

Use mulle-sde to build and install mulle-markdown and all dependencies:

mulle-sde install --prefix /usr/local \
   https://github.com//mulle-markdown/archive/latest.tar.gz

Manual Installation

Install the requirements:

Requirements Description
mulle-cosmopolitan
mulle-cosmopolitan-cc πŸŽͺ Cosmopolitan variants of gcc, clang, mulle-clang for mulle-cosmopolitan
mulle-musl 🐚 Build the musl C library for static executables
mulle-musl-cc 🐚 Add -static flag to musl-gcc (and clang)
MulleHoedown πŸ’ƒπŸΌ Markdown support for mulle-objc
MulleObjC-startup ▢️ Startup code for MulleObjC

Download the latest tar or zip archive and unpack it.

Install mulle-markdown into /usr/local with cmake:

cmake -B build \
      -DCMAKE_INSTALL_PREFIX=/usr/local \
      -DCMAKE_PREFIX_PATH=/usr/local \
      -DCMAKE_BUILD_TYPE=Release &&
cmake --build build --config Release &&
cmake --install build --config Release

Platforms and Compilers

All platforms and compilers supported by mulle-c11.

Author

Nat! for Mulle kybernetiK