pandoc-crossref 0.3.8.4 → 0.3.9.0
raw patch · 16 files changed
+170/−15 lines, 16 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Text.Pandoc.CrossRef: customHeadingLabel :: forall a_atw0. ToMetaValue a_atw0 => a_atw0 -> Meta
- Text.Pandoc.CrossRef: autoEqnLabels :: forall a_asHm. ToMetaValue a_asHm => a_asHm -> Meta
+ Text.Pandoc.CrossRef: autoEqnLabels :: forall a_atw4. ToMetaValue a_atw4 => a_atw4 -> Meta
- Text.Pandoc.CrossRef: autoSectionLabels :: forall a_asGN. ToMetaValue a_asGN => a_asGN -> Meta
+ Text.Pandoc.CrossRef: autoSectionLabels :: forall a_atvu. ToMetaValue a_atvu => a_atvu -> Meta
- Text.Pandoc.CrossRef: ccsDelim :: forall a_asHj. ToMetaValue a_asHj => a_asHj -> Meta
+ Text.Pandoc.CrossRef: ccsDelim :: forall a_atw1. ToMetaValue a_atw1 => a_atw1 -> Meta
- Text.Pandoc.CrossRef: ccsLabelSep :: forall a_asHk. ToMetaValue a_asHk => a_asHk -> Meta
+ Text.Pandoc.CrossRef: ccsLabelSep :: forall a_atw2. ToMetaValue a_atw2 => a_atw2 -> Meta
- Text.Pandoc.CrossRef: ccsTemplate :: forall a_asHf. ToMetaValue a_asHf => a_asHf -> Meta
+ Text.Pandoc.CrossRef: ccsTemplate :: forall a_atvW. ToMetaValue a_atvW => a_atvW -> Meta
- Text.Pandoc.CrossRef: chapDelim :: forall a_asH3. ToMetaValue a_asH3 => a_asH3 -> Meta
+ Text.Pandoc.CrossRef: chapDelim :: forall a_atvK. ToMetaValue a_atvK => a_atvK -> Meta
- Text.Pandoc.CrossRef: chapters :: forall a_at8e. ToMetaValue a_at8e => a_at8e -> Meta
+ Text.Pandoc.CrossRef: chapters :: forall a_atXw. ToMetaValue a_atXw => a_atXw -> Meta
- Text.Pandoc.CrossRef: chaptersDepth :: forall a_asGK. ToMetaValue a_asGK => a_asGK -> Meta
+ Text.Pandoc.CrossRef: chaptersDepth :: forall a_atvr. ToMetaValue a_atvr => a_atvr -> Meta
- Text.Pandoc.CrossRef: codeBlockCaptions :: forall a_asGM. ToMetaValue a_asGM => a_asGM -> Meta
+ Text.Pandoc.CrossRef: codeBlockCaptions :: forall a_atvt. ToMetaValue a_atvt => a_atvt -> Meta
- Text.Pandoc.CrossRef: cref :: forall a_asGJ. ToMetaValue a_asGJ => a_asGJ -> Meta
+ Text.Pandoc.CrossRef: cref :: forall a_atvq. ToMetaValue a_atvq => a_atvq -> Meta
- Text.Pandoc.CrossRef: crossrefYaml :: forall a_at8c. ToMetaValue a_at8c => a_at8c -> Meta
+ Text.Pandoc.CrossRef: crossrefYaml :: forall a_atXu. ToMetaValue a_atXu => a_atXu -> Meta
- Text.Pandoc.CrossRef: customLabel :: forall a_asHi. ToMetaValue a_asHi => a_asHi -> Meta
+ Text.Pandoc.CrossRef: customLabel :: forall a_atvZ. ToMetaValue a_atvZ => a_atvZ -> Meta
- Text.Pandoc.CrossRef: eqLabels :: forall a_at8g. ToMetaValue a_at8g => a_at8g -> Meta
+ Text.Pandoc.CrossRef: eqLabels :: forall a_atXy. ToMetaValue a_atXy => a_atXy -> Meta
- Text.Pandoc.CrossRef: eqnPrefix :: forall a_asGR. ToMetaValue a_asGR => a_asGR -> Meta
+ Text.Pandoc.CrossRef: eqnPrefix :: forall a_atvy. ToMetaValue a_atvy => a_atvy -> Meta
- Text.Pandoc.CrossRef: eqnPrefixTemplate :: forall a_asGW. ToMetaValue a_asGW => a_asGW -> Meta
+ Text.Pandoc.CrossRef: eqnPrefixTemplate :: forall a_atvD. ToMetaValue a_atvD => a_atvD -> Meta
- Text.Pandoc.CrossRef: figLabels :: forall a_at8f. ToMetaValue a_at8f => a_at8f -> Meta
+ Text.Pandoc.CrossRef: figLabels :: forall a_atXx. ToMetaValue a_atXx => a_atXx -> Meta
- Text.Pandoc.CrossRef: figPrefix :: forall a_asGQ. ToMetaValue a_asGQ => a_asGQ -> Meta
+ Text.Pandoc.CrossRef: figPrefix :: forall a_atvx. ToMetaValue a_atvx => a_atvx -> Meta
- Text.Pandoc.CrossRef: figPrefixTemplate :: forall a_asGV. ToMetaValue a_asGV => a_asGV -> Meta
+ Text.Pandoc.CrossRef: figPrefixTemplate :: forall a_atvC. ToMetaValue a_atvC => a_atvC -> Meta
- Text.Pandoc.CrossRef: figureTemplate :: forall a_asHc. ToMetaValue a_asHc => a_asHc -> Meta
+ Text.Pandoc.CrossRef: figureTemplate :: forall a_atvT. ToMetaValue a_atvT => a_atvT -> Meta
- Text.Pandoc.CrossRef: figureTitle :: forall a_at88. ToMetaValue a_at88 => a_at88 -> Meta
+ Text.Pandoc.CrossRef: figureTitle :: forall a_atXq. ToMetaValue a_atXq => a_atXq -> Meta
- Text.Pandoc.CrossRef: lastDelim :: forall a_asH6. ToMetaValue a_asH6 => a_asH6 -> Meta
+ Text.Pandoc.CrossRef: lastDelim :: forall a_atvN. ToMetaValue a_atvN => a_atvN -> Meta
- Text.Pandoc.CrossRef: linkReferences :: forall a_asHo. ToMetaValue a_asHo => a_asHo -> Meta
+ Text.Pandoc.CrossRef: linkReferences :: forall a_atw6. ToMetaValue a_atw6 => a_atw6 -> Meta
- Text.Pandoc.CrossRef: listingTemplate :: forall a_asHh. ToMetaValue a_asHh => a_asHh -> Meta
+ Text.Pandoc.CrossRef: listingTemplate :: forall a_atvY. ToMetaValue a_atvY => a_atvY -> Meta
- Text.Pandoc.CrossRef: listingTitle :: forall a_at8a. ToMetaValue a_at8a => a_at8a -> Meta
+ Text.Pandoc.CrossRef: listingTitle :: forall a_atXs. ToMetaValue a_atXs => a_atXs -> Meta
- Text.Pandoc.CrossRef: listings :: forall a_asGL. ToMetaValue a_asGL => a_asGL -> Meta
+ Text.Pandoc.CrossRef: listings :: forall a_atvs. ToMetaValue a_atvs => a_atvs -> Meta
- Text.Pandoc.CrossRef: lofTitle :: forall a_asH8. ToMetaValue a_asH8 => a_asH8 -> Meta
+ Text.Pandoc.CrossRef: lofTitle :: forall a_atvP. ToMetaValue a_atvP => a_atvP -> Meta
- Text.Pandoc.CrossRef: lolTitle :: forall a_asHa. ToMetaValue a_asHa => a_asHa -> Meta
+ Text.Pandoc.CrossRef: lolTitle :: forall a_atvR. ToMetaValue a_atvR => a_atvR -> Meta
- Text.Pandoc.CrossRef: lotTitle :: forall a_asH9. ToMetaValue a_asH9 => a_asH9 -> Meta
+ Text.Pandoc.CrossRef: lotTitle :: forall a_atvQ. ToMetaValue a_atvQ => a_atvQ -> Meta
- Text.Pandoc.CrossRef: lstLabels :: forall a_at8i. ToMetaValue a_at8i => a_at8i -> Meta
+ Text.Pandoc.CrossRef: lstLabels :: forall a_atXA. ToMetaValue a_atXA => a_atXA -> Meta
- Text.Pandoc.CrossRef: lstPrefix :: forall a_asGT. ToMetaValue a_asGT => a_asGT -> Meta
+ Text.Pandoc.CrossRef: lstPrefix :: forall a_atvA. ToMetaValue a_atvA => a_atvA -> Meta
- Text.Pandoc.CrossRef: lstPrefixTemplate :: forall a_asGY. ToMetaValue a_asGY => a_asGY -> Meta
+ Text.Pandoc.CrossRef: lstPrefixTemplate :: forall a_atvF. ToMetaValue a_atvF => a_atvF -> Meta
- Text.Pandoc.CrossRef: nameInLink :: forall a_asHp. ToMetaValue a_asHp => a_asHp -> Meta
+ Text.Pandoc.CrossRef: nameInLink :: forall a_atw7. ToMetaValue a_atw7 => a_atw7 -> Meta
- Text.Pandoc.CrossRef: numberSections :: forall a_asGO. ToMetaValue a_asGO => a_asGO -> Meta
+ Text.Pandoc.CrossRef: numberSections :: forall a_atvv. ToMetaValue a_atvv => a_atvv -> Meta
- Text.Pandoc.CrossRef: outFormat :: forall a_asHb. ToMetaValue a_asHb => a_asHb -> Meta
+ Text.Pandoc.CrossRef: outFormat :: forall a_atvS. ToMetaValue a_atvS => a_atvS -> Meta
- Text.Pandoc.CrossRef: pairDelim :: forall a_asH5. ToMetaValue a_asH5 => a_asH5 -> Meta
+ Text.Pandoc.CrossRef: pairDelim :: forall a_atvM. ToMetaValue a_atvM => a_atvM -> Meta
- Text.Pandoc.CrossRef: rangeDelim :: forall a_asH4. ToMetaValue a_asH4 => a_asH4 -> Meta
+ Text.Pandoc.CrossRef: rangeDelim :: forall a_atvL. ToMetaValue a_atvL => a_atvL -> Meta
- Text.Pandoc.CrossRef: refDelim :: forall a_asH7. ToMetaValue a_asH7 => a_asH7 -> Meta
+ Text.Pandoc.CrossRef: refDelim :: forall a_atvO. ToMetaValue a_atvO => a_atvO -> Meta
- Text.Pandoc.CrossRef: refIndexTemplate :: forall a_asH0. ToMetaValue a_asH0 => a_asH0 -> Meta
+ Text.Pandoc.CrossRef: refIndexTemplate :: forall a_atvH. ToMetaValue a_atvH => a_atvH -> Meta
- Text.Pandoc.CrossRef: secHeaderDelim :: forall a_at8k. ToMetaValue a_at8k => a_at8k -> Meta
+ Text.Pandoc.CrossRef: secHeaderDelim :: forall a_atXC. ToMetaValue a_atXC => a_atXC -> Meta
- Text.Pandoc.CrossRef: secHeaderTemplate :: forall a_asH2. ToMetaValue a_asH2 => a_asH2 -> Meta
+ Text.Pandoc.CrossRef: secHeaderTemplate :: forall a_atvJ. ToMetaValue a_atvJ => a_atvJ -> Meta
- Text.Pandoc.CrossRef: secLabels :: forall a_at8j. ToMetaValue a_at8j => a_at8j -> Meta
+ Text.Pandoc.CrossRef: secLabels :: forall a_atXB. ToMetaValue a_atXB => a_atXB -> Meta
- Text.Pandoc.CrossRef: secPrefix :: forall a_asGU. ToMetaValue a_asGU => a_asGU -> Meta
+ Text.Pandoc.CrossRef: secPrefix :: forall a_atvB. ToMetaValue a_atvB => a_atvB -> Meta
- Text.Pandoc.CrossRef: secPrefixTemplate :: forall a_asGZ. ToMetaValue a_asGZ => a_asGZ -> Meta
+ Text.Pandoc.CrossRef: secPrefixTemplate :: forall a_atvG. ToMetaValue a_atvG => a_atvG -> Meta
- Text.Pandoc.CrossRef: sectionsDepth :: forall a_asGP. ToMetaValue a_asGP => a_asGP -> Meta
+ Text.Pandoc.CrossRef: sectionsDepth :: forall a_atvw. ToMetaValue a_atvw => a_atvw -> Meta
- Text.Pandoc.CrossRef: subfigGrid :: forall a_asHn. ToMetaValue a_asHn => a_asHn -> Meta
+ Text.Pandoc.CrossRef: subfigGrid :: forall a_atw5. ToMetaValue a_atw5 => a_atw5 -> Meta
- Text.Pandoc.CrossRef: subfigLabels :: forall a_at8d. ToMetaValue a_at8d => a_at8d -> Meta
+ Text.Pandoc.CrossRef: subfigLabels :: forall a_atXv. ToMetaValue a_atXv => a_atXv -> Meta
- Text.Pandoc.CrossRef: subfigureChildTemplate :: forall a_asHe. ToMetaValue a_asHe => a_asHe -> Meta
+ Text.Pandoc.CrossRef: subfigureChildTemplate :: forall a_atvV. ToMetaValue a_atvV => a_atvV -> Meta
- Text.Pandoc.CrossRef: subfigureRefIndexTemplate :: forall a_asH1. ToMetaValue a_asH1 => a_asH1 -> Meta
+ Text.Pandoc.CrossRef: subfigureRefIndexTemplate :: forall a_atvI. ToMetaValue a_atvI => a_atvI -> Meta
- Text.Pandoc.CrossRef: subfigureTemplate :: forall a_asHd. ToMetaValue a_asHd => a_asHd -> Meta
+ Text.Pandoc.CrossRef: subfigureTemplate :: forall a_atvU. ToMetaValue a_atvU => a_atvU -> Meta
- Text.Pandoc.CrossRef: tableEqns :: forall a_asHl. ToMetaValue a_asHl => a_asHl -> Meta
+ Text.Pandoc.CrossRef: tableEqns :: forall a_atw3. ToMetaValue a_atw3 => a_atw3 -> Meta
- Text.Pandoc.CrossRef: tableTemplate :: forall a_asHg. ToMetaValue a_asHg => a_asHg -> Meta
+ Text.Pandoc.CrossRef: tableTemplate :: forall a_atvX. ToMetaValue a_atvX => a_atvX -> Meta
- Text.Pandoc.CrossRef: tableTitle :: forall a_at89. ToMetaValue a_at89 => a_at89 -> Meta
+ Text.Pandoc.CrossRef: tableTitle :: forall a_atXr. ToMetaValue a_atXr => a_atXr -> Meta
- Text.Pandoc.CrossRef: tblLabels :: forall a_at8h. ToMetaValue a_at8h => a_at8h -> Meta
+ Text.Pandoc.CrossRef: tblLabels :: forall a_atXz. ToMetaValue a_atXz => a_atXz -> Meta
- Text.Pandoc.CrossRef: tblPrefix :: forall a_asGS. ToMetaValue a_asGS => a_asGS -> Meta
+ Text.Pandoc.CrossRef: tblPrefix :: forall a_atvz. ToMetaValue a_atvz => a_atvz -> Meta
- Text.Pandoc.CrossRef: tblPrefixTemplate :: forall a_asGX. ToMetaValue a_asGX => a_asGX -> Meta
+ Text.Pandoc.CrossRef: tblPrefixTemplate :: forall a_atvE. ToMetaValue a_atvE => a_atvE -> Meta
- Text.Pandoc.CrossRef: titleDelim :: forall a_at8b. ToMetaValue a_at8b => a_at8b -> Meta
+ Text.Pandoc.CrossRef: titleDelim :: forall a_atXt. ToMetaValue a_atXt => a_atXt -> Meta
Files
- CHANGELOG.md +17/−0
- docs/index.md +5/−2
- lib/Text/Pandoc/CrossRef/References/Blocks.hs +2/−2
- lib/Text/Pandoc/CrossRef/Util/CustomLabels.hs +9/−1
- lib/Text/Pandoc/CrossRef/Util/Options.hs +1/−0
- lib/Text/Pandoc/CrossRef/Util/Settings.hs +1/−1
- lib/Text/Pandoc/CrossRef/Util/Settings/Template.hs +3/−1
- pandoc-crossref.cabal +9/−3
- test/m2m/label-precedence/expect.md +15/−0
- test/m2m/label-precedence/expect.tex +30/−0
- test/m2m/label-precedence/input.md +24/−0
- test/m2m/secLabels/expect.tex +4/−4
- test/m2m/secLevelLabels/expect.md +11/−0
- test/m2m/secLevelLabels/expect.tex +14/−0
- test/m2m/secLevelLabels/input.md +24/−0
- test/test-pandoc-crossref.hs +1/−1
CHANGELOG.md view
@@ -1,3 +1,20 @@+## 0.3.9.0++### New features++- Add header multilevel templates and secLevelLabels+- Add lowercase roman custom numbering++### Fixes++- Label precedence fix: label attr > secLevelLabels > xLabels++### Misc++- Update LaTeX tests for pandoc 2.11.3.1+- Update docs+- Relax bound on optparse-applicative+ ## 0.3.8.4 - [Fix] secLabels
docs/index.md view
@@ -503,7 +503,8 @@ - `titleDelim`, default `:`: What to put between object number and caption text. - `secHeaderDelim`, default ` ` (i.e. space): What to put between section- number and title when `numberSections` is `true`.+ number and title when `numberSections` is `true`. Can be a list,+ in that case it's indexed by heading level, 0-based. #### Subfigure-specific @@ -595,6 +596,7 @@ - `tblLabels`, default `arabic`: the numbering scheme for tables. - `lstLabels`, default `arabic`: the numbering scheme for listings. - `secLabels`, default `arabic`: the numbering scheme for sections.+- `secLevelLabels`, default unset: the numbering scheme for sections, YAML array, indexed by heading level; will override `secLabels` if set. ### Item title templates @@ -608,7 +610,7 @@ - `listingTemplate`, default `$$listingTitle$$ $$i$$$$titleDelim$$ $$t$$`: template for listing captions-- `secHeaderTemplate`, default `$$i$$$$secHeaderDelim$$$$t$$`: template for+- `secHeaderTemplate`, default `$$i$$$$secHeaderDelim[n]$$$$t$$`: template for section header text when `numberSections` is `true` @@ -740,6 +742,7 @@ - `arabic` -- arabic numbers (1, 2, 3 ...) - `roman` -- roman numbers (I, II, III, IV, ...)+- `lowercase roman` -- lowercase roman numbers (i, ii, iii, iv, ...) - `alpha x`, where `x` is first letter to start from. This will work for any letter, but will use UTF-8 codepage to determine what's next, so using something strange is not advised. For example, you
lib/Text/Pandoc/CrossRef/References/Blocks.hs view
@@ -78,7 +78,7 @@ unless ("unnumbered" `elem` cls) $ do modify curChap $ \cc -> let ln = length cc- cl i = lookup "label" attrs <> customLabel opts "sec" i+ cl i = lookup "label" attrs <|> customHeadingLabel opts n i <|> 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@@ -382,7 +382,7 @@ chap <- take (chaptersDepth o) `fmap` get curChap prop' <- get prop let i = 1+ (M.size . M.filter (\x -> (chap == init (refIndex x)) && isNothing (refSubfigure x)) $ prop')- index = chap <> [(i, refLabel <> customLabel o ref i)]+ index = chap <> [(i, refLabel <|> customLabel o ref i)] ref = either id (T.takeWhile (/=':')) label label' = either (<> T.pack (':' : show index)) id label when (M.member label' prop') $
lib/Text/Pandoc/CrossRef/Util/CustomLabels.hs view
@@ -19,7 +19,7 @@ -} {-# LANGUAGE OverloadedStrings #-}-module Text.Pandoc.CrossRef.Util.CustomLabels (customLabel) where+module Text.Pandoc.CrossRef.Util.CustomLabels (customLabel, customHeadingLabel) where import Text.Pandoc.Definition import Text.Pandoc.CrossRef.Util.Meta@@ -33,6 +33,12 @@ = mkLabel i (refLabel <> "Labels") cl | otherwise = Nothing +customHeadingLabel :: Meta -> Int -> Int -> Maybe T.Text+customHeadingLabel meta lvl i+ | Just cl <- getMetaList Just "secLevelLabels" meta (lvl-1)+ = mkLabel i "secLevelLabels" cl+ | otherwise = Nothing+ mkLabel :: Int -> T.Text -> MetaValue -> Maybe T.Text mkLabel i n lt | MetaList _ <- lt@@ -42,6 +48,8 @@ = Nothing | toString n lt == "roman" = Just $ toRoman i+ | toString n lt == "lowercase roman"+ = Just $ T.toLower $ toRoman i | Just (startWith, _) <- T.uncons =<< T.stripPrefix "alpha " (toString n lt) = Just . T.singleton $ [startWith..] !! (i-1) | otherwise = error $ "Unknown numeration type: " ++ show lt
lib/Text/Pandoc/CrossRef/Util/Options.hs view
@@ -59,6 +59,7 @@ , tableTemplate :: Template , listingTemplate :: Template , customLabel :: Text -> Int -> Maybe Text+ , customHeadingLabel :: Int -> Int -> Maybe Text , ccsDelim :: [Inline] , ccsLabelSep :: [Inline] , tableEqns :: Bool
lib/Text/Pandoc/CrossRef/Util/Settings.hs view
@@ -91,7 +91,7 @@ <> secPrefixTemplate (var "p" <> str "\160" <> var "i") <> refIndexTemplate (var "i" <> var "suf") <> subfigureRefIndexTemplate (var "i" <> var "suf" <> space <> str "(" <> var "s" <> str ")")- <> secHeaderTemplate (var "i" <> var "secHeaderDelim" <> var "t")+ <> secHeaderTemplate (var "i" <> var "secHeaderDelim[n]" <> var "t") <> secHeaderDelim space <> lofTitle (header 1 $ text "List of Figures") <> lotTitle (header 1 $ text "List of Tables")
lib/Text/Pandoc/CrossRef/Util/Settings/Template.hs view
@@ -29,7 +29,7 @@ import Language.Haskell.TH.Syntax hiding (Inline) import Data.List import Text.Pandoc.CrossRef.Util.Template-import Text.Pandoc.CrossRef.Util.CustomLabels (customLabel)+import Text.Pandoc.CrossRef.Util.CustomLabels import Data.Text (Text) import qualified Data.Text as T @@ -80,6 +80,7 @@ intT <- [t|$(conT t) -> Int|] tmplT <- [t|$(conT t) -> Template|] clT <- [t|$(conT t) -> Text -> Int -> Maybe Text|]+ chlT <- [t|$(conT t) -> Int -> Int -> Maybe Text|] let varName | Name (OccName n) _ <- accName = liftString n let dtv = return $ VarE $ mkName "dtv" body <-@@ -91,6 +92,7 @@ | t' == blkT -> [|getMetaBlock $(varName) $(dtv)|] | t' == tmplT -> [|makeTemplate $(dtv) $ getMetaInlines $(varName) $(dtv)|] | t' == clT -> [|customLabel $(dtv)|]+ | t' == chlT -> [|customHeadingLabel $(dtv)|] | t' == fmtT -> return $ VarE $ mkName "fmt" | otherwise -> fail $ show t' return [(accName, body)]
pandoc-crossref.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: e482ef1e6f935e9229bb87d11a279dd174efa3767a94b99a83941d6bd6cfad1e+-- hash: f420e59b52c7b2a0721bad7e6dcccdadc76346e81ef5ee0ced55461962dc3a15 name: pandoc-crossref-version: 0.3.8.4+version: 0.3.9.0 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@@ -40,6 +40,9 @@ test/m2m/equations/expect.md test/m2m/equations/expect.tex test/m2m/equations/input.md+ test/m2m/label-precedence/expect.md+ test/m2m/label-precedence/expect.tex+ test/m2m/label-precedence/input.md test/m2m/links-names/expect.md test/m2m/links-names/expect.tex test/m2m/links-names/input.md@@ -58,6 +61,9 @@ test/m2m/secLabels/expect.md test/m2m/secLabels/expect.tex test/m2m/secLabels/input.md+ test/m2m/secLevelLabels/expect.md+ test/m2m/secLevelLabels/expect.tex+ test/m2m/secLevelLabels/input.md test/m2m/section-template/expect.md test/m2m/section-template/expect.tex test/m2m/section-template/input.md@@ -143,7 +149,7 @@ , gitrev >=1.3.1 && <1.4 , mtl >=1.1 && <2.3 , open-browser >=0.2 && <0.3- , optparse-applicative >=0.13 && <0.16+ , optparse-applicative >=0.13 && <0.17 , pandoc >=2.10 && <2.12 , pandoc-crossref , pandoc-types >=1.21 && <1.23
+ test/m2m/label-precedence/expect.md view
@@ -0,0 +1,15 @@+# \* First Section {#first-section label="*"}++text++{#fig:fig1}++## \*.A Subsection {#subsection}++other text++{#fig:fig2 label="+"}++### \*.A.A Subsubsection {#subsubsection}++text text text
+ test/m2m/label-precedence/expect.tex view
@@ -0,0 +1,30 @@+\hypertarget{first-section}{%+\section{* First Section}\label{first-section}}++text++\begin{figure}+\hypertarget{fig:fig1}{%+\centering+\includegraphics{image.png}+\caption{A figure}\label{fig:fig1}+}+\end{figure}++\hypertarget{subsection}{%+\subsection{*.A Subsection}\label{subsection}}++other text++\begin{figure}+\hypertarget{fig:fig2}{%+\centering+\includegraphics{image.png}+\caption{A figure with custom label}\label{fig:fig2}+}+\end{figure}++\hypertarget{subsubsection}{%+\subsubsection{*.A.A Subsubsection}\label{subsubsection}}++text text text
+ test/m2m/label-precedence/input.md view
@@ -0,0 +1,24 @@+---+numberSections: true+sectionsDepth: -1+secLabels: roman+secLevelLabels:+ - alpha A+figLabels: alpha α+---++# First Section {label="*"}++text++{#fig:fig1}++## Subsection++other text++{#fig:fig2 label="+"}++### Subsubsection++text text text
test/m2m/secLabels/expect.tex view
@@ -20,14 +20,14 @@ \begin{longtable}[]{@{}lll@{}} \caption{\label{tbl:mytable}My table}\tabularnewline \toprule-a & b & c\tabularnewline+a & b & c \\ \addlinespace \midrule \endfirsthead \toprule-a & b & c\tabularnewline+a & b & c \\ \addlinespace \midrule \endhead-1 & 2 & 3\tabularnewline-4 & 5 & 6\tabularnewline+1 & 2 & 3 \\ \addlinespace+4 & 5 & 6 \\ \addlinespace \bottomrule \end{longtable}
+ test/m2m/secLevelLabels/expect.md view
@@ -0,0 +1,11 @@+# A. First Section {#first-section}++text++## A.1) Subsection {#subsection}++other text++### A.1.i Subsubsection {#subsubsection}++text text text
+ test/m2m/secLevelLabels/expect.tex view
@@ -0,0 +1,14 @@+\hypertarget{first-section}{%+\section{A. First Section}\label{first-section}}++text++\hypertarget{subsection}{%+\subsection{A.1) Subsection}\label{subsection}}++other text++\hypertarget{subsubsection}{%+\subsubsection{A.1.i Subsubsection}\label{subsubsection}}++text text text
+ test/m2m/secLevelLabels/input.md view
@@ -0,0 +1,24 @@+---+numberSections: true+sectionsDepth: -1+secHeaderDelim:+ - ". "+ - ") "+ - " "+secLevelLabels:+ - alpha A+ - arabic+ - lowercase roman+---++# First Section++text++## Subsection++other text++### Subsubsection++text text text
test/test-pandoc-crossref.hs view
@@ -313,7 +313,7 @@ it "Tbl labels" $ table' "A table" "some_table1" <> para (citeGen "tbl:some_table" [1])- `test` "\\hypertarget{tbl:some_table1}{}\n\\begin{longtable}[]{@{}@{}}\n\\caption{\\label{tbl:some_table1}A table}\\tabularnewline\n\\toprule\n\\endhead\n\\tabularnewline\n\\bottomrule\n\\end{longtable}\n\ntbl.~\\ref{tbl:some_table1}"+ `test` "\\hypertarget{tbl:some_table1}{}\n\\begin{longtable}[]{@{}@{}}\n\\caption{\\label{tbl:some_table1}A table}\\tabularnewline\n\\toprule\n\\endhead\n \\\\ \\addlinespace\n\\bottomrule\n\\end{longtable}\n\ntbl.~\\ref{tbl:some_table1}" #endif it "Code block labels" $ do