lima: (Haskell or Literate Haskell) <-> Markdown converter

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

See the README.md


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.0.5, 0.1.0.6, 0.2.0.0, 0.2.1.0, 0.2.1.1, 0.2.1.2, 0.2.1.3, 0.3.0.0
Change log CHANGELOG.md
Dependencies aeson, base (>=4 && <5), data-default, lima, optparse-applicative, yaml [details]
License MIT
Author Fabian Schneider
Maintainer Danila Danko
Category Productivity
Bug tracker https://github.com/deemp/flakes/issues
Source repo head: git clone https://github.com/deemp/flakes
Uploaded by deemp at 2023-02-19T21:35:45Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for lima-0.1.0.5

[back to package description]

lima

Convert between

It is usually possible to make conversion abide the roundtrip property. In other words, make conversions file.lhs -> file.lhs.md -> file.lhs.md.lhs or file.hs -> file.hs.md -> file.hs.md.hs and get file.lhs = file.lhs.md.lhs and file.hs = file.hs.md.hs in terms of their contents.

Demo

demo

Alternatives

Conversion

.hs -> .md

Examples

  1. hs -> hs.md -> hs.md.hs

Rules

.lhs -> .md

Examples

  1. hs -> hs.md -> hs.md.hs
  2. hs -> hs.md -> hs.md.hs

Rules

Command-line tool

From Hackage

  1. Install via cabal

    cabal update
    cabal install lima
    

From sources

  1. Clone this repo and install lima.

    git clone https://github.com/deemp/flakes
    cd flakes/lima
    cabal update
    cabal install .
    

Nix

  1. Install Nix

  2. Get lima on PATH.

    nix flake lock github:deemp/flakes?dir=lima
    nix shell github:deemp/flakes?dir=lima
    lima --help
    

Windows

Warning: took it from LiterateMarkdown.

To install the executable on Windows, if you can't convince cabal to use --bindir-method=copy you can build the project locally and copy the built executable to C:/Users/username/AppData/Roaming/cabal/bin and ensure that this directory is in your PATH.

build-tool-depends

You can use lima to generate your docs, e.g., via cabal test docs. Just provide such a test with a script that converts (and, possibly, combines) files. As you'll use lima in a script, you should add it to that test's build-tool-depends:

build-tool-depends:
    lima:lima ==0.1.*

Nix flake

  1. Add lima to inputs:
inputs.lima.url = "github:deemp/flakes?dir=lima";
  1. Add lima to the override of your package
override = {
  overrides = self: super: {
    myPackage = overrideCabal
      (super.callCabal2nix myPackageName ./. { })
      (x: {
        testHaskellDepends = [
          (super.callCabal2nix "lima" "${lima.outPath}/lima" { })
        ] ++ (x.testHaskellDepends or [ ]);
      });
  };
};
  1. Use cabal v1-test so that cabal uses the supplied lima.

Contribute

Clone this repo and enter lima

git clone https://github.com/deemp/flakes
cd flakes/lima

cabal

Build as usually

cabal update
cabal build

nix

  1. Install Nix.

  2. Run a devshell and build lima:

    nix develop nix-dev/
    cabal build
    
  3. Optionally, start VSCodium:

    nix run nix-dev/#writeSettings
    nix run nix-dev/#codium .
    
  4. Open a Haskell file there, hover over a term and wait until HLS shows hints.

  5. Troubleshoot if necessary.