/lucid-from-html

Generate Lucid code from html page

Primary LanguageHaskellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

This repository hosts the code to the lucid-from-html tool, derived from @dbaynard.

Please report any issues (including examples of html files that don’t parse correctly) at the issue tracker.

Install using cabal

  1. Clone the repository.

  2. Install hpack tool unless it's already installed.

    > cabal install hpack
    
  3. Change to the directory of the repository.

  4. Run

    > hpack
    > cabal install
    

Usage

To convert filename.html to lucid text, run

> lucid-from-html -t -s filename.html > filename.hs

The options here:

  • -t   do not trim whitespace characters from the ends of the strings
  • -s   create a standalone code, ready to compile

To see all options, run

> lucid-from-html --help

If you successfully got filename.hs you can generate html back again by

> runhaskell filename.hs > filename-out.html