Rename Ext_yaml_title_block
-> Ext_yaml_metadata_block
.
This commit is contained in:
parent
0da863f951
commit
3cd62d7c35
4 changed files with 15 additions and 9 deletions
10
README
10
README
|
@ -1775,6 +1775,12 @@ will also have "Pandoc User Manuals" in the footer.
|
||||||
|
|
||||||
will also have "Version 4.0" in the header.
|
will also have "Version 4.0" in the header.
|
||||||
|
|
||||||
|
YAML metadata block
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
**Extension: `yaml_metadata_block`**
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
Backslash escapes
|
Backslash escapes
|
||||||
-----------------
|
-----------------
|
||||||
|
@ -2401,8 +2407,8 @@ the document, for example:
|
||||||
|
|
||||||
See the MultiMarkdown documentation for details. Note that only title,
|
See the MultiMarkdown documentation for details. Note that only title,
|
||||||
author, and date are recognized; other fields are simply ignored by
|
author, and date are recognized; other fields are simply ignored by
|
||||||
pandoc. If `pandoc_title_block` is enabled, it will take precedence over
|
pandoc. If `pandoc_title_block` or `yaml_metadata_block` is enabled,
|
||||||
`mmd_title_block`.
|
it will take precedence over `mmd_title_block`.
|
||||||
|
|
||||||
[MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
|
[MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ data Extension =
|
||||||
Ext_footnotes -- ^ Pandoc/PHP/MMD style footnotes
|
Ext_footnotes -- ^ Pandoc/PHP/MMD style footnotes
|
||||||
| Ext_inline_notes -- ^ Pandoc-style inline notes
|
| Ext_inline_notes -- ^ Pandoc-style inline notes
|
||||||
| Ext_pandoc_title_block -- ^ Pandoc title block
|
| Ext_pandoc_title_block -- ^ Pandoc title block
|
||||||
| Ext_yaml_title_block -- ^ YAML metadata block
|
| Ext_yaml_metadata_block -- ^ YAML metadata block
|
||||||
| Ext_mmd_title_block -- ^ Multimarkdown metadata block
|
| Ext_mmd_title_block -- ^ Multimarkdown metadata block
|
||||||
| Ext_table_captions -- ^ Pandoc-style table captions
|
| Ext_table_captions -- ^ Pandoc-style table captions
|
||||||
| Ext_implicit_figures -- ^ A paragraph with just an image is a figure
|
| Ext_implicit_figures -- ^ A paragraph with just an image is a figure
|
||||||
|
@ -107,7 +107,7 @@ pandocExtensions = Set.fromList
|
||||||
[ Ext_footnotes
|
[ Ext_footnotes
|
||||||
, Ext_inline_notes
|
, Ext_inline_notes
|
||||||
, Ext_pandoc_title_block
|
, Ext_pandoc_title_block
|
||||||
, Ext_yaml_title_block
|
, Ext_yaml_metadata_block
|
||||||
, Ext_table_captions
|
, Ext_table_captions
|
||||||
, Ext_implicit_figures
|
, Ext_implicit_figures
|
||||||
, Ext_simple_tables
|
, Ext_simple_tables
|
||||||
|
|
|
@ -227,7 +227,7 @@ pandocTitleBlock = try $ do
|
||||||
|
|
||||||
yamlTitleBlock :: MarkdownParser (F (Pandoc -> Pandoc))
|
yamlTitleBlock :: MarkdownParser (F (Pandoc -> Pandoc))
|
||||||
yamlTitleBlock = try $ do
|
yamlTitleBlock = try $ do
|
||||||
guardEnabled Ext_yaml_title_block
|
guardEnabled Ext_yaml_metadata_block
|
||||||
pos <- getPosition
|
pos <- getPosition
|
||||||
string "---"
|
string "---"
|
||||||
blankline
|
blankline
|
||||||
|
|
|
@ -131,8 +131,8 @@ plainTitleBlock tit auths dat =
|
||||||
(hcat (intersperse (text "; ") auths)) <> cr <>
|
(hcat (intersperse (text "; ") auths)) <> cr <>
|
||||||
dat <> cr
|
dat <> cr
|
||||||
|
|
||||||
yamlTitleBlock :: Value -> Doc
|
yamlMetadataBlock :: Value -> Doc
|
||||||
yamlTitleBlock v = "---" $$ (jsonToYaml v) $$ "..."
|
yamlMetadataBlock v = "---" $$ (jsonToYaml v) $$ "..."
|
||||||
|
|
||||||
jsonToYaml :: Value -> Doc
|
jsonToYaml :: Value -> Doc
|
||||||
jsonToYaml (Object hashmap) =
|
jsonToYaml (Object hashmap) =
|
||||||
|
@ -174,8 +174,8 @@ pandocToMarkdown opts (Pandoc meta blocks) = do
|
||||||
let titleblock = case writerStandalone opts of
|
let titleblock = case writerStandalone opts of
|
||||||
True | isPlain ->
|
True | isPlain ->
|
||||||
plainTitleBlock title' authors' date'
|
plainTitleBlock title' authors' date'
|
||||||
| isEnabled Ext_yaml_title_block opts ->
|
| isEnabled Ext_yaml_metadata_block opts ->
|
||||||
yamlTitleBlock metadata
|
yamlMetadataBlock metadata
|
||||||
| isEnabled Ext_pandoc_title_block opts ->
|
| isEnabled Ext_pandoc_title_block opts ->
|
||||||
pandocTitleBlock title' authors' date'
|
pandocTitleBlock title' authors' date'
|
||||||
| isEnabled Ext_mmd_title_block opts ->
|
| isEnabled Ext_mmd_title_block opts ->
|
||||||
|
|
Loading…
Add table
Reference in a new issue