pandoc-crossref 0.3.8.3 → 0.3.8.4
raw patch · 9 files changed
+96/−12 lines, 9 filesdep ~optparse-applicativePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: optparse-applicative
API changes (from Hackage documentation)
- Text.Pandoc.CrossRef: autoEqnLabels :: forall a_aBG4. ToMetaValue a_aBG4 => a_aBG4 -> Meta
+ Text.Pandoc.CrossRef: autoEqnLabels :: forall a_asHm. ToMetaValue a_asHm => a_asHm -> Meta
- Text.Pandoc.CrossRef: autoSectionLabels :: forall a_aBFv. ToMetaValue a_aBFv => a_aBFv -> Meta
+ Text.Pandoc.CrossRef: autoSectionLabels :: forall a_asGN. ToMetaValue a_asGN => a_asGN -> Meta
- Text.Pandoc.CrossRef: ccsDelim :: forall a_aBG1. ToMetaValue a_aBG1 => a_aBG1 -> Meta
+ Text.Pandoc.CrossRef: ccsDelim :: forall a_asHj. ToMetaValue a_asHj => a_asHj -> Meta
- Text.Pandoc.CrossRef: ccsLabelSep :: forall a_aBG2. ToMetaValue a_aBG2 => a_aBG2 -> Meta
+ Text.Pandoc.CrossRef: ccsLabelSep :: forall a_asHk. ToMetaValue a_asHk => a_asHk -> Meta
- Text.Pandoc.CrossRef: ccsTemplate :: forall a_aBFX. ToMetaValue a_aBFX => a_aBFX -> Meta
+ Text.Pandoc.CrossRef: ccsTemplate :: forall a_asHf. ToMetaValue a_asHf => a_asHf -> Meta
- Text.Pandoc.CrossRef: chapDelim :: forall a_aBFL. ToMetaValue a_aBFL => a_aBFL -> Meta
+ Text.Pandoc.CrossRef: chapDelim :: forall a_asH3. ToMetaValue a_asH3 => a_asH3 -> Meta
- Text.Pandoc.CrossRef: chapters :: forall a_aC6x. ToMetaValue a_aC6x => a_aC6x -> Meta
+ Text.Pandoc.CrossRef: chapters :: forall a_at8e. ToMetaValue a_at8e => a_at8e -> Meta
- Text.Pandoc.CrossRef: chaptersDepth :: forall a_aBFs. ToMetaValue a_aBFs => a_aBFs -> Meta
+ Text.Pandoc.CrossRef: chaptersDepth :: forall a_asGK. ToMetaValue a_asGK => a_asGK -> Meta
- Text.Pandoc.CrossRef: codeBlockCaptions :: forall a_aBFu. ToMetaValue a_aBFu => a_aBFu -> Meta
+ Text.Pandoc.CrossRef: codeBlockCaptions :: forall a_asGM. ToMetaValue a_asGM => a_asGM -> Meta
- Text.Pandoc.CrossRef: cref :: forall a_aBFr. ToMetaValue a_aBFr => a_aBFr -> Meta
+ Text.Pandoc.CrossRef: cref :: forall a_asGJ. ToMetaValue a_asGJ => a_asGJ -> Meta
- Text.Pandoc.CrossRef: crossrefYaml :: forall a_aC6v. ToMetaValue a_aC6v => a_aC6v -> Meta
+ Text.Pandoc.CrossRef: crossrefYaml :: forall a_at8c. ToMetaValue a_at8c => a_at8c -> Meta
- Text.Pandoc.CrossRef: customLabel :: forall a_aBG0. ToMetaValue a_aBG0 => a_aBG0 -> Meta
+ Text.Pandoc.CrossRef: customLabel :: forall a_asHi. ToMetaValue a_asHi => a_asHi -> Meta
- Text.Pandoc.CrossRef: eqLabels :: forall a_aC6z. ToMetaValue a_aC6z => a_aC6z -> Meta
+ Text.Pandoc.CrossRef: eqLabels :: forall a_at8g. ToMetaValue a_at8g => a_at8g -> Meta
- Text.Pandoc.CrossRef: eqnPrefix :: forall a_aBFz. ToMetaValue a_aBFz => a_aBFz -> Meta
+ Text.Pandoc.CrossRef: eqnPrefix :: forall a_asGR. ToMetaValue a_asGR => a_asGR -> Meta
- Text.Pandoc.CrossRef: eqnPrefixTemplate :: forall a_aBFE. ToMetaValue a_aBFE => a_aBFE -> Meta
+ Text.Pandoc.CrossRef: eqnPrefixTemplate :: forall a_asGW. ToMetaValue a_asGW => a_asGW -> Meta
- Text.Pandoc.CrossRef: figLabels :: forall a_aC6y. ToMetaValue a_aC6y => a_aC6y -> Meta
+ Text.Pandoc.CrossRef: figLabels :: forall a_at8f. ToMetaValue a_at8f => a_at8f -> Meta
- Text.Pandoc.CrossRef: figPrefix :: forall a_aBFy. ToMetaValue a_aBFy => a_aBFy -> Meta
+ Text.Pandoc.CrossRef: figPrefix :: forall a_asGQ. ToMetaValue a_asGQ => a_asGQ -> Meta
- Text.Pandoc.CrossRef: figPrefixTemplate :: forall a_aBFD. ToMetaValue a_aBFD => a_aBFD -> Meta
+ Text.Pandoc.CrossRef: figPrefixTemplate :: forall a_asGV. ToMetaValue a_asGV => a_asGV -> Meta
- Text.Pandoc.CrossRef: figureTemplate :: forall a_aBFU. ToMetaValue a_aBFU => a_aBFU -> Meta
+ Text.Pandoc.CrossRef: figureTemplate :: forall a_asHc. ToMetaValue a_asHc => a_asHc -> Meta
- Text.Pandoc.CrossRef: figureTitle :: forall a_aC6r. ToMetaValue a_aC6r => a_aC6r -> Meta
+ Text.Pandoc.CrossRef: figureTitle :: forall a_at88. ToMetaValue a_at88 => a_at88 -> Meta
- Text.Pandoc.CrossRef: lastDelim :: forall a_aBFO. ToMetaValue a_aBFO => a_aBFO -> Meta
+ Text.Pandoc.CrossRef: lastDelim :: forall a_asH6. ToMetaValue a_asH6 => a_asH6 -> Meta
- Text.Pandoc.CrossRef: linkReferences :: forall a_aBG6. ToMetaValue a_aBG6 => a_aBG6 -> Meta
+ Text.Pandoc.CrossRef: linkReferences :: forall a_asHo. ToMetaValue a_asHo => a_asHo -> Meta
- Text.Pandoc.CrossRef: listingTemplate :: forall a_aBFZ. ToMetaValue a_aBFZ => a_aBFZ -> Meta
+ Text.Pandoc.CrossRef: listingTemplate :: forall a_asHh. ToMetaValue a_asHh => a_asHh -> Meta
- Text.Pandoc.CrossRef: listingTitle :: forall a_aC6t. ToMetaValue a_aC6t => a_aC6t -> Meta
+ Text.Pandoc.CrossRef: listingTitle :: forall a_at8a. ToMetaValue a_at8a => a_at8a -> Meta
- Text.Pandoc.CrossRef: listings :: forall a_aBFt. ToMetaValue a_aBFt => a_aBFt -> Meta
+ Text.Pandoc.CrossRef: listings :: forall a_asGL. ToMetaValue a_asGL => a_asGL -> Meta
- Text.Pandoc.CrossRef: lofTitle :: forall a_aBFQ. ToMetaValue a_aBFQ => a_aBFQ -> Meta
+ Text.Pandoc.CrossRef: lofTitle :: forall a_asH8. ToMetaValue a_asH8 => a_asH8 -> Meta
- Text.Pandoc.CrossRef: lolTitle :: forall a_aBFS. ToMetaValue a_aBFS => a_aBFS -> Meta
+ Text.Pandoc.CrossRef: lolTitle :: forall a_asHa. ToMetaValue a_asHa => a_asHa -> Meta
- Text.Pandoc.CrossRef: lotTitle :: forall a_aBFR. ToMetaValue a_aBFR => a_aBFR -> Meta
+ Text.Pandoc.CrossRef: lotTitle :: forall a_asH9. ToMetaValue a_asH9 => a_asH9 -> Meta
- Text.Pandoc.CrossRef: lstLabels :: forall a_aC6B. ToMetaValue a_aC6B => a_aC6B -> Meta
+ Text.Pandoc.CrossRef: lstLabels :: forall a_at8i. ToMetaValue a_at8i => a_at8i -> Meta
- Text.Pandoc.CrossRef: lstPrefix :: forall a_aBFB. ToMetaValue a_aBFB => a_aBFB -> Meta
+ Text.Pandoc.CrossRef: lstPrefix :: forall a_asGT. ToMetaValue a_asGT => a_asGT -> Meta
- Text.Pandoc.CrossRef: lstPrefixTemplate :: forall a_aBFG. ToMetaValue a_aBFG => a_aBFG -> Meta
+ Text.Pandoc.CrossRef: lstPrefixTemplate :: forall a_asGY. ToMetaValue a_asGY => a_asGY -> Meta
- Text.Pandoc.CrossRef: nameInLink :: forall a_aBG7. ToMetaValue a_aBG7 => a_aBG7 -> Meta
+ Text.Pandoc.CrossRef: nameInLink :: forall a_asHp. ToMetaValue a_asHp => a_asHp -> Meta
- Text.Pandoc.CrossRef: numberSections :: forall a_aBFw. ToMetaValue a_aBFw => a_aBFw -> Meta
+ Text.Pandoc.CrossRef: numberSections :: forall a_asGO. ToMetaValue a_asGO => a_asGO -> Meta
- Text.Pandoc.CrossRef: outFormat :: forall a_aBFT. ToMetaValue a_aBFT => a_aBFT -> Meta
+ Text.Pandoc.CrossRef: outFormat :: forall a_asHb. ToMetaValue a_asHb => a_asHb -> Meta
- Text.Pandoc.CrossRef: pairDelim :: forall a_aBFN. ToMetaValue a_aBFN => a_aBFN -> Meta
+ Text.Pandoc.CrossRef: pairDelim :: forall a_asH5. ToMetaValue a_asH5 => a_asH5 -> Meta
- Text.Pandoc.CrossRef: rangeDelim :: forall a_aBFM. ToMetaValue a_aBFM => a_aBFM -> Meta
+ Text.Pandoc.CrossRef: rangeDelim :: forall a_asH4. ToMetaValue a_asH4 => a_asH4 -> Meta
- Text.Pandoc.CrossRef: refDelim :: forall a_aBFP. ToMetaValue a_aBFP => a_aBFP -> Meta
+ Text.Pandoc.CrossRef: refDelim :: forall a_asH7. ToMetaValue a_asH7 => a_asH7 -> Meta
- Text.Pandoc.CrossRef: refIndexTemplate :: forall a_aBFI. ToMetaValue a_aBFI => a_aBFI -> Meta
+ Text.Pandoc.CrossRef: refIndexTemplate :: forall a_asH0. ToMetaValue a_asH0 => a_asH0 -> Meta
- Text.Pandoc.CrossRef: secHeaderDelim :: forall a_aC6D. ToMetaValue a_aC6D => a_aC6D -> Meta
+ Text.Pandoc.CrossRef: secHeaderDelim :: forall a_at8k. ToMetaValue a_at8k => a_at8k -> Meta
- Text.Pandoc.CrossRef: secHeaderTemplate :: forall a_aBFK. ToMetaValue a_aBFK => a_aBFK -> Meta
+ Text.Pandoc.CrossRef: secHeaderTemplate :: forall a_asH2. ToMetaValue a_asH2 => a_asH2 -> Meta
- Text.Pandoc.CrossRef: secLabels :: forall a_aC6C. ToMetaValue a_aC6C => a_aC6C -> Meta
+ Text.Pandoc.CrossRef: secLabels :: forall a_at8j. ToMetaValue a_at8j => a_at8j -> Meta
- Text.Pandoc.CrossRef: secPrefix :: forall a_aBFC. ToMetaValue a_aBFC => a_aBFC -> Meta
+ Text.Pandoc.CrossRef: secPrefix :: forall a_asGU. ToMetaValue a_asGU => a_asGU -> Meta
- Text.Pandoc.CrossRef: secPrefixTemplate :: forall a_aBFH. ToMetaValue a_aBFH => a_aBFH -> Meta
+ Text.Pandoc.CrossRef: secPrefixTemplate :: forall a_asGZ. ToMetaValue a_asGZ => a_asGZ -> Meta
- Text.Pandoc.CrossRef: sectionsDepth :: forall a_aBFx. ToMetaValue a_aBFx => a_aBFx -> Meta
+ Text.Pandoc.CrossRef: sectionsDepth :: forall a_asGP. ToMetaValue a_asGP => a_asGP -> Meta
- Text.Pandoc.CrossRef: subfigGrid :: forall a_aBG5. ToMetaValue a_aBG5 => a_aBG5 -> Meta
+ Text.Pandoc.CrossRef: subfigGrid :: forall a_asHn. ToMetaValue a_asHn => a_asHn -> Meta
- Text.Pandoc.CrossRef: subfigLabels :: forall a_aC6w. ToMetaValue a_aC6w => a_aC6w -> Meta
+ Text.Pandoc.CrossRef: subfigLabels :: forall a_at8d. ToMetaValue a_at8d => a_at8d -> Meta
- Text.Pandoc.CrossRef: subfigureChildTemplate :: forall a_aBFW. ToMetaValue a_aBFW => a_aBFW -> Meta
+ Text.Pandoc.CrossRef: subfigureChildTemplate :: forall a_asHe. ToMetaValue a_asHe => a_asHe -> Meta
- Text.Pandoc.CrossRef: subfigureRefIndexTemplate :: forall a_aBFJ. ToMetaValue a_aBFJ => a_aBFJ -> Meta
+ Text.Pandoc.CrossRef: subfigureRefIndexTemplate :: forall a_asH1. ToMetaValue a_asH1 => a_asH1 -> Meta
- Text.Pandoc.CrossRef: subfigureTemplate :: forall a_aBFV. ToMetaValue a_aBFV => a_aBFV -> Meta
+ Text.Pandoc.CrossRef: subfigureTemplate :: forall a_asHd. ToMetaValue a_asHd => a_asHd -> Meta
- Text.Pandoc.CrossRef: tableEqns :: forall a_aBG3. ToMetaValue a_aBG3 => a_aBG3 -> Meta
+ Text.Pandoc.CrossRef: tableEqns :: forall a_asHl. ToMetaValue a_asHl => a_asHl -> Meta
- Text.Pandoc.CrossRef: tableTemplate :: forall a_aBFY. ToMetaValue a_aBFY => a_aBFY -> Meta
+ Text.Pandoc.CrossRef: tableTemplate :: forall a_asHg. ToMetaValue a_asHg => a_asHg -> Meta
- Text.Pandoc.CrossRef: tableTitle :: forall a_aC6s. ToMetaValue a_aC6s => a_aC6s -> Meta
+ Text.Pandoc.CrossRef: tableTitle :: forall a_at89. ToMetaValue a_at89 => a_at89 -> Meta
- Text.Pandoc.CrossRef: tblLabels :: forall a_aC6A. ToMetaValue a_aC6A => a_aC6A -> Meta
+ Text.Pandoc.CrossRef: tblLabels :: forall a_at8h. ToMetaValue a_at8h => a_at8h -> Meta
- Text.Pandoc.CrossRef: tblPrefix :: forall a_aBFA. ToMetaValue a_aBFA => a_aBFA -> Meta
+ Text.Pandoc.CrossRef: tblPrefix :: forall a_asGS. ToMetaValue a_asGS => a_asGS -> Meta
- Text.Pandoc.CrossRef: tblPrefixTemplate :: forall a_aBFF. ToMetaValue a_aBFF => a_aBFF -> Meta
+ Text.Pandoc.CrossRef: tblPrefixTemplate :: forall a_asGX. ToMetaValue a_asGX => a_asGX -> Meta
- Text.Pandoc.CrossRef: titleDelim :: forall a_aC6u. ToMetaValue a_aC6u => a_aC6u -> Meta
+ Text.Pandoc.CrossRef: titleDelim :: forall a_at8b. ToMetaValue a_at8b => a_at8b -> Meta
Files
- CHANGELOG.md +6/−0
- docs/index.md +3/−0
- lib/Text/Pandoc/CrossRef/References/Blocks.hs +3/−3
- pandoc-crossref.cabal +5/−2
- src/ManData.hs +6/−3
- test/m2m/secLabels/expect.md +16/−0
- test/m2m/secLabels/expect.tex +33/−0
- test/m2m/secLabels/input.md +22/−0
- test/m2m/section-template/expect.md +2/−4
CHANGELOG.md view
@@ -1,3 +1,9 @@+## 0.3.8.4++- [Fix] secLabels+- [ManData] Generate table of contents in embedded html; filter out kramdown toc marker+- [Docs] Add toc to gh-pages+ ## 0.3.8.3 - [Fix] Pandoc 2.11.0.1 fixes the issue fixed in the previous release upstream.
docs/index.md view
@@ -7,6 +7,9 @@ pandoc-crossref is a pandoc filter for numbering figures, equations, tables and cross-references to them. +* TOC+{:toc}+ # Caveats ## LaTeX output and `--include-in-header`
lib/Text/Pandoc/CrossRef/References/Blocks.hs view
@@ -78,11 +78,11 @@ unless ("unnumbered" `elem` cls) $ do modify curChap $ \cc -> let ln = length cc- cl = lookup "label" attrs- inc l = init l <> [(fst (last l) + 1, cl)]+ cl i = lookup "label" attrs <> customLabel opts "sec" i+ inc l = let i = fst (last l) + 1 in init l <> [(i, cl i)] cc' | ln > n = inc $ take n cc | ln == n = inc cc- | otherwise = cc <> take (n-ln-1) (zip [1,1..] $ repeat Nothing) <> [(1,cl)]+ | otherwise = cc <> take (n-ln-1) (zip [1,1..] $ repeat Nothing) <> [(1,cl 1)] in cc' when ("sec:" `T.isPrefixOf` label') $ do index <- get curChap
pandoc-crossref.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 39f79bf240895e159f195d272e9604b08b795a6bce6ce663305b8aee2189ab82+-- hash: e482ef1e6f935e9229bb87d11a279dd174efa3767a94b99a83941d6bd6cfad1e name: pandoc-crossref-version: 0.3.8.3+version: 0.3.8.4 synopsis: Pandoc filter for cross-references description: pandoc-crossref is a pandoc filter for numbering figures, equations, tables and cross-references to them. category: Text@@ -55,6 +55,9 @@ test/m2m/multiple-eqn-same-para/expect.md test/m2m/multiple-eqn-same-para/expect.tex test/m2m/multiple-eqn-same-para/input.md+ test/m2m/secLabels/expect.md+ test/m2m/secLabels/expect.tex+ test/m2m/secLabels/input.md test/m2m/section-template/expect.md test/m2m/section-template/expect.tex test/m2m/section-template/input.md
src/ManData.hs view
@@ -23,6 +23,7 @@ import Language.Haskell.TH.Syntax import qualified Data.Text as T+import qualified Data.Text.IO as T import System.IO import qualified Text.Pandoc as P import Control.DeepSeq@@ -32,18 +33,18 @@ dataFile :: FilePath dataFile = "docs/index.md" -readDataFile :: IO String+readDataFile :: IO T.Text readDataFile = withFile dataFile ReadMode $ \h -> do hSetEncoding h utf8- cont <- hGetContents h+ cont <- T.replace "* TOC\n{:toc}\n" "" <$> T.hGetContents h return $!! cont embedManual :: (P.Pandoc -> P.PandocPure T.Text) -> Q Exp embedManual fmt = do qAddDependentFile dataFile d <- runIO readDataFile- let pd = either (error . show) id $ P.runPure $ P.readMarkdown readerOpts (T.pack d)+ let pd = either (error . show) id $ P.runPure $ P.readMarkdown readerOpts d let txt = either (error . show) id $ P.runPure $ fmt pd strToExp $ T.unpack txt @@ -63,6 +64,8 @@ embedManual $ P.writeHtml5String P.def{ P.writerTemplate = Just tt , P.writerHighlightStyle = Just pygments+ , P.writerTOCDepth = 6+ , P.writerTableOfContents = True } strToExp :: String -> Q Exp
+ test/m2m/secLabels/expect.md view
@@ -0,0 +1,16 @@+# a First Level Section {#first-level-section}++## a.a Second Level Section {#second-level-section}++{#fig:myfig}++## a.b Other Second Level Section {#other-second-level-section}++::: {#tbl:mytable}+ a b c+ --- --- ---+ 1 2 3+ 4 5 6++ : Table I: My table+:::
+ test/m2m/secLabels/expect.tex view
@@ -0,0 +1,33 @@+\hypertarget{first-level-section}{%+\section{a First Level Section}\label{first-level-section}}++\hypertarget{second-level-section}{%+\subsection{a.a Second Level Section}\label{second-level-section}}++\begin{figure}+\hypertarget{fig:myfig}{%+\centering+\includegraphics{myfig.png}+\caption{my figure}\label{fig:myfig}+}+\end{figure}++\hypertarget{other-second-level-section}{%+\subsection{a.b Other Second Level+Section}\label{other-second-level-section}}++\hypertarget{tbl:mytable}{}+\begin{longtable}[]{@{}lll@{}}+\caption{\label{tbl:mytable}My table}\tabularnewline+\toprule+a & b & c\tabularnewline+\midrule+\endfirsthead+\toprule+a & b & c\tabularnewline+\midrule+\endhead+1 & 2 & 3\tabularnewline+4 & 5 & 6\tabularnewline+\bottomrule+\end{longtable}
+ test/m2m/secLabels/input.md view
@@ -0,0 +1,22 @@+---+numberSections: true+sectionsDepth: -1+secLabels: alpha a+figLabels: alpha a+tblLabels: roman+---++# First Level Section++## Second Level Section++{#fig:myfig}++## Other Second Level Section++a b c+--- --- ---+1 2 3+4 5 6++: My table {#tbl:mytable}
test/m2m/section-template/expect.md view
@@ -1,8 +1,6 @@-Chapter 1. First Level Section {#first-level-section}-==============================+# Chapter 1. First Level Section {#first-level-section} -Section 1.1. Second Level Section {#second-level-section}----------------------------------+## Section 1.1. Second Level Section {#second-level-section} ### Paragraph 1.1.1. Thrid Level Section {#thrid-level-section}