document-build-0.1.0.0: document-build.cabal
cabal-version: 2.4
name: document-build
version: 0.1.0.0
license: BSD-3-Clause
license-file: LICENCE
author: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> <dibblego>
maintainer: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> <dibblego>
copyright: Copyright (c) 2021-2026 Tony Morris
synopsis: Build documents with Haskell
category: Development
description:
<<https://logo.systemf.com.au/systemf-450x450.png>>
.
Build documents with Haskell: convert them between formats, get information
about them, and replace strings in them.
.
== Operations
.
@Document.Build.Operations@ provides the canonical document operations,
every one a @FilePather@ value (from the @filepather@ package) in an effect
that fails with an exit code (from the @exitcode@ package): convert
LibreOffice, markdown, PDF and image files; count pages; split and join PDF
files; hash files; get git details of files; and replace strings in files.
.
== Rules and builds
.
@Document.Build.Rules@ wraps the operations in named, tracked build steps,
which say which files are made from which, each with its settings as
arguments, and @Document.Build.Documents@ runs rules over a project until
they make no more files.
.
The library has no settings of its own: the build file of a project, a
cabal script, gives @build@ the directories of the project and its rules.
homepage: https://gitlab.com/tonymorris/document-build
bug-reports: https://gitlab.com/tonymorris/document-build/issues
build-type: Simple
extra-doc-files: README.md
changelog.md
tested-with: GHC == 9.14.1, GHC == 9.12.4, GHC == 9.10.3, GHC == 9.8.4, GHC == 9.6.7
source-repository head
type: git
location: https://gitlab.com/tonymorris/document-build.git
flag doctest
description: Build the doctest test suite, which runs doctest through cabal. It is enabled in cabal.project, and disabled by default so that builds from the source distribution do not need cabal or doctest at test time.
default: False
manual: True
library
default-language:
Haskell2010
build-depends:
base >= 4.18 && < 5
, aeson >= 2.2.3 && < 2.4
, aeson-pretty >= 0.8.10 && < 0.9
, bytestring >= 0.11.5.4 && < 0.13
, containers >= 0.6.7 && < 0.9
, cryptohash-sha256 >= 0.11.102.1 && < 0.12
, deepseq >= 1.4.8.1 && < 2
, directory >= 1.3.8.5 && < 2
, either-n >= 0.1 && < 0.2
, exitcode >= 0.3.0.1 && < 0.4
, filepath >= 1.4.301.0 && < 1.6
, filepather >= 0.7 && < 0.8
, lens >= 5.2.1 && < 6
, mtl >= 2.3.1 && < 2.4
, natural >= 0.5.0.1 && < 0.6
, process >= 1.6.19.0 && < 2
, temporary >= 1.3 && < 2
, text >= 2.0.2 && < 2.2
, time >= 1.12.2 && < 2
, transformers >= 0.6.1 && < 0.7
ghc-options:
-Wall
-Wcompat
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wredundant-constraints
hs-source-dirs:
src
exposed-modules:
Document.Build
Document.Build.Build
Document.Build.Context
Document.Build.Documents
Document.Build.Error
Document.Build.File
Document.Build.Git
Document.Build.Hash
Document.Build.Image
Document.Build.LibreOffice
Document.Build.Operations
Document.Build.Output
Document.Build.Pandoc
Document.Build.Pdf
Document.Build.Project
Document.Build.Replace
Document.Build.Rules
-- The build file, build.hs, which is a cabal script that each document project
-- runs. Building it here checks that it compiles.
executable document-build
main-is:
build.hs
default-language:
Haskell2010
build-depends:
base >= 4.18 && < 5
, document-build
, filepath >= 1.4.301.0 && < 1.6
, mtl >= 2.3.1 && < 2.4
ghc-options:
-Wall
-Wcompat
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wredundant-constraints
hs-source-dirs:
.
test-suite hedgehog
type:
exitcode-stdio-1.0
main-is:
hedgehog_tests.hs
other-modules:
BuildTests
Gens
Laws
OutputTests
default-language:
Haskell2010
build-depends:
base >= 4.18 && < 5
, aeson >= 2.2.3 && < 2.4
, bytestring >= 0.11.5.4 && < 0.13
, containers >= 0.6.7 && < 0.9
, document-build
, hedgehog >= 1.2 && < 2
, lens >= 5.2.1 && < 6
, text >= 2.0.2 && < 2.2
, time >= 1.12.2 && < 2
ghc-options:
-Wall
-threaded
hs-source-dirs:
test
test-suite doctest
type:
exitcode-stdio-1.0
if !flag(doctest)
buildable: False
main-is:
doctest_tests.hs
default-language:
Haskell2010
build-depends:
base >= 4.18 && < 5
, process >= 1.6.19.0 && < 2
, document-build
ghc-options:
-Wall
-threaded
hs-source-dirs:
test
benchmark bench
type:
exitcode-stdio-1.0
main-is:
Main.hs
default-language:
Haskell2010
build-depends:
base >= 4.18 && < 5
, bytestring >= 0.11.5.4 && < 0.13
, criterion >= 1.6.2.0 && < 2
, filepather
, lens >= 5.2.1 && < 6
, mtl >= 2.3.1 && < 2.4
, text >= 2.0.2 && < 2.2
, document-build
ghc-options:
-Wall
-O2
hs-source-dirs:
bench