vrml 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/vrml.rb +84 -0
- metadata +43 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bc0db9ae464b030bbe3bda724ac425396b8aaec8916211e0d41cda6ca28120b0
|
4
|
+
data.tar.gz: 3cd441509746b1902a44ca7ed336f14fb6daa753ab04c69062559802ca5dee79
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ed94e276b2f9d4d212e85cbbc803ade76a6b1dd1fbea2f6979881818a5fc9feeef19f2276797a5dc2b03c6ef08d0b17ebcccf3308703b28ccd5a530cf14a88f6
|
7
|
+
data.tar.gz: 4eea818b25ca985e9eeaa781a96df4542451bff1a9486ca2a55d3c139b42fcdc8cb5cc2d36c499973bf8ca945228a32cd22aea19cb6d279e431498f16fdbb22c
|
data/lib/vrml.rb
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# This "hook" is executed right before the site"s pages are rendered
|
5
|
+
Jekyll::Hooks.register :site, :pre_render do |site|
|
6
|
+
puts "Adding VRML Markdown Lexer ..."
|
7
|
+
require "rouge"
|
8
|
+
|
9
|
+
# This class defines the VRML lexer which is used to highlight "vrml" code snippets during render-time
|
10
|
+
class VRML < Rouge::RegexLexer
|
11
|
+
title "VRML"
|
12
|
+
desc "Classic VRML Encoding"
|
13
|
+
|
14
|
+
tag "vrml"
|
15
|
+
aliases "vrml", "x3dv", "wrl"
|
16
|
+
filenames "*.x3dv", "*.wrl", "*.vrml"
|
17
|
+
|
18
|
+
mimetypes "model/x3d+vrml", "model/vrml", "x-world/x-vrml"
|
19
|
+
|
20
|
+
def self.detect?(text)
|
21
|
+
return true if text =~ /\A#(?:X3D|VRML)\b/
|
22
|
+
end
|
23
|
+
|
24
|
+
state :comments_and_whitespace do
|
25
|
+
rule %r/[\x20\n,\t\r]+/, Text
|
26
|
+
rule %r/#.*?$/, Comment::Single
|
27
|
+
end
|
28
|
+
|
29
|
+
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]*/
|
30
|
+
|
31
|
+
state :root do
|
32
|
+
rule %r/[,:.]/, Punctuation
|
33
|
+
rule %r/[{}\[\]]/, Punctuation
|
34
|
+
rule %r/PROTO|EXTERNPROTO/, Keyword, :typeName
|
35
|
+
rule %r/DEF|USE|ROUTE|TO|EXPORT|AS/, Keyword, :name
|
36
|
+
|
37
|
+
rule %r/(IMPORT)(\s*)(#{id})(\s*)(.)(\s*)(#{id})/ do
|
38
|
+
groups Keyword, Text, Str::Regex, Text, Punctuation, Text, Str::Regex
|
39
|
+
end
|
40
|
+
|
41
|
+
mixin :comments_and_whitespace
|
42
|
+
mixin :keywords
|
43
|
+
mixin :accessTypes
|
44
|
+
|
45
|
+
# https://github.com/rouge-ruby/rouge/blob/master/lib/rouge/lexers/javascript.rb
|
46
|
+
|
47
|
+
rule %r/TRUE|FALSE|NULL/, Keyword::Constant
|
48
|
+
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
|
49
|
+
|
50
|
+
rule %r/#{id}(?=\s*\{)/, Name::Class # typeNames
|
51
|
+
rule %r/#{id}/, Name::Attribute # fieldNames
|
52
|
+
|
53
|
+
rule %r/[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?)/, Num::Float
|
54
|
+
rule %r/(?:0[xX][\da-fA-F]+)|(?:[+-]?\d+)/, Num::Integer
|
55
|
+
|
56
|
+
rule %r/"/, Str::Delimiter, :dq
|
57
|
+
end
|
58
|
+
|
59
|
+
state :keywords do
|
60
|
+
rule %r/PROFILE|COMPONENT|UNIT|META|DEF|USE|EXTERNPROTO|PROTO|IS|ROUTE|TO|IMPORT|EXPORT|AS/, Keyword
|
61
|
+
end
|
62
|
+
|
63
|
+
state :accessTypes do
|
64
|
+
rule %r/initializeOnly|inputOnly|outputOnly|inputOutput|field|eventIn|eventOut|exposedField/, Keyword
|
65
|
+
end
|
66
|
+
|
67
|
+
state :typeName do
|
68
|
+
mixin :comments_and_whitespace
|
69
|
+
rule %r/#{id}/, Name::Class, :pop!
|
70
|
+
end
|
71
|
+
|
72
|
+
state :name do
|
73
|
+
mixin :comments_and_whitespace
|
74
|
+
rule %r/#{id}/, Str::Regex, :pop!
|
75
|
+
end
|
76
|
+
|
77
|
+
state :dq do
|
78
|
+
rule %r/\\[\\nrt"]?/, Str::Escape
|
79
|
+
rule %r/[^\\"]+/, Str::Double
|
80
|
+
rule %r/"/, Str::Delimiter, :pop!
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
metadata
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vrml
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Holger Seelig
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-10-17 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Adds suport for VRML sytax highlighting.
|
14
|
+
email: holger.seelig@google.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/vrml.rb
|
20
|
+
homepage: https://create3000.github.io/x_ite/
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubygems_version: 3.5.9
|
40
|
+
signing_key:
|
41
|
+
specification_version: 4
|
42
|
+
summary: VRML Sytax Highlighter
|
43
|
+
test_files: []
|