cabal-version: 3.0
name:          gwernnet
version:       2026.4.1
license:       CC0-1.0
license-file:  LICENSE
author:        Gwern Branwen
maintainer:    Gwern Branwen
build-type:    Simple
synopsis:      Gwern.net build + maintenance tools (internal). See <./build/sync.sh>, <https://gwern.net/design>, <https://gwern.net/style-guide>, and <https://github.com/gwern/gwern.net/>. This does not include the website content.
category:      Web

-- Shared defaults for all components.
common gwern-common
  default-language: Haskell2010

  ghc-options: -Wall

  build-depends:
                base
              , HTTP
              , aeson
              , array
              , async
              , base16-bytestring
              , base64-bytestring
              , binary
              , bytestring
              , conduit
              , containers
              , cryptohash
              , deepseq
              , directory
              , edit-distance
              , filepath
              , filestore
              , global-lock
              , hakyll==4.16.2.0
              , http-conduit==2.3.8
              , http-types
              , monad-parallel
              , mtl
              , network-uri
              , pandoc-types
              , pandoc==3.1.3
              , pretty-show
              , process
              , random
              , regex-base
              , regex-tdfa
              , rp-tree
              , split
              , stm
              , tagsoup
              , temporary
              , text
              , time
              , titlecase
              , tld
              , transformers
              , unix
              , uri-encode
              , utf8-string
              , utility-ht
              , vector
              -- 2026-04-19: warp-3.4.13 compilation fatally crashes on "Network/Wai/Handler/Warp/Run.hs:39:5: error: Module ‘Network.Socket’ does not export ‘waitReadSocketSTM’", so pin below for now
              , warp<3.4.13
common exe-common
  import: gwern-common
  hs-source-dirs: app
  build-depends: gwernnet

library
  import: gwern-common
  ghc-options: -O2
  hs-source-dirs: .
  exposed-modules:
      Annotation
      Annotation.Arxiv
      Annotation.Biorxiv
      Annotation.Gwernnet
      Annotation.OpenReview
      Annotation.PDF
      Blog
      Columns
      Config.GenerateSimilar
      Config.Inflation
      Config.Interwiki
      Config.LinkArchive
      Config.LinkAuto
      Config.LinkID
      Config.LinkIcon
      Config.LinkLive
      Config.LinkSuggester
      Config.Metadata.Author
      Config.Metadata.Format
      Config.Metadata.Title
      Config.Misc
      Config.Paragraph
      Config.Tags
      Config.Typography
      Config.XOfTheDay
      Cycle
      GTX
      GenerateSimilar
      Image
      Inflation
      Interwiki
      LinkArchive
      LinkAuto
      LinkBacklink
      LinkID
      LinkIcon
      LinkLive
      LinkMetadata
      LinkMetadataTypes
      Metadata.Author
      Metadata.Date
      Metadata.Format
      Metadata.Title
      Paragraph
      Query
      Tags
      Test
      Text.Regex
      Typography
      Unique
      Utext
      Utils
      XOfTheDay

executable hakyll
  import: exe-common
  main-is: hakyll.hs
  ghc-options: -threaded -rtsopts

executable preprocess-markdown
  import: exe-common
  main-is: preprocess-markdown.hs

executable generateLinkBibliography
  import: exe-common
  main-is: generateLinkBibliography.hs
  ghc-options: -threaded -rtsopts

executable generateDirectory
  import: exe-common
  main-is: generateDirectory.hs
  ghc-options: -threaded -rtsopts

executable generateBacklinks
  import: exe-common
  main-is: generateBacklinks.hs
  ghc-options: -threaded -rtsopts

executable checkMetadata
  import: exe-common
  main-is: checkMetadata.hs

executable guessTag
  import: exe-common
  main-is: guessTag.hs

executable changeTag
  import: exe-common
  main-is: changeTag.hs
  ghc-options: -threaded -rtsopts

executable generateSimilarLinks
  import: exe-common
  main-is: generateSimilarLinks.hs
