natour 0.8.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +23 -0
- data/README.adoc +1 -0
- data/bin/natour +6 -3
- data/lib/natour/asciinurse.rb +16 -7
- data/lib/natour/data/js/loader.js +6 -6
- data/lib/natour/data/themes/natour-theme.yml +3 -1
- data/lib/natour/map_geo_admin.rb +64 -49
- data/lib/natour/utils/errno_utils.rb +3 -1
- data/lib/natour/version.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: c05b80ae3025c95c49b590b0356f88f8217503a33afde1a879c7c2490ffc10c5
|
4
|
+
data.tar.gz: 7ff5fbd624b347de6c605e0eb7d83dc7face9b2d5a6bf8fa293c3ffe6963190d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dce357c6e74546c484ab06ce83f5aab0cf2782ccdf2711d788e6cd155813c0b19397ceb1c8754b11307fbe15f3ae4dc67fdd1b6f7a313e9038d4ecbe04ab193
|
7
|
+
data.tar.gz: 1cd2542ec0a0761b275b4bc9b27a270354af178beba158bcb7896aa652ebb8c39795abae62afb80827778bbcd22088f4e466f205a51466b77c0fcfe60cbfaf62
|
data/CHANGELOG.adoc
CHANGED
@@ -6,6 +6,29 @@ The format is based on https://keepachangelog.com/en/1.0.0/[Keep a Changelog^],
|
|
6
6
|
|
7
7
|
== Unreleased
|
8
8
|
|
9
|
+
== 0.10.0 - 2023-02-18
|
10
|
+
|
11
|
+
=== Fixed
|
12
|
+
|
13
|
+
- Prevent orphaned section titles and table captions in PDF output.
|
14
|
+
+
|
15
|
+
IMPORTANT: This is a breaking change for existing AsciiDoc files that are converted again. Apply the breakable option to tables containing species lists; otherwise the numbering of the tables will not be consecutive.
|
16
|
+
|
17
|
+
== 0.9.0 - 2022-10-08
|
18
|
+
|
19
|
+
=== Added
|
20
|
+
|
21
|
+
- Support colors for GPS tracks, waypoints and routes (`natour map create` command only).
|
22
|
+
|
23
|
+
=== Changed
|
24
|
+
|
25
|
+
- Omit empty columns of species lists in AsciiDoc output.
|
26
|
+
|
27
|
+
=== Fixed
|
28
|
+
|
29
|
+
- Fix inconsistent handling of file errors in the command line interface.
|
30
|
+
- Fix the creation of map images.
|
31
|
+
|
9
32
|
== 0.8.0 - 2022-04-22
|
10
33
|
|
11
34
|
=== Added
|
data/README.adoc
CHANGED
data/bin/natour
CHANGED
@@ -35,7 +35,7 @@ class NatourCmd < Clamp::Command
|
|
35
35
|
map_layers: map_layers || config[:map_layers],
|
36
36
|
adoc_author: adoc_author || config[:adoc_author]
|
37
37
|
)
|
38
|
-
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES, Errno::EINVAL => e
|
38
|
+
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES, Errno::EISDIR, Errno::EINVAL => e
|
39
39
|
message, _, path = Natour::ErrnoUtils.split_message(e)
|
40
40
|
abort("ERROR: #{message} '#{path}'")
|
41
41
|
end
|
@@ -66,7 +66,7 @@ class NatourCmd < Clamp::Command
|
|
66
66
|
draft_backend: draft_backend || config[:draft_backend],
|
67
67
|
image_maxdim: image_maxdim || config[:image_maxdim]
|
68
68
|
)
|
69
|
-
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES, Errno::EISDIR => e
|
69
|
+
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES, Errno::EISDIR, Errno::EINVAL => e
|
70
70
|
message, _, path = Natour::ErrnoUtils.split_message(e)
|
71
71
|
abort("ERROR: #{message} '#{path}'")
|
72
72
|
end
|
@@ -86,6 +86,7 @@ class NatourCmd < Clamp::Command
|
|
86
86
|
option(%w[-d --out-dir], 'DIR', 'Output directory')
|
87
87
|
option(%w[-f --out-file], 'FILE', 'Output filename')
|
88
88
|
option(%W[--\[no-\]overwrite], :flag, 'Overwrite existing files')
|
89
|
+
option(%w[--gps-colors], 'COLORS', 'Colors for elements from GPS files') { |s| s.split(',') }
|
89
90
|
option(%w[--map-layers], 'LAYERS', 'Add additional layers to map images') { |s| s.split(',') }
|
90
91
|
option(%w[--image-size], 'WIDTH,HEIGHT', 'Image size') do |s|
|
91
92
|
s.split(',', 2).map { |v| Integer(v) }
|
@@ -101,11 +102,12 @@ class NatourCmd < Clamp::Command
|
|
101
102
|
filename,
|
102
103
|
overwrite: Natour::BooleanUtils.to_boolean(overwrite?, default_value: config[:overwrite]),
|
103
104
|
gps_files: paths,
|
105
|
+
gps_colors: gps_colors || config[:gps_colors],
|
104
106
|
map_layers: map_layers || config[:map_layers],
|
105
107
|
image_size: image_size || config[:image_size]
|
106
108
|
)
|
107
109
|
end
|
108
|
-
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES => e
|
110
|
+
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES, Errno::EISDIR, Errno::EINVAL => e
|
109
111
|
message, _, path = Natour::ErrnoUtils.split_message(e)
|
110
112
|
abort("ERROR: #{message} '#{path}'")
|
111
113
|
end
|
@@ -151,6 +153,7 @@ config = Natour::Config.load_file(
|
|
151
153
|
out_dir: nil,
|
152
154
|
out_file: nil,
|
153
155
|
overwrite: false,
|
156
|
+
gps_colors: [],
|
154
157
|
map_layers: [],
|
155
158
|
image_size: [1200, 900]
|
156
159
|
}
|
data/lib/natour/asciinurse.rb
CHANGED
@@ -97,14 +97,18 @@ module Natour
|
|
97
97
|
OpenStruct.new(
|
98
98
|
group: :plants,
|
99
99
|
title: 'Pflanzenarten',
|
100
|
-
|
101
|
-
|
100
|
+
columns: [
|
101
|
+
OpenStruct.new(header: 'Wissenschaftlicher Name', accessor: :name),
|
102
|
+
OpenStruct.new(header: 'Deutscher Name', accessor: :name_de)
|
103
|
+
]
|
102
104
|
),
|
103
105
|
OpenStruct.new(
|
104
106
|
group: :birds,
|
105
107
|
title: 'Vogelarten',
|
106
|
-
|
107
|
-
|
108
|
+
columns: [
|
109
|
+
OpenStruct.new(header: 'Deutscher Name', accessor: :name_de),
|
110
|
+
OpenStruct.new(header: 'Wissenschaftlicher Name', accessor: :name)
|
111
|
+
]
|
108
112
|
)
|
109
113
|
].each do |info|
|
110
114
|
group = groups.fetch(info.group, [])
|
@@ -115,13 +119,18 @@ module Natour
|
|
115
119
|
group.each do |species_list|
|
116
120
|
caption = '.Tabelle {counter:species_lists}'
|
117
121
|
caption << ": #{species_list.description}" if species_list.description
|
122
|
+
columns = info.columns.select do |column|
|
123
|
+
species_list.any? { |species| !species.public_send(column.accessor).nil? }
|
124
|
+
end
|
125
|
+
cols = [1] + [5 * info.columns.size / columns.size] * columns.size
|
118
126
|
doc << caption
|
119
|
-
doc <<
|
127
|
+
doc << "[%breakable,cols=\"#{cols.join(',')}\",options=header]"
|
120
128
|
doc << '|==='
|
121
|
-
doc << "|Nr.|#{
|
129
|
+
doc << "|Nr.|#{columns.map(&:header).join('|')}"
|
122
130
|
species_list.each do |species|
|
123
131
|
doc <<
|
124
|
-
"|{counter:species_list#{index}}|#{
|
132
|
+
"|{counter:species_list#{index}}|#{columns.map { |column| species.public_send(column.accessor) }
|
133
|
+
.join('|')}"
|
125
134
|
end
|
126
135
|
doc << '|==='
|
127
136
|
doc << ''
|