summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Extensions.hs
AgeCommit message (Collapse)Author
2024-02-13Add djot reader and writer.John MacFarlane
Djot is a light markup syntax (https://djot.net). This patch adds djot as input and output formats. API changes: Add Text.Pandoc.Readers.Djot Add Text.Pandoc.Writers.Djot
2024-02-13Make LaTeX writer sensitive to `empty_paragraphs` extension.John MacFarlane
Closes #9443.
2023-12-04Add `alerts` extension.John MacFarlane
This enables GitHub style markdown alerts as a commonmark extension. <https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts> This extension is now default for `gfm`. It can't be used with `markdown`, only with `commonmark` and variants.
2023-10-23Extensions: Add `Ext_tex_math_gfm` constructor to Extension.John MacFarlane
[API change] This handles two GitHub-specific syntaxes for math. And document in MANUAL.txt. This is now default for `gfm`, in addition to `tex_math_dollars`. See #9121.
2023-10-16remove duplicates for Ext_raw_html and Ext_pipe_tablesTim Stewart
2023-03-25Add typst writer.John MacFarlane
See #8713.
2023-01-15Markdown, CommonMark: add support for wiki links. [API change]Albert Krewinkel
Adds the Markdown/CommonMark extensions `wikilinks_title_after_pipe` and `wikilinks_title_before_pipe`. The former enables links of style `[[Name of page|Title]]` and the latter `[[Title|Name of page]]`. Titles are optional in both variants, so this works for both: `[[https://example.org]]`, `[[Name of page]]`. The writer is modified to render links with title `wikilink` as a wikilink if a respective extension is enabled. Pandoc will use `wikilinks_title_after_pipe` if both extensions are enabled. Closes: #2923
2023-01-15ConTeXt writer: support `tagging` extension [API Change]Albert Krewinkel
Paragraphs are enclosed by `\bpar` and `\epar` commands, and `highlight` commands are used for emphasis. This results in much better tagging in PDF output.
2023-01-10Update copyright years, it's 2023!Albert Krewinkel
2022-12-16Extensions: add new function `disableExtensions`.Albert Krewinkel
The function removes all elements in a second set from a base set. Extensions in the second set that are not in the base set are ignored.
2022-11-19Add support for `mark` extension for highlighted text.John MacFarlane
+ Extensions: Add `Ext_mark` extension. This is not part of the pandoc extensions by default. + Markdown reader: parse `==..==` if `mark` extension enabled. + Markdown writer: support `mark` extension. + Docx writer: render Span with class `mark` as highlighted. Currently yellow is hardcoded. + LaTeX writer: support highlighted text for Span with class `mark`. + RST writer: use special `mark` role for Span with class `mark`. + Update MANUAL.txt. Closes #7743.
2022-10-30hlint suggestions.John MacFarlane
2022-10-20Add custom extensions.John MacFarlane
T.P.Extensions [API change]: + Add CustomExtension constructor to Extension. + Remove Bounded, Enum instances for Extension. + Add `extensionsToList` function. + Revise `readExtension` so it can handle CustomExtension, and so that it returns a Text rather than Maybe Text. + Add `showExtension`. T.P.Format: + Revise error checking to handle CustomExtension.
2022-10-13Extensions: simpler implementation based on Set.John MacFarlane
This implementation would allow us (if we wanted) to add an extensible Ext_custom Text constructor.
2022-10-08[API Change] Add new module "Text.Pandoc.Format"Albert Krewinkel
The module provides functions and types for format spec parsing and processing. The function `parseFormatSpec` was moved from Text.Pandoc.Extensions to the new module and renamed to `parseFlavoredFormat`. It now operates in a PandocMonad and is based on the updated types.
2022-10-08Extensions: add new function `readExtension`Albert Krewinkel
The function tries to read an extension from a string.
2022-10-05Extensions: fix JSON decoding of ExtensionsAlbert Krewinkel
Closes: #8352
2022-09-27Fix small whitespace things.John MacFarlane
2022-07-28DokuWiki reader: support latex plugin and math.John MacFarlane
The `tex_math_dollars` extension is now supported for `dokuwiki` (but off by default). Content inside `<latex>...</latex>` is parsed as raw LaTeX inline, and inside `<LATEX>..</LATEX>` as raw LaTeX block. In addition, this commit changes the behavior of `<php>...</php>` so that instead of producing a code block, it produces raw HTML with `<?php ... ?>`. Closes #8178.
2022-05-19Add tex_math_dollars to gfm default extensions.John MacFarlane
2022-03-14Remove `native_divs` from allowed gfm extensions.John MacFarlane
This allows `<div>` to be suppressed using `-raw_html`. Previously `native_divs` was enabled but could not be suppressed, because it was not in the list of available extensions for commonmark-based formats. Closes #7965.
2022-03-07Remove `raw_tex` extension from list of commonmark...John MacFarlane
extensions, and from the `commonmark_x` defaults. commonmark doesn't parse raw TeX, and it doesn't make sense to write it if we don't parse it.
2022-02-03Enable `citations` extension for docx reader.John MacFarlane
When enabled, Zotero citations are parsed as native pandoc citations. (When disabled, the Zotero-generated citation text is passed through as regular text.) In addition, the Zotero-generated bibliography is suppressed. Locators still need some work.
2022-01-09Org reader: support alphabetical (fancy) listsLucas Viana
This adds support for alphabetical lists in org by enabling the extension Ext_fancy_lists, mimicking the behaviour of Org Mode when org-list-allow-alphabetical is enabled. Enabling Ext_fancy_lists will also make Pandoc differentiate between the delimiters of ordered lists (periods or closing parentheses). Org does this differentiation by default when exporting to some formats (e.g. plain text) but does not in others (e.g. html and latex), so I decided to copy Pandoc's markdown reader behaviour.
2022-01-03parseFormatSpec: cleaner error message for invalid extensions.John MacFarlane
2022-01-02Copyright notices: update for 2022Albert Krewinkel
2021-12-19Add a writer for Markua 0.10 (#7729)binaarinen
Markua is a markdown variant used by Leanpub. More information about Markua can be found at https://leanpub.com/markua/read. Adds a new exported function `writeMarkua` from T.P.Writers.Markdown. [API change] Closes #1871. Co-authored by Tim Wisotzki and Samuel Lemmenmeier.
2021-10-27Change JSON encodings of some types.John MacFarlane
- For LineEnding use lowercase constructors, e.g. `crlf`, `native`. This was the original intent, but there was a bug in the implementation. - For HTMLSlideVariant use lowercase constructors. - For ReaderOptions use e.g. `default-image-extension` instead of `readerDefaultImageExtension` for field names. - For Extension, use e.g. `tex_math_dollars` instead of `Ext_tex_math_dollars` as constructor. - For Extensions, use an array of Extensions, instead of an object wrapping the tag `Extensions` and an integer. (The representation is not supposed to be part of the public API.) - For Opt, use field names like `tab-stop` instead of `optTabStop`.
2021-09-30Add `footnotes` to default `gfm` etxensions.John MacFarlane
Now that `gfm` supports footnotes. https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/
2021-09-18Alphabetize Extension constructors.John MacFarlane
2021-09-04Extensions: put Ext_short_subsuperscripts in alphabetical order.John MacFarlane
2021-08-15Multimarkdown sub- and superscripts (#5512) (#7188)OCzarnecki
Added an extension `short_subsuperscripts` which modifies the behavior of `subscript` and `superscript`, allowing subscripts or superscripts containing only alphanumerics to end with a space character (eg. `x^2 = 4` or `H~2 is combustible`). This improves support for multimarkdown. Closes #5512. Add `Ext_short_subsuperscripts` constructor to `Extension` [API change]. This is enabled by default for `markdown_mmd`.
2021-08-15Make docx writer sensitive to `native_numbering` extension.John MacFarlane
Figure and table numbers are now only included if `native_numbering` is enabled. (By default it is disabled.) This is a behavior change with respect to 2.14.1, but the behavior is that of previous versions. The change was necessary to avoid incompatibilities between pandoc's native numbering and third-party cross reference filters like pandoc-crossref. Closes #7499.
2021-05-28Support `rebase_relative_paths` for commonmark based formats.John MacFarlane
(Including `gfm`.)
2021-05-27Add `rebase_relative_paths` extension.John MacFarlane
- Add manual entry for (non-default) extension `rebase_relative_paths`. - Add constructor `Ext_rebase_relative_paths` to `Extensions` in Text.Pandoc.Extensions [API change]. When enabled, this extension rewrites relative image and link paths by prepending the (relative) directory of the containing file. - Make Markdown reader sensitive to the new extension. - Add tests for #3752. Closes #3752. NB. currently the extension applies to markdown and associated readers but not commonmark/gfm.
2021-03-20Support `yaml_metadata_block` extension form commonmark, gfm.John MacFarlane
This is a bit more limited than with markdown, as documented in the manual: - The YAML block must be the first thing in the input. - The leaf notes are parsed in isolation from the rest of the document. So, for example, you can't use reference links if the references are defined later in the document. Closes #6537.
2021-03-15Use foldl' instead of foldl everywhere.John MacFarlane
2021-02-13Org: support task_lists extensionAlbert Krewinkel
The tasks lists extension is now supported by the org reader and writer; the extension is turned on by default. Closes: #6336
2021-02-13Remove Ext_fenced_code_attributes from allowed commonmark attributes.John MacFarlane
This attribute was listed as allowed, but it didn't actually do anything. Use `attributes` for code attributes and more. Closes #7097.
2021-01-22JATS writer: allow to use element-citationAlbert Krewinkel
2021-01-16Revert "Markdown reader: support GitHub wiki's internal links (#2923) (#6458)"John MacFarlane
This reverts commit 6efd3460a776620fdb93812daa4f6831e6c332ce. Since this extension is designed to be used with GitHub markdown (gfm), we need to implement the parser as a commonmark extension (commonmark-extensions), rather than in pandoc's markdown reader. When that is done, we can add it here.
2021-01-16Markdown reader: support GitHub wiki's internal links (#2923) (#6458)Gautier DI FOLCO
Canges overview: * Add a `Ext_markdown_github_wikilink` constructor to `Extension` [API change]. * Add the parser `githubWikiLink` in `Text.Pandoc.Readers.Markdown` * Add tests.
2021-01-08Update copyright notices for 2021 (#7012)Albert Krewinkel
2020-12-10Add sourcepos extension for commonmarkeJohn MacFarlane
* Add `Ext_sourcepos` constructor for `Extension`. * Add `sourcepos` extension (only for commonmark). * Bump to 2.11.3 With the `sourcepos` extension set set, `data-pos` attributes are added to the AST by the commonmark reader. No other readers are affected. The `data-pos` attributes are put on elements that accept attributes; for other elements, an enlosing Div or Span is added to hold the attributes. Closes #4565.
2020-12-05OpenDocument writer: Allow references for internal links (#6774)Nils Carlson
This commit adds two extensions to the OpenDocument writer, `xrefs_name` and `xrefs_number`. Links to headings, figures and tables inside the document are substituted with cross-references that will use the name or caption of the referenced item for `xrefs_name` or the number for `xrefs_number`. For the `xrefs_number` to be useful heading numbers must be enabled in the generated document and table and figure captions must be enabled using for example the `native_numbering` extension. In order for numbers and reference text to be updated the generated document must be refreshed. Co-authored-by: Nils Carlson <nils.carlson@ludd.ltu.se>
2020-11-20`commonmark_x`: replace `auto_identifiers` with `gfm_auto_identifiers`.John MacFarlane
`commonmark_x` never actually supported `auto_identifiers` (it didn't do anything), because the underlying library implements gfm-style identifiers only. Attempts to add the `autolink_identifiers` extension to `commonmark` will now fail with an error. Closes #6863.
2020-09-25Allow `gfm_auto_identifiers`, `ascii_identifiers` extensions for docx.John MacFarlane
2020-08-09Remove `fenced_code_blocks` and `backtick_code_blocks` from...John MacFarlane
commonmark/gfm extensions. These shouldn't really be counted as extensions, because they can't be disabled in commonmark. Adjust markdown writer to check for commonmark variant in addition to extensions.
2020-07-29Add extensions to `gfm` and `commonmark`:John MacFarlane
`fenced_code_blocks`, `backtick_code_blocks`, `fenced_code_attributes`. These can't really be disabled in the reader, but they need to be enabled in the writer or we just get indented code.
2020-07-24Make sure proper set of extensions is recognized for commonmark_x.John MacFarlane