jekyll-vrml 2.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 053f65d8793f7535011dd6e36922beef8b461231f0f9b9518302347a596f0bc9
4
+ data.tar.gz: 917b1824a6dc3ad10a9d0c6b5e4e9552f6d4f509e8a56b58ba42774ea346eccb
5
+ SHA512:
6
+ metadata.gz: 765fe01897c0d58696ab3a24fb6de86e2cd2737abfba85e24b0ba1bdc7c8578e40b52d94e9dd558aa015eeb4f8a7bbc458dcdb45bb21ab0e1a6d085722fdcd59
7
+ data.tar.gz: 7e1cc5bd555b743a113fedbf5ff386af091bddc8cc58abebad76e75b71207e8231aaa791bf3b8990791290cf21fa84e3104958753655f60f67dd1ef82339cce7
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Holger Seelig
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # jekyll-vrml
2
+
3
+ Adds support for VRML syntax highlighting to Jekyll.
4
+
5
+ ## Usage
6
+
7
+ Add the following lines to your Gemfile:
8
+
9
+ ```
10
+ group :jekyll_plugins do
11
+ gem "jekyll-vrml"
12
+ end
13
+ ```
14
+
15
+ After this run `bundle install`.
data/Rakefile ADDED
@@ -0,0 +1,30 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ namespace :project do
4
+ require "forwardable"
5
+
6
+ module Project
7
+ class Spec
8
+ extend Forwardable
9
+
10
+ def_delegators :@gemspec, :name, :version
11
+
12
+ def initialize(name)
13
+ gemspec_file = "#{name}.gemspec"
14
+ @gemspec = Bundler.load_gemspec(gemspec_file)
15
+ end
16
+ end
17
+ end
18
+
19
+ spec = Project::Spec.new("jekyll-vrml")
20
+
21
+ desc "Print basename of built gem."
22
+ task :gem_name do
23
+ puts "#{spec.name}-#{spec.version}"
24
+ end
25
+
26
+ desc "Print lib version prefixed with 'v'."
27
+ task :tag_version do
28
+ puts "v#{spec.version}"
29
+ end
30
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module JekyllVrml
4
+ VERSION = "2.0.0"
5
+ end
@@ -0,0 +1,87 @@
1
+ # -*- coding: utf-8 -*- #
2
+ # frozen_string_literal: true
3
+
4
+ require_relative "jekyll-vrml/version"
5
+ require "jekyll"
6
+
7
+ # This "hook" is executed right before the site"s pages are rendered
8
+ Jekyll::Hooks.register :site, :pre_render do |site|
9
+ puts "Adding VRML Markdown Lexer ..."
10
+ require "rouge"
11
+
12
+ # This class defines the VRML lexer which is used to highlight "vrml" code snippets during render-time
13
+ class VRML < Rouge::RegexLexer
14
+ title "VRML"
15
+ desc "Classic VRML Encoding"
16
+
17
+ tag "vrml"
18
+ aliases "vrml", "x3dv", "wrl"
19
+ filenames "*.x3dv", "*.wrl", "*.vrml"
20
+
21
+ mimetypes "model/x3d+vrml", "model/vrml", "x-world/x-vrml"
22
+
23
+ def self.detect?(text)
24
+ return true if text =~ /\A#(?:X3D|VRML)\b/
25
+ end
26
+
27
+ state :comments_and_whitespace do
28
+ rule %r/[\x20\n,\t\r]+/, Text
29
+ rule %r/#.*?$/, Comment::Single
30
+ end
31
+
32
+ id = %r/[^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f]*/
33
+
34
+ state :root do
35
+ rule %r/[,:.]/, Punctuation
36
+ rule %r/[{}\[\]]/, Punctuation
37
+ rule %r/PROTO|EXTERNPROTO/, Keyword, :typeName
38
+ rule %r/DEF|USE|ROUTE|TO|EXPORT|AS/, Keyword, :name
39
+
40
+ rule %r/(IMPORT)(\s*)(#{id})(\s*)(.)(\s*)(#{id})/ do
41
+ groups Keyword, Text, Str::Regex, Text, Punctuation, Text, Str::Regex
42
+ end
43
+
44
+ mixin :comments_and_whitespace
45
+ mixin :keywords
46
+ mixin :accessTypes
47
+
48
+ # https://github.com/rouge-ruby/rouge/blob/master/lib/rouge/lexers/javascript.rb
49
+
50
+ rule %r/TRUE|FALSE|NULL/, Keyword::Constant
51
+ rule %r/SFBool|SFColor|SFColorRGBA|SFDouble|SFFloat|SFImage|SFInt32|SFMatrix3d|SFMatrix3f|SFMatrix4d|SFMatrix4f|VrmlMatrix|SFNode|SFRotation|SFString|SFTime|SFVec2d|SFVec2f|SFVec3d|SFVec3f|SFVec4d|SFVec4f|MFBool|MFColor|MFColorRGBA|MFDouble|MFFloat|MFImage|MFInt32|MFMatrix3d|MFMatrix3f|MFMatrix4d|MFMatrix4f|MFNode|MFRotation|MFString|MFTime|MFVec2d|MFVec2f|MFVec3d|MFVec3f|MFVec4d|MFVec4f/, Keyword::Declaration
52
+
53
+ rule %r/#{id}(?=\s*\{)/, Name::Class # typeNames
54
+ rule %r/#{id}/, Name::Attribute # fieldNames
55
+
56
+ rule %r/[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?)/, Num::Float
57
+ rule %r/(?:0[xX][\da-fA-F]+)|(?:[+-]?\d+)/, Num::Integer
58
+
59
+ rule %r/"/, Str::Delimiter, :dq
60
+ end
61
+
62
+ state :keywords do
63
+ rule %r/PROFILE|COMPONENT|UNIT|META|DEF|USE|EXTERNPROTO|PROTO|IS|ROUTE|TO|IMPORT|EXPORT|AS/, Keyword
64
+ end
65
+
66
+ state :accessTypes do
67
+ rule %r/initializeOnly|inputOnly|outputOnly|inputOutput|field|eventIn|eventOut|exposedField/, Keyword
68
+ end
69
+
70
+ state :typeName do
71
+ mixin :comments_and_whitespace
72
+ rule %r/#{id}/, Name::Class, :pop!
73
+ end
74
+
75
+ state :name do
76
+ mixin :comments_and_whitespace
77
+ rule %r/#{id}/, Str::Regex, :pop!
78
+ end
79
+
80
+ state :dq do
81
+ rule %r/\\[\\nrt"]?/, Str::Escape
82
+ rule %r/[^\\"]+/, Str::Double
83
+ rule %r/"/, Str::Delimiter, :pop!
84
+ end
85
+
86
+ end
87
+ end
data/package.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "sunrize",
3
+ "scripts": {
4
+ "prebuild": "rm ./*.gem",
5
+ "build": "gem build jekyll-vrml.gemspec",
6
+ "publish": "gem push ./*.gem"
7
+ }
8
+ }
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-vrml
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Holger Seelig
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-10-18 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Adds support for VRML syntax highlighting to Jekyll.
14
+ email:
15
+ - holger.seelig@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - LICENSE.txt
21
+ - README.md
22
+ - Rakefile
23
+ - lib/jekyll-vrml.rb
24
+ - lib/jekyll-vrml/version.rb
25
+ - package.json
26
+ homepage: https://github.com/create3000/jekyll-vrml
27
+ licenses:
28
+ - MIT
29
+ metadata:
30
+ allowed_push_host: https://rubygems.org
31
+ homepage_uri: https://github.com/create3000/jekyll-vrml
32
+ post_install_message:
33
+ rdoc_options: []
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.0.0
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubygems_version: 3.5.9
48
+ signing_key:
49
+ specification_version: 4
50
+ summary: VRML Syntax Highlighter
51
+ test_files: []