commonmarker 1.0.0.pre10-x86_64-linux → 1.0.0.pre12-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -19
- data/lib/commonmarker/3.1/commonmarker.so +0 -0
- data/lib/commonmarker/3.2/commonmarker.so +0 -0
- data/lib/commonmarker/config.rb +1 -1
- data/lib/commonmarker/version.rb +1 -1
- 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: a9f337307df8de975e55e1aac1dfe95a2d0cddf654053ca7771e136b1e2ce364
|
4
|
+
data.tar.gz: 87f4604027b92b192e2851b957454a0fae3d613edcbe0fad9354c58a196bea36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6f23e238946605bdb5707825d03a6375da99d6f7808fd45db93127d15d9507f108bce09f66a7d1c56a08a36ecb41dd6c50f3a7cdc9016d0fa3bb70aac87bf89
|
7
|
+
data.tar.gz: a8befd90be4c9bb4a86459fe2a5b11ae5435dc89a88a7e548fadd4ac8f4832818373c475a3e5b2821ae4685b9805261f7b1d350ff08ad8740307e4ec66b5fd27
|
data/README.md
CHANGED
@@ -105,14 +105,26 @@ providing further niceties.
|
|
105
105
|
|
106
106
|
#### Syntax Highlighter Plugin
|
107
107
|
|
108
|
+
The library comes with [a set of pre-existing themes](https://docs.rs/syntect/5.0.0/syntect/highlighting/struct.ThemeSet.html#implementations) for highlighting code:
|
109
|
+
|
110
|
+
- `"base16-ocean.dark"`
|
111
|
+
- `"base16-eighties.dark"`
|
112
|
+
- `"base16-mocha.dark"`
|
113
|
+
- `"base16-ocean.light"`
|
114
|
+
- `"InspiredGitHub"`
|
115
|
+
- `"Solarized (dark)"`
|
116
|
+
- `"Solarized (light)"`
|
117
|
+
|
108
118
|
````ruby
|
109
119
|
code = <<~CODE
|
110
120
|
```ruby
|
111
121
|
def hello
|
112
|
-
|
122
|
+
puts "hello"
|
113
123
|
end
|
124
|
+
```
|
114
125
|
CODE
|
115
126
|
|
127
|
+
# pass in a theme name from a pre-existing set
|
116
128
|
puts Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "InspiredGitHub" } })
|
117
129
|
|
118
130
|
# <pre style="background-color:#ffffff;" lang="ruby"><code>
|
@@ -123,32 +135,49 @@ puts Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "Inspire
|
|
123
135
|
# </code></pre>
|
124
136
|
````
|
125
137
|
|
126
|
-
|
138
|
+
By default, the plugin uses the `"base16-ocean.dark"` theme to syntax highlight code.
|
139
|
+
|
140
|
+
To disable this plugin, set the value to `nil`:
|
141
|
+
|
142
|
+
````ruby
|
143
|
+
code = <<~CODE
|
144
|
+
```ruby
|
145
|
+
def hello
|
146
|
+
puts "hello"
|
147
|
+
end
|
148
|
+
```
|
149
|
+
CODE
|
127
150
|
|
128
|
-
```ruby
|
129
151
|
Commonmarker.to_html(code, plugins: { syntax_highlighter: nil })
|
130
|
-
# or
|
131
|
-
Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: nil } })
|
132
|
-
```
|
133
152
|
|
134
|
-
|
153
|
+
# <pre lang="ruby"><code>def hello
|
154
|
+
# puts "hello"
|
155
|
+
# end
|
156
|
+
# </code></pre>
|
157
|
+
````
|
158
|
+
|
159
|
+
To output CSS classes instead of `style` attributes, set the `theme` key to `""`:
|
135
160
|
|
136
|
-
|
161
|
+
````ruby
|
162
|
+
code = <<~CODE
|
163
|
+
```ruby
|
164
|
+
def hello
|
165
|
+
puts "hello"
|
166
|
+
end
|
167
|
+
CODE
|
137
168
|
|
138
|
-
Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "
|
139
|
-
```
|
169
|
+
Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "" } })
|
140
170
|
|
141
|
-
|
171
|
+
# <pre class="syntax-highlighting"><code><span class="source ruby"><span class="meta function ruby"><span class="keyword control def ruby">def</span></span><span class="meta function ruby"> # <span class="entity name function ruby">hello</span></span>
|
172
|
+
# <span class="support function builtin ruby">puts</span> <span class="string quoted double ruby"><span class="punctuation definition string begin ruby">"</span>hello<span class="punctuation definition string end ruby">"</span></span>
|
173
|
+
# <span class="keyword control ruby">end</span>\n</span></code></pre>
|
174
|
+
````
|
142
175
|
|
143
|
-
|
176
|
+
To use a custom theme, you can provide a `path` to a directory containing `.tmtheme` files to load:
|
144
177
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
- `"base16-ocean.light"`
|
149
|
-
- `"InspiredGitHub"`
|
150
|
-
- `"Solarized (dark)"`
|
151
|
-
- `"Solarized (light)"`
|
178
|
+
```ruby
|
179
|
+
Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "Monokai", path: "./themes" } })
|
180
|
+
```
|
152
181
|
|
153
182
|
## Output formats
|
154
183
|
|
Binary file
|
Binary file
|
data/lib/commonmarker/config.rb
CHANGED
data/lib/commonmarker/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commonmarker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.pre12
|
5
5
|
platform: x86_64-linux
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-07
|
12
|
+
date: 2023-12-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|