packages feed

hakyll-diagrams-0.1.0.2: hakyll-diagrams.cabal

cabal-version:      3.0
name:               hakyll-diagrams
version:            0.1.0.2

synopsis: A Hakyll plugin for rendering diagrams figures from embedded Haskell code.

description: Compiles any Haskell [diagrams](https://diagrams.github.io/) code embedded in
  input source files (Markdown, reStructuredText, etc.), replacing them with the rendered
  diagrams figures in the generated HTML output. The diagrams figures can be inlined as
  SVG code or referenced as external @.svg@ image files using @\<img>@ tags.

  For example, when processing a Markdown input source file, a code block like this:

  @
  ``` diagram { svg:width=300 }
  let
    target = mconcat
      [ circle 1 # lw 0 # fc red
      , circle 2 # lw 0 # fc white
      , circle 3 # lw 0 # fc red
      ]

    background = roundedRect 8 8 0.1
      # lw 0
      # fc (sRGB24read "#808080")
      # opacity 0.15

  in target <> background
  ```
  @

  will be replaced in the resulting HTML page by this figure:

  <<docs/docs-data/target.svg>>

  A thoughtful documentation with usage examples and results can be found at the [project
  repository](https://github.com/renatoGarcia/hakyll-diagrams).


homepage:           https://github.com/renatoGarcia/hakyll-diagrams

license:            BSD-3-Clause
license-file:       LICENSE
author:             Renato Garcia
maintainer:         fgarcia.renato@gmail.com

category:           Web
build-type:         Simple

extra-doc-files:    docs-data/target.svg

tested-with: GHC == { 9.4.8, 9.12.2 }

extra-source-files:
  test/data/external.html
  test/data/external.md
  test/data/external_bare.html
  test/data/external_bare.md
  test/data/external_figure.html
  test/data/external_figure.md
  test/data/external_figure_bare.html
  test/data/external_figure_bare.md
  test/data/global_import.html
  test/data/global_import.md
  test/data/inline.html
  test/data/inline.md
  test/data/inline_bare.html
  test/data/inline_bare.md
  test/data/inline_figure.html
  test/data/inline_figure.md
  test/data/inline_figure_bare.html
  test/data/inline_figure_bare.md
  test/data/metadata.md
  test/data/no_attributes.svg
  test/data/with_attributes.svg

source-repository head
  type:     git
  location: https://github.com/renatoGarcia/hakyll-diagrams.git

common warnings
  ghc-options: -Wall

common common-deps
  build-depends:
      base >=4.17.2 && <4.22,
      hakyll ^>=4.16.2,
      text >=2.0.2 && <2.2,
      pandoc-types ^>=1.23

library
  import:           warnings, common-deps
  exposed-modules:  Hakyll.Web.Pandoc.Diagrams
  build-depends:
      base16-bytestring ^>=1.0.2,
      cryptohash-sha1 ^>=0.11.101,
      data-default >=0.7.1 && <0.9,
      diagrams ^>=1.4.1,
      diagrams-core ^>=1.5.1,
      diagrams-lib >=1.4.6 && <1.6,
      diagrams-svg >=1.4.3 && <1.6,
      hint ^>=0.9.0,
      split ^>=0.2.3,
      svg-builder ^>=0.1.1

  hs-source-dirs:   src
  default-language: Haskell2010


test-suite hakyll-diagrams-test
  import:           warnings, common-deps
  default-language: Haskell2010
  other-modules:
      Util
    , HTMLSVGCompare
  type:             exitcode-stdio-1.0
  hs-source-dirs:   test
  main-is:          Main.hs
  build-depends:
      hspec
    , HUnit
    , tagsoup
    , containers
    , hakyll-diagrams