paru 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/bin/do-pandoc.rb +64 -0
  3. data/bin/pandoc2yaml.rb +94 -0
  4. data/lib/paru.rb +26 -10
  5. data/lib/paru/error.rb +7 -0
  6. data/lib/paru/filter.rb +35 -0
  7. data/lib/paru/filter/alignment.rb +2 -0
  8. data/lib/paru/filter/ast_manipulation.rb +2 -0
  9. data/lib/paru/filter/attr.rb +2 -0
  10. data/lib/paru/filter/block.rb +2 -0
  11. data/lib/paru/filter/block_quote.rb +3 -1
  12. data/lib/paru/filter/bullet_list.rb +3 -1
  13. data/lib/paru/filter/citation.rb +2 -0
  14. data/lib/paru/filter/cite.rb +3 -1
  15. data/lib/paru/filter/code.rb +3 -1
  16. data/lib/paru/filter/code_block.rb +3 -1
  17. data/lib/paru/filter/definition_list.rb +3 -1
  18. data/lib/paru/filter/definition_list_item.rb +2 -0
  19. data/lib/paru/filter/div.rb +3 -1
  20. data/lib/paru/filter/document.rb +2 -0
  21. data/lib/paru/filter/emph.rb +3 -1
  22. data/lib/paru/filter/empty_block.rb +2 -0
  23. data/lib/paru/filter/empty_inline.rb +2 -0
  24. data/lib/paru/filter/header.rb +3 -1
  25. data/lib/paru/filter/horizontal_rule.rb +3 -1
  26. data/lib/paru/filter/image.rb +3 -1
  27. data/lib/paru/filter/inline.rb +2 -0
  28. data/lib/paru/filter/line_block.rb +3 -1
  29. data/lib/paru/filter/line_break.rb +3 -1
  30. data/lib/paru/filter/link.rb +3 -1
  31. data/lib/paru/filter/list.rb +2 -0
  32. data/lib/paru/filter/list_attributes.rb +2 -0
  33. data/lib/paru/filter/markdown.rb +2 -0
  34. data/lib/paru/filter/math.rb +3 -1
  35. data/lib/paru/filter/meta.rb +3 -1
  36. data/lib/paru/filter/meta_blocks.rb +3 -1
  37. data/lib/paru/filter/meta_bool.rb +3 -1
  38. data/lib/paru/filter/meta_inlines.rb +3 -1
  39. data/lib/paru/filter/meta_list.rb +3 -1
  40. data/lib/paru/filter/meta_map.rb +3 -1
  41. data/lib/paru/filter/meta_string.rb +3 -1
  42. data/lib/paru/filter/meta_value.rb +4 -2
  43. data/lib/paru/filter/node.rb +2 -0
  44. data/lib/paru/filter/note.rb +3 -1
  45. data/lib/paru/filter/null.rb +3 -1
  46. data/lib/paru/filter/ordered_list.rb +3 -1
  47. data/lib/paru/filter/para.rb +3 -1
  48. data/lib/paru/filter/plain.rb +3 -1
  49. data/lib/paru/filter/quoted.rb +3 -1
  50. data/lib/paru/filter/raw_block.rb +3 -1
  51. data/lib/paru/filter/raw_inline.rb +3 -1
  52. data/lib/paru/filter/small_caps.rb +3 -1
  53. data/lib/paru/filter/soft_break.rb +3 -1
  54. data/lib/paru/filter/space.rb +3 -1
  55. data/lib/paru/filter/span.rb +3 -1
  56. data/lib/paru/filter/str.rb +3 -1
  57. data/lib/paru/filter/strikeout.rb +3 -1
  58. data/lib/paru/filter/strong.rb +3 -1
  59. data/lib/paru/filter/subscript.rb +3 -1
  60. data/lib/paru/filter/superscript.rb +3 -1
  61. data/lib/paru/filter/table.rb +3 -1
  62. data/lib/paru/filter/table_row.rb +2 -0
  63. data/lib/paru/filter/target.rb +2 -0
  64. data/lib/paru/filter/version.rb +2 -0
  65. data/lib/paru/pandoc.rb +2 -0
  66. data/lib/paru/pandoc_options.yaml +2 -0
  67. data/lib/paru/selector.rb +2 -0
  68. 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
- # Code Attr String
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./inline"
21
22
  require_relative "./attr"
22
23
 
24
+ # Code Attr String
23
25
  class Code < Inline
24
26
  attr_accessor :attr, :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,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
- # CodeBlock Attr String
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./block"
21
22
  require_relative "./attr"
22
23
 
24
+ # CodeBlock Attr String
23
25
  class CodeBlock < Block
24
26
  attr_accessor :attr, :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
- # DefinitionList [([Inline], [[Block]])]
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./block"
21
22
 
23
+ # DefinitionList [([Inline], [[Block]])]
22
24
  class DefinitionList < Block
23
25
  def initialize contents
24
26
  super []
@@ -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"
@@ -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
- # Div Attr [Block]
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./block"
21
22
  require_relative "./attr"
22
23
 
24
+ # Div Attr [Block]
23
25
  class Div < Block
24
26
  def initialize contents
25
27
  @attr = Attr.new contents[0]
@@ -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
 
@@ -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
- # Emph [Inline]
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./inline"
21
22
 
23
+ # Emph [Inline]
22
24
  class Emph < 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,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"
@@ -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 "./inline"
@@ -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
- # Header Int Attr [Inline]
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./block"
21
22
  require_relative "./attr"
22
23
 
24
+ # Header Int Attr [Inline]
23
25
  class Header < Block
24
26
  attr_accessor :level, :attr
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
- # HorizontalRule
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./empty_block"
21
22
 
23
+ # HorizontalRule
22
24
  class HorizontalRule < 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
- # Image Attr [Inline] Target
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
 
21
22
  require_relative "./link"
22
23
 
24
+ # Image Attr [Inline] Target
23
25
  class Image < Link
24
26
  # Although Image is defined to be inline, probably because in HTML it
25
27
  # can be an inline element, often it acts like a block element.
@@ -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"
@@ -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
- # LineBlock [[Inline]]
18
+ #--
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./list.rb"
21
22
 
23
+ # LineBlock [[Inline]]
22
24
  class LineBlock < List
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
- # LineBreak
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./empty_inline"
21
22
 
23
+ # LineBreak
22
24
  class LineBreak < EmptyInline
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,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
- # Link Attr [Inline] Target
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
 
@@ -22,6 +23,7 @@ module Paru
22
23
  require_relative "./attr"
23
24
  require_relative "./target"
24
25
 
26
+ # Link Attr [Inline] Target
25
27
  class Link < Inline
26
28
  attr_accessor :attr, :target
27
29
 
@@ -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"
@@ -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
  class ListAttributes
@@ -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
  module Markdown
@@ -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
- # Math MathType String
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./inline"
21
22
 
23
+ # Math MathType String
22
24
  class Math < Inline
23
25
  attr_accessor :math_type, :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,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
- # Meta is a MetaMap
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
  require_relative "./meta_map"
21
22
 
23
+ # Meta is a MetaMap
22
24
  class Meta < MetaMap
23
25
  include Enumerable
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
- # MetaBlocks [Blocks]
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
 
21
22
  require_relative "./node"
22
23
 
24
+ # MetaBlocks [Blocks]
23
25
  class MetaBlocks < Node
24
26
 
25
27
  def initialize 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,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
- # MetaBool Bool
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
 
21
22
  require_relative "./meta_value"
22
23
 
24
+ # MetaBool Bool
23
25
  class MetaBool < 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,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
- # MetaInlines [Inline]
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
 
21
22
  require_relative "./node"
22
23
 
24
+ # MetaInlines [Inline]
23
25
  class MetaInlines < Node
24
26
 
25
27
  def initialize 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,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
- # MetaList [MetaValue]
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
 
21
22
  require_relative "./node"
22
23
 
24
+ # MetaList [MetaValue]
23
25
  class MetaList < Node
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,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
- # MetaMap (M.Map String MetaValue)
18
+ #++
18
19
  module Paru
19
20
  module PandocFilter
20
21
 
21
22
  require_relative "./node"
22
23
 
24
+ # MetaMap (M.Map String MetaValue)
23
25
  class MetaMap < Node
24
26
 
25
27
  def initialize contents