Skip to content

Commit

Permalink
Add Pod reader
Browse files Browse the repository at this point in the history
Pod ("Plain old documentation") is a markup languaged used principally
to document Perl modules and programs. Since it was originally meant to
be translated pretty directly to man, the semantics are fairly simple.

This Pod reader was developed with reference to the canonical user and
implementer documentation of Pod: https://perldoc.perl.org/perlpod and
https://perldoc.perl.org/perlpodspec.

There are 1490 .pod, .pl, and .pm in the Perl 5.34 distribution found in
/System/Library/Perl on my mac. Of those, this reader dies with a parse
error on 7 of them. All of them seem to be cases where pod commands are
found within a non-colon-prefixed =begin/=end. perlpodspec says I may
treat this as an error.
  • Loading branch information
silby committed Dec 27, 2024
1 parent af2b276 commit 8270c09
Show file tree
Hide file tree
Showing 9 changed files with 1,179 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MANUAL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ header when requesting a document from a URL:
- `odt` ([OpenOffice text document][ODT])
- `opml` ([OPML])
- `org` ([Emacs Org mode])
- `pod` (Perl's [Plain Old Documentation])
- `ris` ([RIS] bibliography)
- `rtf` ([Rich Text Format])
- `rst` ([reStructuredText])
Expand Down Expand Up @@ -499,6 +500,7 @@ header when requesting a document from a URL:
[OPML]: http://dev.opml.org/spec2.html
[OpenDocument]: http://opendocument.xml.org
[ODT]: https://en.wikipedia.org/wiki/OpenDocument
[Plain Old Documentation]: https://perldoc.perl.org/perlpod
[Textile]: https://textile-lang.com
[MediaWiki markup]: https://www.mediawiki.org/wiki/Help:Formatting
[DokuWiki markup]: https://www.dokuwiki.org/dokuwiki
Expand Down
3 changes: 3 additions & 0 deletions pandoc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ extra-source-files:
test/odt/odt/*.odt
test/odt/markdown/*.md
test/odt/native/*.native
test/pod-reader.pod
source-repository head
type: git
location: git://github.com/jgm/pandoc.git
Expand Down Expand Up @@ -604,6 +605,7 @@ library
Text.Pandoc.Readers.RTF,
Text.Pandoc.Readers.Typst,
Text.Pandoc.Readers.Djot,
Text.Pandoc.Readers.Pod,
Text.Pandoc.Writers,
Text.Pandoc.Writers.Native,
Text.Pandoc.Writers.DocBook,
Expand Down Expand Up @@ -837,6 +839,7 @@ test-suite test-pandoc
Tests.Readers.Man
Tests.Readers.Mdoc
Tests.Readers.FB2
Tests.Readers.Pod
Tests.Readers.DokuWiki
Tests.Writers.Native
Tests.Writers.ConTeXt
Expand Down
3 changes: 3 additions & 0 deletions src/Text/Pandoc/Readers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module Text.Pandoc.Readers
, readRTF
, readTypst
, readDjot
, readPod
-- * Miscellaneous
, getReader
, getDefaultExtensions
Expand Down Expand Up @@ -100,6 +101,7 @@ import Text.Pandoc.Readers.Native
import Text.Pandoc.Readers.ODT
import Text.Pandoc.Readers.OPML
import Text.Pandoc.Readers.Org
import Text.Pandoc.Readers.Pod
import Text.Pandoc.Readers.RST
import Text.Pandoc.Readers.Textile
import Text.Pandoc.Readers.TikiWiki
Expand Down Expand Up @@ -171,6 +173,7 @@ readers = [("native" , TextReader readNative)
,("typst" , TextReader readTypst)
,("djot" , TextReader readDjot)
,("mdoc" , TextReader readMdoc)
,("pod" , TextReader readPod)
]

-- | Retrieve reader, extensions based on format spec (format+extensions).
Expand Down
Loading

0 comments on commit 8270c09

Please sign in to comment.