paru 0.4.2 → 0.4.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paru/filter/metadata.rb +1 -1
- data/lib/paru/filter/table.rb +5 -5
- data/lib/paru/pandoc.rb +16 -19
- data/lib/paru/pandoc_options_version_2.yaml +7 -5
- data/lib/paru.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90995074101bc9a2a14e72b9e32e319ab836cf545568927f8f554939e8a7f50e
|
4
|
+
data.tar.gz: 2f2d91f0e45c27cae4df32267a0a98511ccfbcf28cec29f1ed0b9318de9ee5c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02ec89f731646faf0e0731b0fc903a5ffa6145a75b24ba01a45d13670b33709e23ee86ba571abcf813f0d9201ccdb4fccf40cc619c393832770c72c7b67b35cf
|
7
|
+
data.tar.gz: 4e168c11e2209cee4d108db0be97f0c24e5dcc7a59da1fe5643654b7879ad43eb33929ac33dbe1cfd10b19cde9a196b812009495b0700c0df5b7656e09b9525e
|
data/lib/paru/filter/metadata.rb
CHANGED
data/lib/paru/filter/table.rb
CHANGED
@@ -86,7 +86,7 @@ module Paru
|
|
86
86
|
#
|
87
87
|
# @return [String[][]] This Table as a 2D array of cells
|
88
88
|
# represented by their markdown strings.
|
89
|
-
def to_array(
|
89
|
+
def to_array(config = {})
|
90
90
|
headers = if config.has_key? :headers then config[:headers] else false end
|
91
91
|
footers = if config.has_key? :footers then config[:footers] else false end
|
92
92
|
|
@@ -111,9 +111,9 @@ module Paru
|
|
111
111
|
#
|
112
112
|
# @param filename [String] filename to write to
|
113
113
|
# @param config [Hash] See #to_array for config options
|
114
|
-
def to_file(filename,
|
114
|
+
def to_file(filename, config = {})
|
115
115
|
CSV.open(filename, "wb") do |csv|
|
116
|
-
to_array(config).each {|row| csv << row}
|
116
|
+
to_array(**config).each {|row| csv << row}
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
@@ -130,7 +130,7 @@ module Paru
|
|
130
130
|
# default to false.
|
131
131
|
#
|
132
132
|
# @return [Table]
|
133
|
-
def self.from_array(data,
|
133
|
+
def self.from_array(data, config = {})
|
134
134
|
# With the updated Table definition, it has become complicated
|
135
135
|
# to construct a table manually. It has gotten easier to just
|
136
136
|
# construct a string containing a table in Pandoc's markdown and
|
@@ -180,7 +180,7 @@ module Paru
|
|
180
180
|
# @param config [Hash] See #from_file for details
|
181
181
|
#
|
182
182
|
# @return [Table]
|
183
|
-
def self.from_file(filename,
|
183
|
+
def self.from_file(filename, config = {})
|
184
184
|
data = []
|
185
185
|
CSV.foreach(filename) do |row|
|
186
186
|
data << row
|
data/lib/paru/pandoc.rb
CHANGED
@@ -230,26 +230,23 @@ module Paru
|
|
230
230
|
.match(/pandoc.* (\d+\.\d+.*)$/)[1]
|
231
231
|
.split(".")
|
232
232
|
.map {|s| s.to_i}
|
233
|
-
major_version
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
else
|
248
|
-
# Neither data directory exists, default to the new default
|
249
|
-
data_dir = xdg_data_dir
|
250
|
-
end
|
233
|
+
major_version = version[0]
|
234
|
+
|
235
|
+
# Pandoc version 2.7 introduced a new default data dir to comply
|
236
|
+
# with XDG Base Directory Specification
|
237
|
+
|
238
|
+
xdg_data_dir, old_data_dir = version_string.match(/User data directory: (.+)$/)[1].split(" or ")
|
239
|
+
|
240
|
+
if File.directory? xdg_data_dir then
|
241
|
+
data_dir = xdg_data_dir
|
242
|
+
elsif not old_data_dir.nil? and File.directory? old_data_dir then
|
243
|
+
# The new-style data directory does not exist, but the
|
244
|
+
# old-style does, so use the old-style data directory for
|
245
|
+
# backwards compatibility
|
246
|
+
data_dir = old_data_dir
|
251
247
|
else
|
252
|
-
|
248
|
+
# Neither data directory exists, default to the new default
|
249
|
+
data_dir = xdg_data_dir
|
253
250
|
end
|
254
251
|
|
255
252
|
@@info = {
|
@@ -44,8 +44,10 @@ help: true
|
|
44
44
|
# General reader options:
|
45
45
|
#####
|
46
46
|
shift_heading_level_by: 1
|
47
|
+
base_header_level: 1
|
48
|
+
strip_empty_paragraphs: true
|
47
49
|
indented_code_classes: ""
|
48
|
-
default_image_extension: ""
|
50
|
+
default_image_extension: "png"
|
49
51
|
file_scope: true
|
50
52
|
filter: [""]
|
51
53
|
lua_filter: [""]
|
@@ -59,6 +61,7 @@ abbreviations: ""
|
|
59
61
|
#####
|
60
62
|
# General writing options:
|
61
63
|
#####
|
64
|
+
sandbox: false
|
62
65
|
standalone: true
|
63
66
|
template: ""
|
64
67
|
variable: [""]
|
@@ -68,7 +71,6 @@ eol: "native"
|
|
68
71
|
dpi: 96
|
69
72
|
wrap: "auto"
|
70
73
|
columns: 78
|
71
|
-
strip_comments: true
|
72
74
|
toc: true
|
73
75
|
table_of_contents: true
|
74
76
|
toc_depth: 3
|
@@ -91,7 +93,8 @@ html_q_tags: true
|
|
91
93
|
ascii: true
|
92
94
|
reference_links: true
|
93
95
|
reference_location: "block"
|
94
|
-
|
96
|
+
markdown_headings: "atx"
|
97
|
+
atx_headers: false
|
95
98
|
top_level_division: "section"
|
96
99
|
number_sections: true
|
97
100
|
number_offset: 2
|
@@ -99,7 +102,6 @@ listings: true
|
|
99
102
|
incremental: true
|
100
103
|
slide_level: 1
|
101
104
|
section_divs: true
|
102
|
-
default_image_extension: "png"
|
103
105
|
email_obfuscation: "none"
|
104
106
|
id_prefix: ""
|
105
107
|
title_prefix: ""
|
@@ -119,7 +121,7 @@ pdf_engine_opt: [""]
|
|
119
121
|
citeproc: true
|
120
122
|
bibliography: ""
|
121
123
|
csl: ""
|
122
|
-
citation_abbreviations:
|
124
|
+
citation_abbreviations: ""
|
123
125
|
natbib: true
|
124
126
|
biblatex: true
|
125
127
|
#####
|
data/lib/paru.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.2
|
4
|
+
version: 0.4.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Huub de Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Control pandoc with Ruby and write pandoc filters in Ruby
|
14
14
|
email: Huub@heerdebeer.org
|
@@ -110,14 +110,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
110
|
requirements:
|
111
111
|
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version:
|
113
|
+
version: 2.6.8
|
114
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - ">="
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
|
-
rubygems_version: 3.
|
120
|
+
rubygems_version: 3.2.22
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: Paru is a ruby wrapper around pandoc
|