Home

Awesome

Hiccup-cli

Command line tool / Emacs (and Vim) plugin to convert HTML to Hiccup syntax.

Installation

Install hiccup-cli

Download hiccup-cli from the releases page.

Emacs

The Emacs package can be installed through melpa:

M-x package-install hiccup-cli

Usage

Function
hiccup-cli-paste-as-hiccup
hiccup-cli-region-as-hiccup
hiccup-cli-yank-as-hiccup

Use hiccup-cli-region-as-hiccup to transform the selected HTML to Hiccup syntax

hiccup region replace

Use hiccup-cli-yank-as-hiccup or hiccup-cli-paste-as-hiccup to paste HTML as Hiccup from either your kill-ring or clipboard

hiccup yank

Vim integration

Installation and configuration

  1. Download the hiccup-cli binary from here.
  2. Add hiccup-cli to your $PATH
  3. Because the hiccup-cli does not support reading from stdin, we need to configure it with a bash script called html2hiccup.
#!/usr/bin/env bash

middle="$(mktemp)"
while IFS= read -r line; do
    echo "$line" >> "$middle"
done

hiccup-cli --html-file "$middle"
  1. Add html2hiccup to your $PATH

vim reference with external command

Vim Screenshots

before after

Development

Building hiccup-cli

Make sure you have GraalVM installed.

git clone git@github.com:kwrooije/hiccup-cli
cd hiccup-cli
lein native-image
sudo cp target/hiccup-cli-0.1.0-SNAPSHOT /usr/local/bin/hiccup-cli

Author / License

Released under the MIT License by Kevin William van Rooijen.