middleman-syntax 3.2.0 → 3.3.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: 2938584ddd836e4ce6674e01ad8eab8ac96d87f319261d1d642d0e1975d4d495
4
- data.tar.gz: 3fd48b680357a1c4fc8c965495e5540cce89910b0697bcfc68056602a4385180
3
+ metadata.gz: '069a5916deb149f37860dd78cd181278367e1ae343d4053e619d902e2fb3f87e'
4
+ data.tar.gz: 3e3e12eef81c32dfc9d683f8925e65d1fc22ed714b869880a8719acaf1c8e50a
5
5
  SHA512:
6
- metadata.gz: 693ec6000db5121c3e111e6d52c424c3cf9cff277f952b1c05485d25a60580b82b2ffd5ad782c98c61774d4245efa7fa46a28380068d4e62bdc16778b0cfbbb5
7
- data.tar.gz: 85be352460bc44e32b05f3d114da90ce9e620aeb996bb0582a43d14f9926de0aae58aaaee63342ee74235f758c260f8ea2b1bee42b8056bafff7a878969ec54f
6
+ metadata.gz: 98e67a62f908fa76c4588dbd32b39f1374831a944efd604794ee157a9693c45c87b657bcb7497d36c1d162fbd7928fd0e94549c3350b018685419554335222ce
7
+ data.tar.gz: 1e1c3c2dcf955bbe33b8ca8ffbacb77fcd96896123927971bba2fe3bdeb78a762bdaf53d5aae7ac799a1f5a7e19ea1c064438a3e15b3630d1390470133ce8f44
@@ -0,0 +1,19 @@
1
+ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/ruby/.devcontainer/base.Dockerfile
2
+
3
+ # [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.1, 3.0, 2, 2.7, 3-bullseye, 3.1-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 3-buster, 3.1-buster, 3.0-buster, 2-buster, 2.7-buster
4
+ ARG VARIANT="3.1-bullseye"
5
+ FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}
6
+
7
+ # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
8
+ ARG NODE_VERSION="none"
9
+ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
10
+
11
+ # [Optional] Uncomment this section to install additional OS packages.
12
+ # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
13
+ # && apt-get -y install --no-install-recommends <your-package-list-here>
14
+
15
+ # [Optional] Uncomment this line to install additional gems.
16
+ # RUN gem install <your-gem-names-here>
17
+
18
+ # [Optional] Uncomment this line to install global node packages.
19
+ # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
@@ -0,0 +1,37 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2
+ // https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/ruby
3
+ {
4
+ "name": "Ruby",
5
+ "build": {
6
+ "dockerfile": "Dockerfile",
7
+ "args": {
8
+ // Update 'VARIANT' to pick a Ruby version: 3, 3.1, 3.0, 2, 2.7
9
+ // Append -bullseye or -buster to pin to an OS version.
10
+ // Use -bullseye variants on local on arm64/Apple Silicon.
11
+ "VARIANT": "2.7",
12
+ // Options
13
+ "NODE_VERSION": "lts/*"
14
+ }
15
+ },
16
+
17
+ // Configure tool-specific properties.
18
+ "customizations": {
19
+ // Configure properties specific to VS Code.
20
+ "vscode": {
21
+ // Add the IDs of extensions you want installed when the container is created.
22
+ "extensions": [
23
+ "rebornix.Ruby"
24
+ ]
25
+ }
26
+ },
27
+
28
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
29
+ // "forwardPorts": [],
30
+
31
+ // Use 'postCreateCommand' to run commands after the container is created.
32
+ // "postCreateCommand": "ruby --version",
33
+
34
+ // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
35
+ "remoteUser": "vscode"
36
+
37
+ }
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ - Fixed HAML :code filter to remove trailing blank lines
2
+
1
3
  # 3.2.0
2
4
 
3
5
  - Prep for Middleman v5
@@ -11,3 +11,15 @@ Feature: Haml :code filter.
11
11
  When I go to "/code_haml_filter.html"
12
12
  Then I should see '<span class="k">def</span>'
13
13
  Then I should see '<pre class="highlight plaintext"><code>This is some code'
14
+
15
+ Scenario: Filter doesn't keep trailing blank lines
16
+ Given a fixture app "test-app"
17
+ And a file named "config.rb" with:
18
+ """
19
+ set :haml, { :ugly => false }
20
+ activate :syntax
21
+ """
22
+ Given the Server is running at "test-app"
23
+ When I go to "/code_haml_filter.html"
24
+ Then I should see '<span class="k">def</span>'
25
+ Then I should see '<pre class="highlight plaintext"><code>This is some code</code></pre>'
@@ -9,6 +9,7 @@ module Middleman
9
9
  class SyntaxExtension < Extension
10
10
  option :css_class, 'highlight', 'Class name applied to the syntax-highlighted output.'
11
11
  option :line_numbers, false, 'Generate line numbers.'
12
+ option :line_numbers_div, false, 'Generate line numbers with wrapping divs.'
12
13
  option :start_line, 1, 'Start the line numbering (if enabled) at the desired integer'
13
14
  option :inline_theme, nil, 'A Rouge::CSSTheme that will be used to highlight the output with inline styles instead of using CSS classes.'
14
15
  option :wrap, true, 'Wrap the highlighted content in a container (<pre> or <div>, depending on whether :line_numbers is on).'
@@ -12,6 +12,8 @@ module Middleman
12
12
  end
13
13
 
14
14
  @formatter = Rouge::Formatters::HTMLTable.new(@formatter, opts) if opts[:line_numbers]
15
+
16
+ @formatter = Rouge::Formatters::HTMLLinewise.new(@formatter, class:'line-%i') if opts[:line_numbers_div]
15
17
 
16
18
  if opts.fetch(:wrap, true)
17
19
  @formatter = Rouge::Formatters::HTMLPygments.new(@formatter, opts.fetch(:css_class, 'codehilite'))
@@ -6,6 +6,7 @@ if defined? Haml
6
6
  include Base
7
7
 
8
8
  def render(code)
9
+ code = code.rstrip
9
10
  code = code.encode(Encoding::UTF_8)
10
11
 
11
12
  # Allow language to be specified via a special comment like:
@@ -9,6 +9,9 @@ module Middleman
9
9
  if attribute == "line_numbers" and value == "false"
10
10
  return { line_numbers: false }
11
11
  end
12
+ if attribute == "line_numbers_div" and value == "false"
13
+ return { line_numbers_div: false }
14
+ end
12
15
  end
13
16
  {}
14
17
  end
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Syntax
3
- VERSION = "3.2.0"
3
+ VERSION = "3.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-syntax
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hollis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-06 00:00:00.000000000 Z
11
+ date: 2022-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
@@ -129,6 +129,8 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
+ - ".devcontainer/Dockerfile"
133
+ - ".devcontainer/devcontainer.json"
132
134
  - ".gitignore"
133
135
  - ".travis.yml"
134
136
  - CHANGELOG.md
@@ -181,23 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
183
  - !ruby/object:Gem::Version
182
184
  version: '0'
183
185
  requirements: []
184
- rubygems_version: 3.0.4
186
+ rubygems_version: 3.1.6
185
187
  signing_key:
186
188
  specification_version: 4
187
189
  summary: Code syntax highlighting plugin via rouge for Middleman
188
- test_files:
189
- - features/haml_filter.feature
190
- - features/helper.feature
191
- - features/markdown.feature
192
- - features/markdown_line_numbers_disabled.feature
193
- - features/markdown_line_numbers_enabled.feature
194
- - features/support/env.rb
195
- - features/support/step_definitions.rb
196
- - fixtures/test-app/config.rb
197
- - fixtures/test-app/source/code.html.markdown
198
- - fixtures/test-app/source/code_haml.html.haml
199
- - fixtures/test-app/source/code_haml_filter.html.haml
200
- - fixtures/test-app/source/code_html.html.erb
201
- - fixtures/test-app/source/code_slim.html.slim
202
- - fixtures/test-app/source/code_with_disabled_line_numbers.html.markdown
203
- - fixtures/test-app/source/code_with_enabled_line_numbers.html.markdown
190
+ test_files: []