Started types module
Getty Ritter
9 years ago
1 | Copyright (c) 2015, Getty Ritter | |
2 | ||
3 | All rights reserved. | |
4 | ||
5 | Redistribution and use in source and binary forms, with or without | |
6 | modification, are permitted provided that the following conditions are met: | |
7 | ||
8 | * Redistributions of source code must retain the above copyright | |
9 | notice, this list of conditions and the following disclaimer. | |
10 | ||
11 | * Redistributions in binary form must reproduce the above | |
12 | copyright notice, this list of conditions and the following | |
13 | disclaimer in the documentation and/or other materials provided | |
14 | with the distribution. | |
15 | ||
16 | * Neither the name of Getty Ritter nor the names of other | |
17 | contributors may be used to endorse or promote products derived | |
18 | from this software without specific prior written permission. | |
19 | ||
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
1 | # pandoc-fountain | |
2 | ||
3 | TODO: Write description here | |
4 | ||
5 | ## Installation | |
6 | ||
7 | TODO: Write installation instructions here | |
8 | ||
9 | ## Usage | |
10 | ||
11 | TODO: Write usage instructions here | |
12 | ||
13 | ## How to run tests | |
14 | ||
15 | ``` | |
16 | cabal configure --enable-tests && cabal build && cabal test | |
17 | ``` | |
18 | ||
19 | ## Contributing | |
20 | ||
21 | TODO: Write contribution instructions here |
1 | module Text.Pandoc.Fountain.Types where | |
2 | ||
3 | import qualified Text.Pandoc.Definition as Pandoc (Block) | |
4 | ||
5 | data FtDoc = FtDoc | |
6 | { ftTitle :: Maybe FtTitle | |
7 | , ftContent :: [FtElement] | |
8 | } deriving (Eq, Show) | |
9 | ||
10 | data FtTitle = FtTitle { unFtTitle :: Map String FtText } | |
11 | deriving (Eq, Show) | |
12 | ||
13 | type FtSceneNumber = Int | |
14 | ||
15 | type FtText = [FtInline] | |
16 | ||
17 | data FtInline | |
18 | = FtStr String | |
19 | | FtEmph FtText | |
20 | | FtStrong FtText | |
21 | | FtUnderline FtText | |
22 | deriving (Eq, Show) | |
23 | ||
24 | data FtElement | |
25 | = FtSceneHeading FtText FtSceneNumber | |
26 | | FtDialogue FtDialogueElement | |
27 | | FtTransition FtText | |
28 | | FtLyric FtText | |
29 | | FtAction FtText Bool | |
30 | deriving (Eq, Show) | |
31 | ||
32 | data FtDialogueElement = FtDialogueElement | |
33 | { ftCharacter :: FtText | |
34 | , ftParenthetical :: Maybe FtText | |
35 | , ftDialogue :: FtText | |
36 | , ftConcurrent :: Maybe FtDialogueElement | |
37 | } deriving (Eq, Show) | |
38 | ||
39 | data FromFountain = FromFountain | |
40 | { fromScene :: FtText -> FtSceneNumber -> [Pandoc.Block] | |
41 | , fromDialogue :: FtDialogueText -> [Pandoc.Block] | |
42 | , fromLyric :: FtText -> [Pandoc.Block] | |
43 | , fromTransition :: FtText -> [Pandoc.Block] | |
44 | , fromAction :: FtInline -> [Pandoc.Block] | |
45 | } deriving (Eq, Show) |
1 | name: pandoc-fountain | |
2 | version: 0.0.0 | |
3 | author: Getty Ritter <gdritter@galois.com> | |
4 | maintainer: Getty Ritter <gdritter@galois.com> | |
5 | license: BSD3 | |
6 | license-file: LICENSE | |
7 | -- Synopsis: | |
8 | -- Description: | |
9 | cabal-version: >= 1.10 | |
10 | build-type: Simple | |
11 | extra-source-files: README.md, ChangeLog.md | |
12 | ||
13 | library | |
14 | default-language: Haskell2010 | |
15 | hs-source-dirs: src | |
16 | ghc-options: -Wall | |
17 | exposed-modules: Text.Pandoc.Fountain | |
18 | other-modules: Text.Pandoc.Fountain.Types | |
19 | build-depends: base >= 4 && < 5, pandoc | |
20 | ||
21 | source-repository head | |
22 | type: git | |
23 | -- Location: |