diff --git a/README.md b/README.md index 860c985..4a060bf 100644 --- a/README.md +++ b/README.md @@ -19,32 +19,8 @@ The tool can be used with the following GHC versions: Pick the one that matches your operating system *and* GHC version. -## Usage +## 🤸 Documentation -Go in your project and build it with the GHC environment files enabled: +Read the [Manual](./doc/MANUAL.md) to learn how to use this tool -``` -$ cabal build --write-ghc-environment-files=always -``` - -Then run the `print-api` binary from within the same directory: - -``` -$ print-api -p -``` - -For instance in the [`text-display`](https://github.com/haskell-text/text-display) repository: - -```haskell -❯ print-api -p text-display - -module Data.Text.Display where - type Display :: * -> Constraint - class Display a where - displayBuilder :: a -> Data.Text.Internal.Builder.Builder - displayList :: [a] -> Data.Text.Internal.Builder.Builder - displayPrec :: GHC.Types.Int -> a -> Data.Text.Internal.Builder.Builder - {-# MINIMAL displayBuilder | displayPrec #-} - {-# MINIMAL displayBuilder | displayPrec #-} - type role OpaqueInstance phantom representational -``` +Additional details can be found in the [Architecture document](./doc/ARCHITECTURE.md) diff --git a/doc/ARCHITECTURE.md b/doc/ARCHITECTURE.md new file mode 100644 index 0000000..012b5b7 --- /dev/null +++ b/doc/ARCHITECTURE.md @@ -0,0 +1,7 @@ +# Architecture + +## The GHC API + +### Compatibility over several versions + +### The package database diff --git a/doc/MANUAL.md b/doc/MANUAL.md new file mode 100644 index 0000000..b7ef58b --- /dev/null +++ b/doc/MANUAL.md @@ -0,0 +1,52 @@ +## NAME + +print-api – Export the public API of your Haskell package + +## SYNOPSIS + +
+
print-api (-p|--package-name PACKAGE NAME)
+
Export the API of a package
+
+ +## DESCRIPTION + +*print-api* exports the API exposed by a Haskell package. This is used to maintain a file that can be tracked by version control and used in Golden Tests. + +## OPTIONS + +### -p|--package-name PACKAGE NAME + +_Mandatory_ + +Specify for which package you wish to have the API export. + +## Usage + +Go in your project and build it with the GHC environment files enabled: + +``` +$ cabal build --write-ghc-environment-files=always +``` + +Then run the `print-api` binary from within the same directory: + +``` +$ print-api -p +``` + +For instance in the [`text-display`](https://github.com/haskell-text/text-display) repository: + +```haskell +❯ print-api -p text-display + +module Data.Text.Display where + type Display :: * -> Constraint + class Display a where + displayBuilder :: a -> Data.Text.Internal.Builder.Builder + displayList :: [a] -> Data.Text.Internal.Builder.Builder + displayPrec :: GHC.Types.Int -> a -> Data.Text.Internal.Builder.Builder + {-# MINIMAL displayBuilder | displayPrec #-} + {-# MINIMAL displayBuilder | displayPrec #-} + type role OpaqueInstance phantom representational +```