diff options
| author | John MacFarlane <[email protected]> | 2022-09-09 09:27:41 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-09-22 09:21:24 -0700 |
| commit | 0e5232f2dcd119c62f0c81cc8043417b8984a84e (patch) | |
| tree | d9aa17acc41811a9664815766c72e0f5bf7d239b | |
| parent | b38292c2346ebea690eada91a5ac1e0addaa3c0b (diff) | |
Split pandoc-server, pandoc-cli into separate packages.split-packages
This also removes the unnecessary Setup.hs from pandoc.
Cabal does not need this with build-type 'simple'.
| -rw-r--r-- | Setup.hs | 2 | ||||
| -rw-r--r-- | cabal.project | 4 | ||||
| l--------- | pandoc-cli/COPYING.md | 1 | ||||
| -rw-r--r-- | pandoc-cli/README.md | 12 | ||||
| -rw-r--r-- | pandoc-cli/pandoc-cli.cabal | 62 | ||||
| -rw-r--r-- | pandoc-cli/src/pandoc.hs (renamed from app/pandoc.hs) | 0 | ||||
| l--------- | pandoc-server/COPYING.md | 1 | ||||
| -rw-r--r-- | pandoc-server/README.md | 26 | ||||
| -rw-r--r-- | pandoc-server/pandoc-server.cabal | 71 | ||||
| -rw-r--r-- | pandoc-server/src/Text/Pandoc/Server.hs (renamed from src/Text/Pandoc/Server.hs) | 2 | ||||
| -rw-r--r-- | pandoc.cabal | 16 |
11 files changed, 178 insertions, 19 deletions
diff --git a/Setup.hs b/Setup.hs deleted file mode 100644 index 9a994af67..000000000 --- a/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/cabal.project b/cabal.project index ef2abf7fe..34b47701c 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,6 @@ -packages: pandoc.cabal +packages: . + pandoc-server + pandoc-cli tests: True flags: +embed_data_files constraints: aeson >= 2.0.1.0 diff --git a/pandoc-cli/COPYING.md b/pandoc-cli/COPYING.md new file mode 120000 index 000000000..0c9476f2b --- /dev/null +++ b/pandoc-cli/COPYING.md @@ -0,0 +1 @@ +../COPYING.md
\ No newline at end of file diff --git a/pandoc-cli/README.md b/pandoc-cli/README.md new file mode 100644 index 000000000..9589fce45 --- /dev/null +++ b/pandoc-cli/README.md @@ -0,0 +1,12 @@ +# pandoc-cli + +This package provides the command-line document-conversion program `pandoc`. +There is not much to this package; all of the work is done by +the libraries `pandoc` and `pandoc-server`. + +## License + +© 2006-2022 John MacFarlane ([email protected]). Released under the +[GPL](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html "GNU General Public License"), +version 2 or greater. This software carries no warranty of any kind. +(See COPYRIGHT for full copyright and warranty notices.) diff --git a/pandoc-cli/pandoc-cli.cabal b/pandoc-cli/pandoc-cli.cabal new file mode 100644 index 000000000..e89d05c78 --- /dev/null +++ b/pandoc-cli/pandoc-cli.cabal @@ -0,0 +1,62 @@ +cabal-version: 2.4 +name: pandoc-cli +version: 0.1 +build-type: Simple +license: GPL-2.0-or-later +license-file: COPYING.md +copyright: (c) 2006-2022 John MacFarlane +author: John MacFarlane <[email protected]> +maintainer: John MacFarlane <[email protected]> +bug-reports: https://github.com/jgm/pandoc/issues +stability: alpha +homepage: https://pandoc.org +category: Text +tested-with: GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, + GHC == 9.2.3 +synopsis: Conversion between documentation formats +description: Pandoc-cli provides a command-line executable that uses the pandoc library to convert between markup formats. +-- data-files: +-- extra-source-files: +source-repository head + type: git + location: git://github.com/jgm/pandoc.git + +common common-options + default-language: Haskell2010 + build-depends: base >= 4.12 && < 5 + ghc-options: -Wall -fno-warn-unused-do-bind + -Wincomplete-record-updates + -Wnoncanonical-monad-instances + -Wcpp-undef + -Wincomplete-uni-patterns + -Widentities + -Wpartial-fields + -Wmissing-signatures + -fhide-source-paths + -- -Wmissing-export-lists + + if impl(ghc >= 8.10) + ghc-options: -Wunused-packages + + if impl(ghc >= 9.0) + ghc-options: -Winvalid-haddock + + if os(windows) + cpp-options: -D_WINDOWS + +common common-executable + import: common-options + build-depends: pandoc + ghc-options: -rtsopts -with-rtsopts=-A8m -threaded + +executable pandoc + import: common-executable + hs-source-dirs: src + main-is: pandoc.hs + buildable: True + build-depends: pandoc == 2.19.2, + pandoc-server >= 0.1 && < 0.2, + wai-extra >= 3.0.24, + warp, + safe + diff --git a/app/pandoc.hs b/pandoc-cli/src/pandoc.hs index 305fc405e..305fc405e 100644 --- a/app/pandoc.hs +++ b/pandoc-cli/src/pandoc.hs diff --git a/pandoc-server/COPYING.md b/pandoc-server/COPYING.md new file mode 120000 index 000000000..0c9476f2b --- /dev/null +++ b/pandoc-server/COPYING.md @@ -0,0 +1 @@ +../COPYING.md
\ No newline at end of file diff --git a/pandoc-server/README.md b/pandoc-server/README.md new file mode 100644 index 000000000..346b3461a --- /dev/null +++ b/pandoc-server/README.md @@ -0,0 +1,26 @@ +# pandoc-server + +`pandoc-server` is a Haskell library providing access to +pandoc's document conversions as an HTTP server. + +For a description of the API, see +[pandoc-server.md](https://github.com/jgm/pandoc/blob/master/doc/pandoc-server.md) +in the pandoc source repository. + +Example of use: + +``` hs +module Main where +import Text.Pandoc.Server (app) +import qualified Network.Wai.Handler.Warp as Warp + +main :: IO () +main = Warp.run 3000 app +``` + +## License + +© 2006-2022 John MacFarlane ([email protected]). Released under the +[GPL](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html "GNU General Public License"), +version 2 or greater. This software carries no warranty of any kind. +(See COPYRIGHT for full copyright and warranty notices.) diff --git a/pandoc-server/pandoc-server.cabal b/pandoc-server/pandoc-server.cabal new file mode 100644 index 000000000..2c0f566c8 --- /dev/null +++ b/pandoc-server/pandoc-server.cabal @@ -0,0 +1,71 @@ +cabal-version: 2.4 +name: pandoc-server +version: 0.1 +build-type: Simple +license: GPL-2.0-or-later +license-file: COPYING.md +copyright: (c) 2006-2022 John MacFarlane +author: John MacFarlane <[email protected]> +maintainer: John MacFarlane <[email protected]> +bug-reports: https://github.com/jgm/pandoc/issues +stability: alpha +homepage: https://pandoc.org +category: Text +tested-with: GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, + GHC == 9.2.3 +synopsis: Pandoc document conversion as an HTTP servant-server +description: Pandoc-server provides pandoc's document conversion functions + in an HTTP server. +source-repository head + type: git + location: git://github.com/jgm/pandoc.git + +common common-options + default-language: Haskell2010 + build-depends: base >= 4.12 && < 5 + ghc-options: -Wall -fno-warn-unused-do-bind + -Wincomplete-record-updates + -Wnoncanonical-monad-instances + -Wcpp-undef + -Wincomplete-uni-patterns + -Widentities + -Wpartial-fields + -Wmissing-signatures + -fhide-source-paths + -- -Wmissing-export-lists + + if impl(ghc >= 8.10) + ghc-options: -Wunused-packages + + if impl(ghc >= 9.0) + ghc-options: -Winvalid-haddock + + if os(windows) + cpp-options: -D_WINDOWS + +common common-executable + import: common-options + build-depends: pandoc + ghc-options: -rtsopts -with-rtsopts=-A8m -threaded + +library + import: common-options + build-depends: pandoc == 2.19.2, + pandoc-types >= 1.22.2 && < 1.23, + containers >= 0.6.0.1 && < 0.7, + aeson >= 2.0 && < 2.2, + bytestring >= 0.9 && < 0.12, + base64 >= 0.4 && < 0.5, + doctemplates >= 0.10 && < 0.11, + data-default >= 0.4 && < 0.8, + text >= 1.1.1.0 && < 2.1, + unicode-collation >= 0.1.1 && < 0.2, + servant-server >= 0.19 && < 0.20, + skylighting >= 0.13 && < 0.14, + wai >= 0.3 + + hs-source-dirs: src + + exposed-modules: Text.Pandoc.Server + buildable: True + diff --git a/src/Text/Pandoc/Server.hs b/pandoc-server/src/Text/Pandoc/Server.hs index 43e8c73c1..04dffb12a 100644 --- a/src/Text/Pandoc/Server.hs +++ b/pandoc-server/src/Text/Pandoc/Server.hs @@ -42,7 +42,7 @@ import System.Environment (getArgs, getProgName) import qualified Control.Exception as E import Text.Pandoc.Shared (safeStrRead, headerShift, filterIpynbOutput, eastAsianLineBreakFilter, stripEmptyParagraphs) -import Text.Pandoc.App.Opt ( IpynbOutput (..), Opt(..), defaultOpts ) +import Text.Pandoc.App ( IpynbOutput (..), Opt(..), defaultOpts ) import Text.Pandoc.Builder (setMeta) import Text.Pandoc.SelfContained (makeSelfContained) import System.Exit diff --git a/pandoc.cabal b/pandoc.cabal index f3211a8a7..b279f7ef3 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -15,8 +15,7 @@ tested-with: GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.3 synopsis: Conversion between markup formats description: Pandoc is a Haskell library for converting from one markup - format to another, and a command-line tool that uses - this library. The formats it can handle include + format to another. The formats it can handle include . - light markup formats (many variants of Markdown, reStructuredText, AsciiDoc, Org-mode, Muse, Textile, @@ -535,8 +534,6 @@ library yaml >= 0.11 && < 0.12, zip-archive >= 0.2.3.4 && < 0.5, zlib >= 0.5 && < 0.7, - servant-server >= 0.19 && < 0.20, - wai >= 0.3 if !os(windows) build-depends: unix >= 2.4 && < 2.9 @@ -563,7 +560,6 @@ library Text.Pandoc.MediaBag, Text.Pandoc.Error, Text.Pandoc.Filter, - Text.Pandoc.Server, Text.Pandoc.Readers, Text.Pandoc.Readers.HTML, Text.Pandoc.Readers.LaTeX, @@ -785,16 +781,6 @@ library autogen-modules: Paths_pandoc buildable: True -executable pandoc - import: common-executable - hs-source-dirs: app - main-is: pandoc.hs - buildable: True - other-modules: Paths_pandoc - build-depends: wai-extra >= 3.0.24, - warp, - safe - test-suite test-pandoc import: common-executable type: exitcode-stdio-1.0 |
