paru 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/do-pandoc.rb +64 -0
- data/bin/pandoc2yaml.rb +94 -0
- data/lib/paru.rb +26 -10
- data/lib/paru/error.rb +7 -0
- data/lib/paru/filter.rb +35 -0
- data/lib/paru/filter/alignment.rb +2 -0
- data/lib/paru/filter/ast_manipulation.rb +2 -0
- data/lib/paru/filter/attr.rb +2 -0
- data/lib/paru/filter/block.rb +2 -0
- data/lib/paru/filter/block_quote.rb +3 -1
- data/lib/paru/filter/bullet_list.rb +3 -1
- data/lib/paru/filter/citation.rb +2 -0
- data/lib/paru/filter/cite.rb +3 -1
- data/lib/paru/filter/code.rb +3 -1
- data/lib/paru/filter/code_block.rb +3 -1
- data/lib/paru/filter/definition_list.rb +3 -1
- data/lib/paru/filter/definition_list_item.rb +2 -0
- data/lib/paru/filter/div.rb +3 -1
- data/lib/paru/filter/document.rb +2 -0
- data/lib/paru/filter/emph.rb +3 -1
- data/lib/paru/filter/empty_block.rb +2 -0
- data/lib/paru/filter/empty_inline.rb +2 -0
- data/lib/paru/filter/header.rb +3 -1
- data/lib/paru/filter/horizontal_rule.rb +3 -1
- data/lib/paru/filter/image.rb +3 -1
- data/lib/paru/filter/inline.rb +2 -0
- data/lib/paru/filter/line_block.rb +3 -1
- data/lib/paru/filter/line_break.rb +3 -1
- data/lib/paru/filter/link.rb +3 -1
- data/lib/paru/filter/list.rb +2 -0
- data/lib/paru/filter/list_attributes.rb +2 -0
- data/lib/paru/filter/markdown.rb +2 -0
- data/lib/paru/filter/math.rb +3 -1
- data/lib/paru/filter/meta.rb +3 -1
- data/lib/paru/filter/meta_blocks.rb +3 -1
- data/lib/paru/filter/meta_bool.rb +3 -1
- data/lib/paru/filter/meta_inlines.rb +3 -1
- data/lib/paru/filter/meta_list.rb +3 -1
- data/lib/paru/filter/meta_map.rb +3 -1
- data/lib/paru/filter/meta_string.rb +3 -1
- data/lib/paru/filter/meta_value.rb +4 -2
- data/lib/paru/filter/node.rb +2 -0
- data/lib/paru/filter/note.rb +3 -1
- data/lib/paru/filter/null.rb +3 -1
- data/lib/paru/filter/ordered_list.rb +3 -1
- data/lib/paru/filter/para.rb +3 -1
- data/lib/paru/filter/plain.rb +3 -1
- data/lib/paru/filter/quoted.rb +3 -1
- data/lib/paru/filter/raw_block.rb +3 -1
- data/lib/paru/filter/raw_inline.rb +3 -1
- data/lib/paru/filter/small_caps.rb +3 -1
- data/lib/paru/filter/soft_break.rb +3 -1
- data/lib/paru/filter/space.rb +3 -1
- data/lib/paru/filter/span.rb +3 -1
- data/lib/paru/filter/str.rb +3 -1
- data/lib/paru/filter/strikeout.rb +3 -1
- data/lib/paru/filter/strong.rb +3 -1
- data/lib/paru/filter/subscript.rb +3 -1
- data/lib/paru/filter/superscript.rb +3 -1
- data/lib/paru/filter/table.rb +3 -1
- data/lib/paru/filter/table_row.rb +2 -0
- data/lib/paru/filter/target.rb +2 -0
- data/lib/paru/filter/version.rb +2 -0
- data/lib/paru/pandoc.rb +2 -0
- data/lib/paru/pandoc_options.yaml +2 -0
- data/lib/paru/selector.rb +2 -0
- metadata +7 -3
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,12 +15,13 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
|
21
22
|
require_relative "./meta_value"
|
22
23
|
|
24
|
+
# MetaString String
|
23
25
|
class MetaString < MetaValue
|
24
26
|
end
|
25
27
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,13 +15,14 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
-
# MetaBlocks
|
18
|
+
#++
|
19
19
|
module Paru
|
20
20
|
module PandocFilter
|
21
21
|
|
22
22
|
require_relative "./node"
|
23
23
|
|
24
|
+
# MetaValue = MetaMap | MetaList | MetaBool | MetaString | MetaInlines |
|
25
|
+
# MetaBlocks
|
24
26
|
class MetaValue < Node
|
25
27
|
|
26
28
|
attr_accessor :value
|
data/lib/paru/filter/node.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,6 +15,7 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
17
19
|
module Paru
|
18
20
|
module PandocFilter
|
19
21
|
|
data/lib/paru/filter/note.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,13 +15,14 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
|
21
22
|
require_relative "./inline"
|
22
23
|
require_relative "./block"
|
23
24
|
|
25
|
+
# Note [Block]
|
24
26
|
class Note < Inline
|
25
27
|
def has_block?
|
26
28
|
true
|
data/lib/paru/filter/null.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./empty_block"
|
21
22
|
|
23
|
+
# Null
|
22
24
|
class Null < EmptyBlock
|
23
25
|
end
|
24
26
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,12 +15,13 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./list"
|
21
22
|
require_relative "./list_attributes"
|
22
23
|
|
24
|
+
# OrderedList ListAttributes [[Block]]
|
23
25
|
class OrderedList < List
|
24
26
|
attr_accessor :list_attributes
|
25
27
|
|
data/lib/paru/filter/para.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./block"
|
21
22
|
|
23
|
+
# Para [Inline]
|
22
24
|
class Para < Block
|
23
25
|
def initialize contents
|
24
26
|
super contents, true
|
data/lib/paru/filter/plain.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./block"
|
21
22
|
|
23
|
+
# Plain [Inline]
|
22
24
|
class Plain < Block
|
23
25
|
def initialize contents
|
24
26
|
super contents, true
|
data/lib/paru/filter/quoted.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./inline"
|
21
22
|
|
23
|
+
# Quoted QuoteType [Inline]
|
22
24
|
class Quoted < Inline
|
23
25
|
QUOTE_TYPE = ["SingleQuote", "DoubleQuote"]
|
24
26
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./block"
|
21
22
|
|
23
|
+
# RawBlock Format String
|
22
24
|
class RawBlock < Block
|
23
25
|
attr_accessor :format, :string
|
24
26
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,12 +15,13 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
|
21
22
|
require_relative "./inline"
|
22
23
|
|
24
|
+
# RawInline Format String
|
23
25
|
class RawInline < Inline
|
24
26
|
attr_accessor :format, :string
|
25
27
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./inline"
|
21
22
|
|
23
|
+
# SmallCaps [Inline]
|
22
24
|
class SmallCaps < Inline
|
23
25
|
end
|
24
26
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./empty_inline"
|
21
22
|
|
23
|
+
# SoftBreak
|
22
24
|
class SoftBreak < EmptyInline
|
23
25
|
end
|
24
26
|
end
|
data/lib/paru/filter/space.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./empty_inline"
|
21
22
|
|
23
|
+
# Space
|
22
24
|
class Space < EmptyInline
|
23
25
|
end
|
24
26
|
end
|
data/lib/paru/filter/span.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,13 +15,14 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
|
21
22
|
require_relative "./inline"
|
22
23
|
require_relative "./attr"
|
23
24
|
|
25
|
+
# Span Attr [Inline]
|
24
26
|
class Span < Inline
|
25
27
|
attr_accessor :attr
|
26
28
|
|
data/lib/paru/filter/str.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./inline"
|
21
22
|
|
23
|
+
# Str String
|
22
24
|
class Str < Inline
|
23
25
|
def initialize value
|
24
26
|
@string = value
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./inline"
|
21
22
|
|
23
|
+
# Strikeout [Inline]
|
22
24
|
class Strikeout < Inline
|
23
25
|
end
|
24
26
|
end
|
data/lib/paru/filter/strong.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./inline"
|
21
22
|
|
23
|
+
# Strong [Inline]
|
22
24
|
class Strong < Inline
|
23
25
|
end
|
24
26
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./inline"
|
21
22
|
|
23
|
+
# Subscript [Inline]
|
22
24
|
class Subscript < Inline
|
23
25
|
end
|
24
26
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,11 +15,12 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./inline"
|
21
22
|
|
23
|
+
# Superscript [Inline]
|
22
24
|
class Superscript < Inline
|
23
25
|
end
|
24
26
|
end
|
data/lib/paru/filter/table.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,7 +15,7 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
|
18
|
+
#++
|
18
19
|
module Paru
|
19
20
|
module PandocFilter
|
20
21
|
require_relative "./block"
|
@@ -23,6 +24,7 @@ module Paru
|
|
23
24
|
|
24
25
|
ALIGNMENTS = ["AlignLeft", "AlignRight", "AlignCenter", "AlignDefault"]
|
25
26
|
|
27
|
+
# Table [Inline] [Alignment] [Double] [TableCell] [[TableCell]]
|
26
28
|
class Table < Block
|
27
29
|
attr_accessor :caption, :alignment, :column_widths, :headers, :rows
|
28
30
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,6 +15,7 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
17
19
|
module Paru
|
18
20
|
module PandocFilter
|
19
21
|
require_relative "./block"
|
data/lib/paru/filter/target.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,6 +15,7 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
17
19
|
module Paru
|
18
20
|
module PandocFilter
|
19
21
|
|
data/lib/paru/filter/version.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#--
|
1
2
|
# Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
|
2
3
|
#
|
3
4
|
# This file is part of Paru
|
@@ -14,6 +15,7 @@
|
|
14
15
|
#
|
15
16
|
# You should have received a copy of the GNU General Public License
|
16
17
|
# along with Paru. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
17
19
|
module Paru
|
18
20
|
module PandocFilter
|
19
21
|
require_relative "./node"
|