paru 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/lib/paru.rb +16 -0
  3. data/lib/paru/error.rb +16 -0
  4. data/lib/paru/filter.rb +17 -1
  5. data/lib/paru/filter/alignment.rb +16 -0
  6. data/lib/paru/filter/ast_manipulation.rb +16 -0
  7. data/lib/paru/filter/attr.rb +16 -0
  8. data/lib/paru/filter/block.rb +16 -0
  9. data/lib/paru/filter/block_quote.rb +16 -0
  10. data/lib/paru/filter/bullet_list.rb +16 -0
  11. data/lib/paru/filter/citation.rb +16 -0
  12. data/lib/paru/filter/cite.rb +16 -0
  13. data/lib/paru/filter/code.rb +16 -0
  14. data/lib/paru/filter/code_block.rb +16 -0
  15. data/lib/paru/filter/definition_list.rb +16 -0
  16. data/lib/paru/filter/definition_list_item.rb +16 -0
  17. data/lib/paru/filter/div.rb +16 -0
  18. data/lib/paru/filter/document.rb +17 -1
  19. data/lib/paru/filter/emph.rb +16 -0
  20. data/lib/paru/filter/empty_block.rb +16 -0
  21. data/lib/paru/filter/empty_inline.rb +16 -0
  22. data/lib/paru/filter/header.rb +16 -0
  23. data/lib/paru/filter/horizontal_rule.rb +16 -0
  24. data/lib/paru/filter/image.rb +16 -0
  25. data/lib/paru/filter/inline.rb +16 -0
  26. data/lib/paru/filter/line_block.rb +16 -0
  27. data/lib/paru/filter/line_break.rb +16 -0
  28. data/lib/paru/filter/link.rb +16 -0
  29. data/lib/paru/filter/list.rb +16 -0
  30. data/lib/paru/filter/list_attributes.rb +16 -0
  31. data/lib/paru/filter/markdown.rb +18 -2
  32. data/lib/paru/filter/math.rb +16 -0
  33. data/lib/paru/filter/meta.rb +16 -0
  34. data/lib/paru/filter/meta_blocks.rb +16 -0
  35. data/lib/paru/filter/meta_bool.rb +16 -0
  36. data/lib/paru/filter/meta_inlines.rb +16 -0
  37. data/lib/paru/filter/meta_list.rb +16 -0
  38. data/lib/paru/filter/meta_map.rb +23 -0
  39. data/lib/paru/filter/meta_string.rb +16 -0
  40. data/lib/paru/filter/meta_value.rb +16 -0
  41. data/lib/paru/filter/node.rb +16 -0
  42. data/lib/paru/filter/note.rb +16 -0
  43. data/lib/paru/filter/null.rb +16 -0
  44. data/lib/paru/filter/ordered_list.rb +16 -0
  45. data/lib/paru/filter/para.rb +16 -0
  46. data/lib/paru/filter/plain.rb +16 -0
  47. data/lib/paru/filter/quoted.rb +16 -0
  48. data/lib/paru/filter/raw_block.rb +16 -0
  49. data/lib/paru/filter/raw_inline.rb +16 -0
  50. data/lib/paru/filter/small_caps.rb +16 -0
  51. data/lib/paru/filter/soft_break.rb +16 -0
  52. data/lib/paru/filter/space.rb +16 -0
  53. data/lib/paru/filter/span.rb +16 -0
  54. data/lib/paru/filter/str.rb +16 -0
  55. data/lib/paru/filter/strikeout.rb +16 -0
  56. data/lib/paru/filter/strong.rb +16 -0
  57. data/lib/paru/filter/subscript.rb +16 -0
  58. data/lib/paru/filter/superscript.rb +16 -0
  59. data/lib/paru/filter/table.rb +16 -0
  60. data/lib/paru/filter/table_row.rb +16 -0
  61. data/lib/paru/filter/target.rb +16 -0
  62. data/lib/paru/filter/version.rb +16 -0
  63. data/lib/paru/pandoc.rb +16 -0
  64. data/lib/paru/pandoc_options.yaml +16 -0
  65. data/lib/paru/selector.rb +16 -0
  66. metadata +2 -2
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # Header Int Attr [Inline]
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # HorizontalRule
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # Image Attr [Inline] Target
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  module Paru
2
18
  module PandocFilter
3
19
  require_relative "./node"
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # LineBlock [[Inline]]
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # LineBreak
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # Link Attr [Inline] Target
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  module Paru
2
18
  module PandocFilter
3
19
  require_relative "./block"
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  module Paru
2
18
  module PandocFilter
3
19
  class ListAttributes
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  module Paru
2
18
  module PandocFilter
3
19
  module Markdown
@@ -17,7 +33,7 @@ module Paru
17
33
 
18
34
  def outer_markdown
19
35
  temp_doc = PandocFilter::Document.fragment [self]
20
- AST2MARKDOWN << temp_doc.to_json
36
+ AST2MARKDOWN << temp_doc.to_JSON
21
37
  end
22
38
 
23
39
  def outer_markdown= markdown
@@ -43,7 +59,7 @@ module Paru
43
59
 
44
60
  def inner_markdown
45
61
  temp_doc = PandocFilter::Document.fragment @children
46
- AST2MARKDOWN << temp_doc.to_json
62
+ AST2MARKDOWN << temp_doc.to_JSON
47
63
  end
48
64
 
49
65
  def inner_markdown= markdown
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # Math MathType String
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # Meta is a MetaMap
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # MetaBlocks [Blocks]
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # MetaBool Bool
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # MetaInlines [Inline]
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # MetaList [MetaValue]
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # MetaMap (M.Map String MetaValue)
2
18
  module Paru
3
19
  module PandocFilter
@@ -24,6 +40,13 @@ module Paru
24
40
  end
25
41
  end
26
42
 
43
+ def has_key? key
44
+ @children.has_key? key
45
+ end
46
+
47
+ def delete key
48
+ @children.delete key
49
+ end
27
50
 
28
51
  def ast_contents
29
52
  ast = Hash.new
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # MetaString String
2
18
  module Paru
3
19
  module PandocFilter
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  # MetaValue = MetaMap | MetaList | MetaBool | MetaString | MetaInlines |
2
18
  # MetaBlocks
3
19
  module Paru
@@ -1,3 +1,19 @@
1
+ # Copyright 2015, 2016 Huub de Beer <Huub@heerdebeer.org>
2
+ #
3
+ # This file is part of Paru
4
+ #
5
+ # Paru is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Paru is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Paru. If not, see <http://www.gnu.org/licenses/>.
1
17
  module Paru
2
18
  module PandocFilter
3
19