Skip to content

Commit 8651ec3

Browse files
committed
Add asciidoc as an input format.
New exported module Text.Pandoc.Readers.AsciiDoc, exporting readAsciiDoc [API change]. The bulk of parsing is handled by the asciidoc library. Closes #1456.
1 parent 525113c commit 8651ec3

File tree

11 files changed

+5777
-6
lines changed

11 files changed

+5777
-6
lines changed

MANUAL.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ header when requesting a document from a URL:
233233
: Specify input format. *FORMAT* can be:
234234

235235
::: {#input-formats}
236+
- `asciidoc` ([AsciiDoc] markup)
236237
- `bibtex` ([BibTeX] bibliography)
237238
- `biblatex` ([BibLaTeX] bibliography)
238239
- `bits` ([BITS] XML, alias for `jats`)

cabal.project

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ source-repository-package
2626
type: git
2727
location: https://github.com/jgm/djoths.git
2828
tag: 7dc8da53fc092d2d4d91f5f0988840f4faf90368
29+
30+
source-repository-package
31+
type: git
32+
location: https://github.com/jgm/asciidoc-hs.git
33+
tag: 17df3ccc91102ad74a977d4cb1a43f03b4ef0bda

pandoc.cabal

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ extra-source-files:
275275
test/command/6466-whole.hs
276276
test/command/7861.yaml
277277
test/command/7861/metadata/placeholder
278+
test/asciidoc-reader.adoc
279+
test/asciidoc-reader.native
280+
test/asciidoc-reader-include.rb
281+
test/asciidoc-reader-include.adoc
278282
test/docbook-chapter.docbook
279283
test/docbook-reader.docbook
280284
test/docbook-xref.docbook
@@ -566,6 +570,7 @@ library
566570
typst >= 0.8.0.2 && < 0.9,
567571
vector >= 0.12 && < 0.14,
568572
djot >= 0.1.2.3 && < 0.2,
573+
asciidoc >= 0.1 && < 0.2,
569574
tls >= 2.0.1 && < 2.2,
570575
crypton-x509-system >= 1.6.7 && < 1.7
571576

@@ -590,6 +595,7 @@ library
590595
Text.Pandoc.Translations,
591596
Text.Pandoc.Translations.Types,
592597
Text.Pandoc.Readers,
598+
Text.Pandoc.Readers.AsciiDoc,
593599
Text.Pandoc.Readers.HTML,
594600
Text.Pandoc.Readers.LaTeX,
595601
Text.Pandoc.Readers.Markdown,

src/Text/Pandoc/Readers.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module Text.Pandoc.Readers
2525
-- * Readers: converting /to/ Pandoc format
2626
Reader (..)
2727
, readers
28+
, readAsciiDoc
2829
, readDocx
2930
, readPptx
3031
, readXlsx
@@ -84,6 +85,7 @@ import Text.Pandoc.Error
8485
import Text.Pandoc.Extensions
8586
import qualified Text.Pandoc.Format as Format
8687
import Text.Pandoc.Options
88+
import Text.Pandoc.Readers.AsciiDoc
8789
import Text.Pandoc.Readers.CommonMark
8890
import Text.Pandoc.Readers.Markdown
8991
import Text.Pandoc.Readers.Creole
@@ -142,6 +144,7 @@ readers = [("native" , TextReader readNative)
142144
,("markdown_mmd", TextReader readMarkdown)
143145
,("commonmark" , TextReader readCommonMark)
144146
,("commonmark_x" , TextReader readCommonMark)
147+
,("asciidoc" , TextReader readAsciiDoc)
145148
,("creole" , TextReader readCreole)
146149
,("dokuwiki" , TextReader readDokuWiki)
147150
,("gfm" , TextReader readCommonMark)

0 commit comments

Comments
 (0)