document-build-0.2.0.0: document-build.cabal
cabal-version: 2.4
name: document-build
version: 0.2.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
, exitcode >= 0.3.0.1 && < 0.4
, filepath >= 1.4.301.0 && < 1.6
, filepather >= 0.8 && < 0.9
, lens >= 5.2.1 && < 6
, mtl >= 2.3.1 && < 2.4
, natural >= 0.5.0.1 && < 0.6
, process >= 1.6.19.0 && < 2
, tagged >= 0.8.7 && < 0.9
, 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-uni-patterns
-Werror=incomplete-patterns
hs-source-dirs:
src
exposed-modules:
Document.Build
Document.Build.Build
Document.Build.CommandLine
Document.Build.Context
Document.Build.Directories
Document.Build.Documents
Document.Build.Error
Document.Build.Error.FileTypeUnsupported
Document.Build.Error.InputFilesTooFew
Document.Build.Error.OutputFileMissing
Document.Build.Error.OutputNotInDirectory
Document.Build.Error.ProcessFailed
Document.Build.Error.ProcessOutputUnrecognised
Document.Build.Error.StringsMissing
Document.Build.File
Document.Build.Git
Document.Build.GitDetails
Document.Build.Hash
Document.Build.Image
Document.Build.ImageInfo
Document.Build.LibreOffice
Document.Build.Name.CommandLineArguments
Document.Build.Name.CommandLineProgram
Document.Build.Name.ContextProject
Document.Build.Name.Directory
Document.Build.Name.ExpectedOutput
Document.Build.Name.FileNotInGit
Document.Build.Name.FileNotUtf8
Document.Build.Name.FontsDirectory
Document.Build.Name.GitAuthorEmail
Document.Build.Name.GitAuthorName
Document.Build.Name.GitAuthorTime
Document.Build.Name.GitAuthors
Document.Build.Name.GitCommitHash
Document.Build.Name.GitCommitHashShort
Document.Build.Name.GitCommitTime
Document.Build.Name.GitCommitterEmail
Document.Build.Name.GitCommitterName
Document.Build.Name.GitSubject
Document.Build.Name.ImageColourspace
Document.Build.Name.ImageDepth
Document.Build.Name.ImageFormat
Document.Build.Name.ImageFrames
Document.Build.Name.ImageHeight
Document.Build.Name.ImageResolutionUnits
Document.Build.Name.ImageResolutionX
Document.Build.Name.ImageResolutionY
Document.Build.Name.ImageWidth
Document.Build.Name.InputDirectories
Document.Build.Name.InputFileCount
Document.Build.Name.InputFileMissing
Document.Build.Name.InputFilesNeeded
Document.Build.Name.MissingStrings
Document.Build.Name.OutputDirectory
Document.Build.Name.OutputGitDetails
Document.Build.Name.OutputImageInfo
Document.Build.Name.OutputPages
Document.Build.Name.OutputPath
Document.Build.Name.OutputSha256
Document.Build.Name.ShallowRepository
Document.Build.Name.StandardError
Document.Build.Name.StandardOutput
Document.Build.Name.SupportedExtensions
Document.Build.Name.TargetComplete
Document.Build.Name.TargetDirectory
Document.Build.Name.TargetFile
Document.Build.Operations
Document.Build.Output
Document.Build.OutputFile
Document.Build.Pandoc
Document.Build.Pdf
Document.Build.Project
Document.Build.Replace
Document.Build.Rules
Document.Build.Target
-- 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-uni-patterns
-Werror=incomplete-patterns
hs-source-dirs:
.
test-suite hedgehog
type:
exitcode-stdio-1.0
main-is:
hedgehog_tests.hs
other-modules:
BuildTests
Gens
Laws
OpticsTests
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
, hedgehog-fn >= 1.1 && < 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