From e35c1d1ebfb6740fd3e58b5a5b7ea13c1424704c Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Sun, 30 Oct 2022 03:03:14 +0200 Subject: [PATCH 1/2] Sync READERS and WRITERS with latest pandoc Updated to the supported formats list as of Pandoc 2.19.2. --- lib/pandoc-ruby.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/pandoc-ruby.rb b/lib/pandoc-ruby.rb index 6168674..4e71fc3 100644 --- a/lib/pandoc-ruby.rb +++ b/lib/pandoc-ruby.rb @@ -12,12 +12,17 @@ class << self # The available readers and their corresponding names. The keys are used to # generate methods and specify options to Pandoc. READERS = { + 'biblatex' => 'BibLaTeX bibliography', + 'bibtex' => 'BibTeX bibliography', 'commonmark' => 'CommonMark Markdown', + 'commonmark_x' => 'CommonMark Markdown with extensions', 'creole' => 'Creole 1.0', + 'csljson' => 'CSL JSON bibliography', 'csv' => 'CSV table', 'docbook' => 'DocBook', 'docx' => 'Word docx', 'dokuwiki' => 'DokuWiki markup', + 'endnotexml' => 'EndNote XML bibliography', 'epub' => 'EPUB', 'fb2' => 'FictionBook2 e-book', 'gfm' => 'GitHub-Flavored Markdown', @@ -39,10 +44,13 @@ class << self 'odt' => 'ODT', 'opml' => 'OPML', 'org' => 'Emacs Org mode', + 'ris' => 'RIS bibliography', 'rst' => 'reStructuredText', + 'rtf' => 'Rich Text Format', 't2t' => 'txt2tags', 'textile' => 'Textile', 'tikiwiki' => 'TikiWiki markup', + 'tsv' => 'TSV table', 'twiki' => 'TWiki markup', 'vimwiki' => 'Vimwiki' }.freeze @@ -53,8 +61,12 @@ class << self 'asciidoc' => 'AsciiDoc', 'asciidoctor' => 'AsciiDoctor', 'beamer' => 'LaTeX beamer slide show', + 'biblatex' => 'BibLaTeX bibliography', + 'bibtex' => 'BibTeX bibliography', 'commonmark' => 'CommonMark Markdown', + 'commonmark_x' => 'CommonMark Markdown with extensions', 'context' => 'ConTeXt', + 'csljson' => 'CSL JSON bibliography', 'docbook' => 'DocBook 4', 'docbook4' => 'DocBook 4', 'docbook5' => 'DocBook 5', @@ -79,6 +91,7 @@ class << self 'markdown_mmd' => 'MultiMarkdown', 'markdown_phpextra' => 'PHP Markdown Extra', 'markdown_strict' => 'original unextended Markdown', + 'markua' => 'Markua', 'mediawiki' => 'MediaWiki markup', 'ms' => 'roff ms', 'muse' => 'Muse', @@ -108,7 +121,7 @@ class << self BINARY_WRITERS = { 'odt' => 'OpenOffice text document', 'docx' => 'Word docx', - 'epub' => 'EPUB v2', + 'epub' => 'EPUB v3', 'epub2' => 'EPUB v2', 'epub3' => 'EPUB v3' }.freeze From 6dc505ff2c2250914302c34e0f4083de75ff0b4f Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Sun, 30 Oct 2022 03:12:52 +0200 Subject: [PATCH 2/2] Update test files to pandoc 2.19.2, as well --- test/files/format.context | 9 +++++---- test/files/format.dzslides | 3 ++- test/files/format.html | 3 ++- test/files/format.html5 | 3 ++- test/files/format.mediawiki | 2 +- test/files/format.org | 6 +++--- test/files/format.rtf | 1 - test/files/format.s5 | 3 ++- test/files/format.slidy | 3 ++- test/files/format.textile | 1 - test/test_pandoc_ruby.rb | 15 ++++++++++++++- 11 files changed, 33 insertions(+), 16 deletions(-) diff --git a/test/files/format.context b/test/files/format.context index b97f3f9..3447a67 100644 --- a/test/files/format.context +++ b/test/files/format.context @@ -1,5 +1,6 @@ -\section[title={This is a Title},reference={this-is-a-title}] +\startsectionlevel[title={This is a Title},reference={this-is-a-title}] -Some {\em emphasized text} and -\useURL[url1][http://daringfireball.net/projects/markdown/][][a -link]\from[url1] +Some {\em emphasized text} and \goto{a +link}[url(http://daringfireball.net/projects/markdown/)] + +\stopsectionlevel diff --git a/test/files/format.dzslides b/test/files/format.dzslides index 80f83ad..7d92149 100644 --- a/test/files/format.dzslides +++ b/test/files/format.dzslides @@ -1,4 +1,5 @@

This is a Title

-

Some emphasized text and a link

+

Some emphasized text and a link

diff --git a/test/files/format.html b/test/files/format.html index fd0e98c..97bd003 100644 --- a/test/files/format.html +++ b/test/files/format.html @@ -1,2 +1,3 @@

This is a Title

-

Some emphasized text and a link

+

Some emphasized text and a link

diff --git a/test/files/format.html5 b/test/files/format.html5 index fd0e98c..97bd003 100644 --- a/test/files/format.html5 +++ b/test/files/format.html5 @@ -1,2 +1,3 @@

This is a Title

-

Some emphasized text and a link

+

Some emphasized text and a link

diff --git a/test/files/format.mediawiki b/test/files/format.mediawiki index d3fc333..e62bd09 100644 --- a/test/files/format.mediawiki +++ b/test/files/format.mediawiki @@ -1,4 +1,4 @@ + = This is a Title = Some ''emphasized text'' and [http://daringfireball.net/projects/markdown/ a link] - diff --git a/test/files/format.org b/test/files/format.org index 0262912..9055b36 100644 --- a/test/files/format.org +++ b/test/files/format.org @@ -1,6 +1,6 @@ * This is a Title - :PROPERTIES: - :CUSTOM_ID: this-is-a-title - :END: +:PROPERTIES: +:CUSTOM_ID: this-is-a-title +:END: Some /emphasized text/ and [[http://daringfireball.net/projects/markdown/][a link]] diff --git a/test/files/format.rtf b/test/files/format.rtf index 6473ba6..dae0df8 100644 --- a/test/files/format.rtf +++ b/test/files/format.rtf @@ -3,4 +3,3 @@ a link }}} \par} - diff --git a/test/files/format.s5 b/test/files/format.s5 index 0aa9a60..7125a3e 100644 --- a/test/files/format.s5 +++ b/test/files/format.s5 @@ -1,4 +1,5 @@

This is a Title

-

Some emphasized text and a link

+

Some emphasized text and a link

diff --git a/test/files/format.slidy b/test/files/format.slidy index 0aa9a60..7125a3e 100644 --- a/test/files/format.slidy +++ b/test/files/format.slidy @@ -1,4 +1,5 @@

This is a Title

-

Some emphasized text and a link

+

Some emphasized text and a link

diff --git a/test/files/format.textile b/test/files/format.textile index e9368b8..6240bdd 100644 --- a/test/files/format.textile +++ b/test/files/format.textile @@ -1,4 +1,3 @@ h1(#this-is-a-title). This is a Title Some _emphasized text_ and "a link":http://daringfireball.net/projects/markdown/ - diff --git a/test/test_pandoc_ruby.rb b/test/test_pandoc_ruby.rb index f6cd1c7..d57a0d1 100644 --- a/test/test_pandoc_ruby.rb +++ b/test/test_pandoc_ruby.rb @@ -346,12 +346,17 @@ it 'has reader and writer constants' do assert_equal( PandocRuby::READERS, + 'biblatex' => 'BibLaTeX bibliography', + 'bibtex' => 'BibTeX bibliography', 'commonmark' => 'CommonMark Markdown', + 'commonmark_x' => 'CommonMark Markdown with extensions', 'creole' => 'Creole 1.0', + 'csljson' => 'CSL JSON bibliography', 'csv' => 'CSV table', 'docbook' => 'DocBook', 'docx' => 'Word docx', 'dokuwiki' => 'DokuWiki markup', + 'endnotexml' => 'EndNote XML bibliography', 'epub' => 'EPUB', 'fb2' => 'FictionBook2 e-book', 'gfm' => 'GitHub-Flavored Markdown', @@ -373,10 +378,13 @@ 'odt' => 'ODT', 'opml' => 'OPML', 'org' => 'Emacs Org mode', + 'ris' => 'RIS bibliography', 'rst' => 'reStructuredText', + 'rtf' => 'Rich Text Format', 't2t' => 'txt2tags', 'textile' => 'Textile', 'tikiwiki' => 'TikiWiki markup', + 'tsv' => 'TSV table', 'twiki' => 'TWiki markup', 'vimwiki' => 'Vimwiki' ) @@ -386,8 +394,12 @@ 'asciidoc' => 'AsciiDoc', 'asciidoctor' => 'AsciiDoctor', 'beamer' => 'LaTeX beamer slide show', + 'biblatex' => 'BibLaTeX bibliography', + 'bibtex' => 'BibTeX bibliography', 'commonmark' => 'CommonMark Markdown', + 'commonmark_x' => 'CommonMark Markdown with extensions', 'context' => 'ConTeXt', + 'csljson' => 'CSL JSON bibliography', 'docbook' => 'DocBook 4', 'docbook4' => 'DocBook 4', 'docbook5' => 'DocBook 5', @@ -412,6 +424,7 @@ 'markdown_mmd' => 'MultiMarkdown', 'markdown_phpextra' => 'PHP Markdown Extra', 'markdown_strict' => 'original unextended Markdown', + 'markua' => 'Markua', 'mediawiki' => 'MediaWiki markup', 'ms' => 'roff ms', 'muse' => 'Muse', @@ -440,7 +453,7 @@ PandocRuby::BINARY_WRITERS, 'odt' => 'OpenOffice text document', 'docx' => 'Word docx', - 'epub' => 'EPUB v2', + 'epub' => 'EPUB v3', 'epub2' => 'EPUB v2', 'epub3' => 'EPUB v3' )