intranet-pandoc 1.0.0 → 1.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e9ba0d93e05f580d6620fe156202f62fe7a5ed1c4c8f86ecc412204beccff24
4
- data.tar.gz: dee2cfa108cfd44b4442909185c8c613d277c5ba8115059218b2fb8e2e5ba55b
3
+ metadata.gz: 3e765fb6977495e6c6c4fc2454c4c234d199a8b358d2c7b2d068a20ce750ff51
4
+ data.tar.gz: '015036219169d3b77bca191f7e3c23874a7183001631af2cfb58c6e33ab69491'
5
5
  SHA512:
6
- metadata.gz: 97a49825a5b70100d6243910bb473cf24ad4e3aae58acc95a5deadf3b13125daf8d0e1579b89c9fb6bb287cd44203ff86600d39d56f774797845657c1f3e769a
7
- data.tar.gz: 661e974bb3aaf1607fee00cc193b8e53ef454965bcbb4bc88362d03c7da5adab00422a39a448d7c20c59c7cf7d6c5ac8c2a1364b898ae341cc1d7a9c2b88104e
6
+ metadata.gz: d911ab82325c6477729f1ce056693f584f908a3180eab3dd9ab832c0f9ef6b1e381a3ced1ab99e0f6001a98cff14e79c0ecb85906fa412b6ee1fa069150354a5
7
+ data.tar.gz: 903169d676b9f6a647e3a31f749a3f43fbb8505821b4a13fb165d592886857b591526786c0504213ca6ac6e62e555eb81a1c08e7def514d96af5cbcc71a73957
@@ -63,7 +63,7 @@ module Intranet
63
63
  def generate_page(path, query)
64
64
  case path
65
65
  when %r{^/.+\.html$} then serve_page(path.gsub(%r{^/(.+)\.html$}, '\\1'))
66
- when %r{^/.+\.(jpg|png)$} then serve_media(path.gsub(%r{^/(.+)$}, '\\1'))
66
+ when %r{^/.+\.(jpg|png|svg)$} then serve_media(path.gsub(%r{^/(.+)$}, '\\1'))
67
67
  else super(path, query)
68
68
  end
69
69
  end
@@ -87,7 +87,7 @@ module Intranet
87
87
  end
88
88
 
89
89
  # Provides the list of Lua filters to be passed to Pandoc when converting mardown to HTML.
90
- # @return [Array<String>] The list of Lua filters, relative to the .
90
+ # @return [Array<String>] The list of Lua filters.
91
91
  def lua_filters
92
92
  [
93
93
  File.join(resources_dir, 'filters', 'titles-shift-levels.lua'),
@@ -104,7 +104,7 @@ module Intranet
104
104
  # and without extension.
105
105
  # @raise [RuntimeError] If pandoc fails for whatever reason.
106
106
  def convert_to_html(path)
107
- input = "\"#{File.join(@rootdir, "#{path}.md")}\""
107
+ input = File.join(@rootdir, "#{path}.md")
108
108
  filters = lua_filters.map { |filter| "--lua-filter=\"#{filter}\"" }
109
109
  options = ['--standalone', "--template=\"#{@template}\""] unless @template.to_s.empty?
110
110
  PandocRuby.new([input], filters, options).to_html
@@ -8,7 +8,7 @@ module Intranet
8
8
  NAME = 'intranet-pandoc'
9
9
 
10
10
  # The version of the gem, according to semantic versionning.
11
- VERSION = '1.0.0'
11
+ VERSION = '1.1.0'
12
12
 
13
13
  # The URL of the gem homepage.
14
14
  HOMEPAGE_URL = 'https://rubygems.org/gems/intranet-pandoc'
@@ -9,7 +9,7 @@ figure {
9
9
  text-align: center;
10
10
  }
11
11
 
12
- figure > img, p img {
12
+ figure img, p img {
13
13
  max-width: 100%;
14
14
  }
15
15
 
@@ -112,8 +112,8 @@ RSpec.describe Intranet::Pandoc::Responder do
112
112
  "<ul>\n" \
113
113
  "<li><a href=\"index.html\">relative internal links</a></li>\n" \
114
114
  "<li><a href=\"/index.html\">absolute internal links</a></li>\n" \
115
- "<li><a href=\"http://example.com\" target=\"_blank\">HTTP external links</a></li>\n" \
116
- "<li><a href=\"https://example.com\" target=\"_blank\">HTTPS external links</a></li>\n" \
115
+ "<li><a href=\"http://example.com\" target=\"_blank\">HTTP external\nlinks</a></li>\n" \
116
+ "<li><a href=\"https://example.com\" target=\"_blank\">HTTPS external\nlinks</a></li>\n" \
117
117
  "</ul>\n" \
118
118
  '</section>',
119
119
  title: 'TITLE',
@@ -171,6 +171,12 @@ RSpec.describe Intranet::Pandoc::Responder do
171
171
  expect(code).to eql(200)
172
172
  expect(mime).to eql('image/png')
173
173
  expect(content).to eql(File.read(File.join(__dir__, 'testroot', 'alpha.png')))
174
+
175
+ # SVG file
176
+ code, mime, content = @responder.generate_page('/decimal.svg', {})
177
+ expect(code).to eql(200)
178
+ expect(mime).to eql('image/svg+xml')
179
+ expect(content).to eql(File.read(File.join(__dir__, 'testroot', 'decimal.svg')))
174
180
  end
175
181
  end
176
182
 
@@ -0,0 +1,3 @@
1
+ <svg viewBox='0 0 125 80' xmlns='http://www.w3.org/2000/svg'>
2
+ <text y="75" font-size="100" font-family="serif"><![CDATA[10]]></text>
3
+ </svg>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intranet-pandoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ebling Mis
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-27 00:00:00.000000000 Z
11
+ date: 2023-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: intranet-core
@@ -64,77 +64,7 @@ dependencies:
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
66
  version: 2.1.0
67
- - !ruby/object:Gem::Dependency
68
- name: rake
69
- requirement: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - "~>"
72
- - !ruby/object:Gem::Version
73
- version: '13.0'
74
- type: :development
75
- prerelease: false
76
- version_requirements: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - "~>"
79
- - !ruby/object:Gem::Version
80
- version: '13.0'
81
- - !ruby/object:Gem::Dependency
82
- name: rspec
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - "~>"
86
- - !ruby/object:Gem::Version
87
- version: '3.0'
88
- type: :development
89
- prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - "~>"
93
- - !ruby/object:Gem::Version
94
- version: '3.0'
95
- - !ruby/object:Gem::Dependency
96
- name: rubocop
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: '1.0'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: '1.0'
109
- - !ruby/object:Gem::Dependency
110
- name: simplecov
111
- requirement: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: '0.21'
116
- type: :development
117
- prerelease: false
118
- version_requirements: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
121
- - !ruby/object:Gem::Version
122
- version: '0.21'
123
- - !ruby/object:Gem::Dependency
124
- name: yard
125
- requirement: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - "~>"
128
- - !ruby/object:Gem::Version
129
- version: '0.0'
130
- type: :development
131
- prerelease: false
132
- version_requirements: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - "~>"
135
- - !ruby/object:Gem::Version
136
- version: '0.0'
137
- description:
67
+ description:
138
68
  email: ebling.mis@protonmail.com
139
69
  executables: []
140
70
  extensions: []
@@ -147,6 +77,7 @@ files:
147
77
  - lib/intranet/resources/www/style.css
148
78
  - spec/intranet/pandoc/responder_spec.rb
149
79
  - spec/intranet/pandoc/testroot/alpha.png
80
+ - spec/intranet/pandoc/testroot/decimal.svg
150
81
  - spec/intranet/pandoc/testroot/filters/test-links-open-external-in-new-tab.md
151
82
  - spec/intranet/pandoc/testroot/filters/test-titles-shift-levels.md
152
83
  - spec/intranet/pandoc/testroot/index.md
@@ -158,7 +89,7 @@ licenses:
158
89
  - MIT
159
90
  metadata:
160
91
  source_code_uri: https://bitbucket.org/ebling-mis/intranet-pandoc
161
- post_install_message:
92
+ post_install_message:
162
93
  rdoc_options: []
163
94
  require_paths:
164
95
  - lib
@@ -166,15 +97,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
97
  requirements:
167
98
  - - "~>"
168
99
  - !ruby/object:Gem::Version
169
- version: '2.5'
100
+ version: '3.0'
170
101
  required_rubygems_version: !ruby/object:Gem::Requirement
171
102
  requirements:
172
103
  - - ">="
173
104
  - !ruby/object:Gem::Version
174
105
  version: '0'
175
106
  requirements: []
176
- rubygems_version: 3.2.5
177
- signing_key:
107
+ rubygems_version: 3.3.15
108
+ signing_key:
178
109
  specification_version: 4
179
110
  summary: Pandoc module for the intranet.
180
111
  test_files: []