jekyll-vrml 2.0.3 → 2.2.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 +4 -4
- data/README.md +12 -3
- data/lib/jekyll-vrml/version.rb +1 -1
- data/lib/jekyll-vrml.rb +41 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ad2550772ea1188d8c292108a27c4c8a1bd6944af847d3cb60a7370c1655f5e
|
4
|
+
data.tar.gz: 1e1cfda460e4e840ef4f267e14ace76d866a2c105d8854732ddf74320216f1ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fa4f7b8cc74b435f4bfdda7283073e0cfe59a58c891cacee1860541a50fb0b6e1cb83225517927164e8a2db24cb6b0d88c32ce38d55f969b3880f16e51ff885
|
7
|
+
data.tar.gz: a41f489a437eb4ea91433f936ed2888fac3647b93540d110cdb70e4509d28c44355a9130cc7df089f9f8427baacb299a1b0ba48dde91a1fb4154cfbc52fd91e3
|
data/README.md
CHANGED
@@ -4,15 +4,24 @@ Adds support for VRML syntax highlighting to Jekyll. This allows developers to e
|
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
7
|
-
Add the following lines to your Gemfile
|
7
|
+
Add the following lines to your `Gemfile`:
|
8
8
|
|
9
9
|
```ruby
|
10
10
|
group :jekyll_plugins do
|
11
|
-
gem 'jekyll-vrml', '~> 2.
|
11
|
+
gem 'jekyll-vrml', '~> 2.2'
|
12
12
|
end
|
13
13
|
```
|
14
14
|
|
15
|
-
After this, run `bundle install; bundle update`.
|
15
|
+
After this, run `bundle install; bundle update`.
|
16
|
+
|
17
|
+
In your `_config.yml` you need to specify that you want to use `rouge` as syntax highlighter.
|
18
|
+
|
19
|
+
```yml
|
20
|
+
kramdown:
|
21
|
+
syntax_highlighter: rouge
|
22
|
+
```
|
23
|
+
|
24
|
+
Now you can highlight your source code in Markdown as VRML:
|
16
25
|
|
17
26
|
``````md
|
18
27
|
```vrml
|
data/lib/jekyll-vrml/version.rb
CHANGED
data/lib/jekyll-vrml.rb
CHANGED
@@ -24,6 +24,11 @@ Jekyll::Hooks.register :site, :pre_render do |site|
|
|
24
24
|
return true if text =~ /\A#(?:X3D|VRML)\b/
|
25
25
|
end
|
26
26
|
|
27
|
+
start do
|
28
|
+
@javascript = Rouge::Lexers::Javascript.new(options)
|
29
|
+
@glsl = Rouge::Lexers::Glsl.new(options)
|
30
|
+
end
|
31
|
+
|
27
32
|
state :comments_and_whitespace do
|
28
33
|
rule %r/[\x20\n,\t\r]+/, Text
|
29
34
|
rule %r/#.*?$/, Comment::Single
|
@@ -56,6 +61,18 @@ Jekyll::Hooks.register :site, :pre_render do |site|
|
|
56
61
|
rule %r/[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?)/, Num::Float
|
57
62
|
rule %r/(?:0[xX][\da-fA-F]+)|(?:[+-]?\d+)/, Num::Integer
|
58
63
|
|
64
|
+
rule %r/"(?:ecmascript|javascript|vrmlscript):/ do
|
65
|
+
token Str::Double
|
66
|
+
@javascript.reset!
|
67
|
+
push :ecmascript
|
68
|
+
end
|
69
|
+
|
70
|
+
rule %r/"data:x-shader\/(?:x-fragment|x-vertex),/ do
|
71
|
+
token Str::Double
|
72
|
+
@glsl.reset!
|
73
|
+
push :glsl
|
74
|
+
end
|
75
|
+
|
59
76
|
rule %r/"/, Str::Delimiter, :dq
|
60
77
|
end
|
61
78
|
|
@@ -83,5 +100,29 @@ Jekyll::Hooks.register :site, :pre_render do |site|
|
|
83
100
|
rule %r/"/, Str::Delimiter, :pop!
|
84
101
|
end
|
85
102
|
|
103
|
+
state :ecmascript do
|
104
|
+
# Avoid escaped double quotes string in dq strings.
|
105
|
+
|
106
|
+
rule %r/\\[\\nrt"]?/, Str::Escape
|
107
|
+
|
108
|
+
rule %r/[^\\"]+/ do
|
109
|
+
delegate @javascript
|
110
|
+
end
|
111
|
+
|
112
|
+
rule %r/"/, Str::Delimiter, :pop!
|
113
|
+
end
|
114
|
+
|
115
|
+
state :glsl do
|
116
|
+
# Avoid escaped double quotes string in dq strings.
|
117
|
+
|
118
|
+
rule %r/\\[\\nrt"]?/, Str::Escape
|
119
|
+
|
120
|
+
rule %r/[^\\"]+/ do
|
121
|
+
delegate @glsl
|
122
|
+
end
|
123
|
+
|
124
|
+
rule %r/"/, Str::Delimiter, :pop!
|
125
|
+
end
|
126
|
+
|
86
127
|
end
|
87
128
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-vrml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Holger Seelig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Adds support for VRML syntax highlighting to Jekyll. This allows developers
|
14
14
|
to easily integrate and display X3D content within their Jekyll-powered websites.
|