commonmarker 1.0.0.pre6-aarch64-linux → 1.0.0.pre8-aarch64-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 +43 -20
- data/lib/commonmarker/3.1/commonmarker.so +0 -0
- data/lib/commonmarker/3.2/commonmarker.so +0 -0
- data/lib/commonmarker/config.rb +3 -1
- data/lib/commonmarker/version.rb +1 -1
- metadata +3 -41
- data/Cargo.lock +0 -1058
- data/commonmarker.gemspec +0 -41
- data/ext/commonmarker/Cargo.toml +0 -12
- data/ext/commonmarker/extconf.rb +0 -6
- data/ext/commonmarker/src/lib.rs +0 -85
- data/ext/commonmarker/src/options.rs +0 -130
- data/ext/commonmarker/src/plugins/syntax_highlighting.rs +0 -30
- data/ext/commonmarker/src/plugins.rs +0 -21
- data/ext/commonmarker/src/utils.rs +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3290595c5edc7ef0a8c86b5cae1c0c88d89a7ed89844baa59d3d20ec631f4266
|
4
|
+
data.tar.gz: dca288dca7aa6d9c0f22f3cf62521ad5f1d56758341e40ef033ca105df19cfb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 785e3551f67cfa8d4dfb7e523d7a29d5a78c4e9cdba0c3c20d44fd981426ac6b9a8261517ad3fb1705cf78f4c07ee449d5e370cd8ad45c1b026fb3d4281e0fef
|
7
|
+
data.tar.gz: 79df823e4bc4097e8b487dc1bb5ded9e336f3c51d433be17a39012ee662dc2c9bb11e5b01c446d32785f53d88e5d1e98f8836fbc3c96a9cc3046d13befaafafb
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Ruby wrapper for Rust's [comrak](https://github.com/kivikakk/comrak) crate.
|
|
7
7
|
|
8
8
|
It passes all of the CommonMark test suite, and is therefore spec-complete. It also includes extensions to the CommonMark spec as documented in the [GitHub Flavored Markdown spec](http://github.github.com/gfm/), such as support for tables, strikethroughs, and autolinking.
|
9
9
|
|
10
|
-
For more information on available extensions, see [the documentation below](#
|
10
|
+
For more information on available extensions, see [the documentation below](#extension-options).
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
@@ -27,7 +27,7 @@ Or install it yourself as:
|
|
27
27
|
|
28
28
|
### Converting to HTML
|
29
29
|
|
30
|
-
Call `
|
30
|
+
Call `to_html` on a string to convert it to HTML:
|
31
31
|
|
32
32
|
```ruby
|
33
33
|
require 'commonmarker'
|
@@ -68,14 +68,14 @@ Note that there is a distinction in comrak for "parse" options and "render" opti
|
|
68
68
|
| `hardbreaks` | [Soft line breaks](http://spec.commonmark.org/0.27/#soft-line-breaks) translate into hard line breaks. | `true` |
|
69
69
|
| `github_pre_lang` | GitHub-style `<pre lang="xyz">` is used for fenced code blocks with info tags. | `true` |
|
70
70
|
| `width` | The wrap column when outputting CommonMark. | `80` |
|
71
|
-
| `
|
71
|
+
| `unsafe` | Allow rendering of raw HTML and potentially dangerous links. | `false` |
|
72
72
|
| `escape` | Escape raw HTML instead of clobbering it. | `false` |
|
73
73
|
|
74
74
|
As well, there are several extensions which you can toggle in the same manner:
|
75
75
|
|
76
76
|
```ruby
|
77
77
|
Commonmarker.to_html('"Hi *there*"', options: {
|
78
|
-
|
78
|
+
extension: { footnotes: true, description_lists: true },
|
79
79
|
render: { hardbreaks: false}
|
80
80
|
})
|
81
81
|
```
|
@@ -92,34 +92,38 @@ Commonmarker.to_html('"Hi *there*"', options: {
|
|
92
92
|
| `superscript` | Enables the superscript Comrak extension. | `false` |
|
93
93
|
| `header_ids` | Enables the header IDs Comrak extension. from the GFM spec. | `""` |
|
94
94
|
| `footnotes` | Enables the footnotes extension per `cmark-gfm`. | `false` |
|
95
|
-
| `description_lists` | Enables the description lists extension
|
95
|
+
| `description_lists` | Enables the description lists extension. | `false` |
|
96
96
|
| `front_matter_delimiter` | Enables the front matter extension. | `""` |
|
97
|
+
| `shortcodes` | Enables the shortcodes extension. | `true` |
|
97
98
|
|
98
99
|
For more information on these options, see [the comrak documentation](https://github.com/kivikakk/comrak#usage).
|
99
100
|
|
100
101
|
### Plugins
|
101
102
|
|
102
103
|
In addition to the possibilities provided by generic CommonMark rendering, Commonmarker also supports plugins as a means of
|
103
|
-
providing further niceties.
|
104
|
+
providing further niceties.
|
104
105
|
|
105
|
-
|
106
|
-
```ruby
|
107
|
-
def hello
|
108
|
-
puts "hello"
|
109
|
-
end
|
106
|
+
#### Syntax Highlighter Plugin
|
110
107
|
|
111
|
-
|
108
|
+
````ruby
|
109
|
+
code = <<~CODE
|
110
|
+
```ruby
|
111
|
+
def hello
|
112
|
+
puts "hello"
|
113
|
+
end
|
114
|
+
CODE
|
112
115
|
|
113
|
-
|
116
|
+
puts Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "InspiredGitHub" } })
|
114
117
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
118
|
+
# <pre style="background-color:#ffffff;" lang="ruby"><code>
|
119
|
+
# <span style="font-weight:bold;color:#a71d5d;">def </span><span style="font-weight:bold;color:#795da3;">hello
|
120
|
+
# </span><span style="color:#62a35c;">puts </span><span style="color:#183691;">"hello"
|
121
|
+
# </span><span style="font-weight:bold;color:#a71d5d;">end
|
122
|
+
# </span>
|
123
|
+
# </code></pre>
|
124
|
+
````
|
121
125
|
|
122
|
-
|
126
|
+
To disable this plugin, pass `nil`:
|
123
127
|
|
124
128
|
```ruby
|
125
129
|
Commonmarker.to_html(code, plugins: { syntax_highlighter: nil })
|
@@ -127,6 +131,25 @@ Commonmarker.to_html(code, plugins: { syntax_highlighter: nil })
|
|
127
131
|
Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: nil } })
|
128
132
|
```
|
129
133
|
|
134
|
+
You can also provide a `path` to a directory containing `.tmtheme` files to load:
|
135
|
+
|
136
|
+
```ruby
|
137
|
+
|
138
|
+
Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "Monokai", path: "./themes" } })
|
139
|
+
```
|
140
|
+
|
141
|
+
##### Available themes
|
142
|
+
|
143
|
+
Here's [a list of themes available by default](https://docs.rs/syntect/5.0.0/syntect/highlighting/struct.ThemeSet.html#implementations):
|
144
|
+
|
145
|
+
- `"base16-ocean.dark"`
|
146
|
+
- `"base16-eighties.dark"`
|
147
|
+
- `"base16-mocha.dark"`
|
148
|
+
- `"base16-ocean.light"`
|
149
|
+
- `"InspiredGitHub"`
|
150
|
+
- `"Solarized (dark)"`
|
151
|
+
- `"Solarized (light)"`
|
152
|
+
|
130
153
|
## Output formats
|
131
154
|
|
132
155
|
Commonmarker can currently only generate output in one format: HTML.
|
Binary file
|
Binary file
|
data/lib/commonmarker/config.rb
CHANGED
@@ -13,7 +13,7 @@ module Commonmarker
|
|
13
13
|
hardbreaks: true,
|
14
14
|
github_pre_lang: true,
|
15
15
|
width: 80,
|
16
|
-
|
16
|
+
unsafe: false,
|
17
17
|
escape: false,
|
18
18
|
}.freeze,
|
19
19
|
extension: {
|
@@ -27,6 +27,7 @@ module Commonmarker
|
|
27
27
|
footnotes: false,
|
28
28
|
description_lists: false,
|
29
29
|
front_matter_delimiter: nil,
|
30
|
+
shortcodes: true,
|
30
31
|
},
|
31
32
|
format: [:html].freeze,
|
32
33
|
}.freeze
|
@@ -34,6 +35,7 @@ module Commonmarker
|
|
34
35
|
PLUGINS = {
|
35
36
|
syntax_highlighter: {
|
36
37
|
theme: "base16-ocean.dark",
|
38
|
+
path: "",
|
37
39
|
},
|
38
40
|
}
|
39
41
|
|
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.pre8
|
5
5
|
platform: aarch64-linux
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
@@ -9,23 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-03-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: rb_sys
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0.9'
|
21
|
-
type: :runtime
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - "~>"
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0.9'
|
28
|
-
force_ruby_platform: false
|
29
14
|
- !ruby/object:Gem::Dependency
|
30
15
|
name: rake
|
31
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,20 +39,6 @@ dependencies:
|
|
54
39
|
- - "~>"
|
55
40
|
- !ruby/object:Gem::Version
|
56
41
|
version: '1.2'
|
57
|
-
- !ruby/object:Gem::Dependency
|
58
|
-
name: rake-compiler-dock
|
59
|
-
requirement: !ruby/object:Gem::Requirement
|
60
|
-
requirements:
|
61
|
-
- - "~>"
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '1.2'
|
64
|
-
type: :development
|
65
|
-
prerelease: false
|
66
|
-
version_requirements: !ruby/object:Gem::Requirement
|
67
|
-
requirements:
|
68
|
-
- - "~>"
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: '1.2'
|
71
42
|
description: A fast, safe, extensible parser for CommonMark. This wraps the comrak
|
72
43
|
Rust crate.
|
73
44
|
email:
|
@@ -75,18 +46,9 @@ executables: []
|
|
75
46
|
extensions: []
|
76
47
|
extra_rdoc_files: []
|
77
48
|
files:
|
78
|
-
- Cargo.lock
|
79
49
|
- LICENSE.txt
|
80
50
|
- README.md
|
81
|
-
- commonmarker.gemspec
|
82
|
-
- ext/commonmarker/Cargo.toml
|
83
51
|
- ext/commonmarker/_util.rb
|
84
|
-
- ext/commonmarker/extconf.rb
|
85
|
-
- ext/commonmarker/src/lib.rs
|
86
|
-
- ext/commonmarker/src/options.rs
|
87
|
-
- ext/commonmarker/src/plugins.rs
|
88
|
-
- ext/commonmarker/src/plugins/syntax_highlighting.rs
|
89
|
-
- ext/commonmarker/src/utils.rs
|
90
52
|
- lib/commonmarker.rb
|
91
53
|
- lib/commonmarker/3.1/commonmarker.so
|
92
54
|
- lib/commonmarker/3.2/commonmarker.so
|
@@ -122,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
84
|
- !ruby/object:Gem::Version
|
123
85
|
version: 3.3.22
|
124
86
|
requirements: []
|
125
|
-
rubygems_version: 3.4.
|
87
|
+
rubygems_version: 3.4.4
|
126
88
|
signing_key:
|
127
89
|
specification_version: 4
|
128
90
|
summary: CommonMark parser and renderer. Written in Rust, wrapped in Ruby.
|