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
- # MetaString String
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
- # MetaValue = MetaMap | MetaList | MetaBool | MetaString | MetaInlines |
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
@@ -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,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
- # Note [Block]
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
@@ -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
- # Null
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
- # OrderedList ListAttributes [[Block]]
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
 
@@ -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
- # Para [Inline]
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
@@ -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
- # Plain [Inline]
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
@@ -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
- # Quoted QuoteType [Inline]
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
- # RawBlock Format String
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
- # RawInline Format String
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
- # SmallCaps [Inline]
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
- # SoftBreak
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
@@ -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
- # Space
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
@@ -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
- # Span Attr [Inline]
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
 
@@ -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
- # Str String
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
- # Strikeout [Inline]
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
@@ -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
- # Strong [Inline]
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
- # Subscript [Inline]
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
- # Superscript [Inline]
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
@@ -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
- # Table [Inline] [Alignment] [Double] [TableCell] [[TableCell]]
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"
@@ -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,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"