packages feed

pandoc-placetable 0.4.2 → 0.5

raw patch · 4 files changed

+24/−20 lines, 4 filesdep +textdep ~aesondep ~basedep ~explicit-exception

Dependencies added: text

Dependency ranges changed: aeson, base, explicit-exception, pandoc, spreadsheet

Files

README.md view
@@ -30,6 +30,14 @@          caption="my **caption**" delimiter="," quotechar="\"" }     ``` ++## Usage++Prepare a markdown file containing a fenced code block like the ones above, then:++    pandoc --filter pandoc-placetable input.md++ Alternatively, the program can be used as an ad-hoc csv-reader and run without a markdown file. Then the options can be provided as command-line arguments. For example: @@ -85,11 +93,6 @@     cd pandoc-placetable     stack install --flag pandoc-placetable:inlineMarkdown pandoc-placetable -## Usage--Prepare a markdown file containing a fenced code block like the ones above, then:--    pandoc --filter pandoc-placetable input.md  ## Acknowledgments 
pandoc-placetable.cabal view
@@ -1,5 +1,5 @@ Name:                 pandoc-placetable-Version:              0.4.2+Version:              0.5 Build-Type:           Simple Synopsis:             Pandoc filter to include CSV files Description:          A Pandoc filter that replaces code blocks (that have the class `table`)@@ -23,21 +23,23 @@  Flag inlineMarkdown   Default: False+  Manual:  True   Description:        Require entire Pandoc as a dependency so it can be used to compile                       inline markdown in the CSV and caption if desired.  Executable pandoc-placetable   Main-Is:            pandoc-placetable.hs-  Build-Depends:      aeson >= 0.7 && < 1.1,-                      base >=4.2 && < 5,+  Build-Depends:      aeson >= 0.7,+                      base >= 4.7 && < 5,                       bytestring >= 0.10,+                      text >= 1.2,                       utf8-string >= 1.0,                       http-conduit >= 2.1.11,-                      spreadsheet >= 0.1.3 && < 0.1.4,-                      explicit-exception == 0.1.*,+                      spreadsheet >= 0.1.3,+                      explicit-exception >= 0.1.0,                       pandoc-types >= 1.12.0.0   If flag(inlineMarkdown)-    Build-Depends:    pandoc >= 1.14.0.0+    Build-Depends:    pandoc >= 2.1     cpp-options:      -DINLINE_MARKDOWN   Buildable:          True   Default-Language:   Haskell2010
pandoc-placetable.hs view
@@ -11,6 +11,7 @@ import Data.Monoid (mempty) import Data.Char (toUpper) import Data.List (isSuffixOf)+import qualified Data.Text as T import Data.Version (showVersion) import Network.HTTP.Conduit import Paths_pandoc_placetable (version)@@ -30,6 +31,7 @@                            , divWith )  #if defined(INLINE_MARKDOWN)+import Text.Pandoc.Class (runPure) import Text.Pandoc.Readers.Markdown import Text.Pandoc.Options #endif@@ -131,11 +133,11 @@     , Option "v" ["version"]         (NoArg           (\_ -> do-            #if defined(INLINE_MARKDOWN)+#if defined(INLINE_MARKDOWN)             let withInlineMarkdown = "with"-            #else+#else             let withInlineMarkdown = "without"-            #endif+#endif             hPutStrLn stderr $ unlines [                 "pandoc-placetable " ++ showVersion version               , "Compiled " ++ withInlineMarkdown ++ " the inlineMarkdown flag."@@ -240,7 +242,7 @@            let s' = "# " ++ (concat $ lines s)                extractIns (Header _ _ ins) = ins                extractIns _ = []-           in  case readMarkdown def s' of+           in  case runPure (readMarkdown def $ T.pack s') of                  Right (Pandoc _ bs) -> fromList $ extractIns $ head bs                  Left e -> str $ show e          else@@ -251,7 +253,7 @@     strToBlocks s =       if optInlineMarkdown opts          then-           case readMarkdown def s of+           case runPure (readMarkdown def $ T.pack s) of              Right (Pandoc _ bs) -> fromList bs              Left e -> plain $ str $ show e          else
stack.yaml view
@@ -1,10 +1,7 @@-resolver: lts-7.8+resolver: lts-11.7  packages: - '.'--extra-deps:-  - spreadsheet-0.1.3.4  flags: {}