commonmarker 1.0.0.pre6-arm64-darwin → 1.0.0.pre8-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b764accb0d75babf6d5bffd4aba6f7d845132f5bf1a37efe0e9a6eca173229ad
4
- data.tar.gz: 9faa5107dbe7aab31c9879eab3e7d3dc15d311f90839f514735a9246eea07237
3
+ metadata.gz: cbd52aef80a0402b1518f3bfee80aa03202455933f46236149638a6ed68a4cb2
4
+ data.tar.gz: 37fdf8c7024190cc4a8e41a0960083a689a9c8e3e7bfbd40c2ef80945746296d
5
5
  SHA512:
6
- metadata.gz: c4306186553eb5e1de9a26326393811bd7317b3a9c53f8d8494d25d9a7034ba4555d730178b677366fab0af0deded4729a5be269dc3c0b2f8ae047a70356cd77
7
- data.tar.gz: 9250032828ddc24dae819b66d7bdb11cd5b564948e24325310202f5a936d5f727389bd65fa66b1b97b2d6290b414c2ff91fab3e5b8e143db5d0c637766c5568a
6
+ metadata.gz: 1ca6b73e70537f41a0fd751e0f962604ef0400d1e3be53afc8a66f0918f25d974182ce514fb8b50b895ef3d569aa85003d05554e221ed2e5d485a0561008b1a8
7
+ data.tar.gz: 941304a5497be9d1e684d640917e8592885c825d44957ae60d9b64335c612cfb56b120bf5b4c6198629f95dd2251a8923976643323ad95d1560af5299051adb6
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](#extensions).
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 `render_html` on a string to convert it to HTML:
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
- | `unsafe_` | Allow rendering of raw HTML and potentially dangerous links. | `false` |
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
- extensions: { footnotes: true, description_lists: true },
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.. | `false` |
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. For example:
104
+ providing further niceties.
104
105
 
105
- code = <<~CODE
106
- ```ruby
107
- def hello
108
- puts "hello"
109
- end
106
+ #### Syntax Highlighter Plugin
110
107
 
111
- CODE
108
+ ````ruby
109
+ code = <<~CODE
110
+ ```ruby
111
+ def hello
112
+ puts "hello"
113
+ end
114
+ CODE
112
115
 
113
- Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "Inspired GitHub" } })
116
+ puts Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "InspiredGitHub" } })
114
117
 
115
- # <pre style="background-color:#ffffff;" lang="ruby"><code>
116
- # <span style="font-weight:bold;color:#a71d5d;">def </span><span style="font-weight:bold;color:#795da3;">hello
117
- # </span><span style="color:#323232;"> </span><span style="color:#62a35c;">puts </span><span style="color:#183691;">&quot;hello&quot;
118
- # </span><span style="font-weight:bold;color:#a71d5d;">end
119
- # </span>
120
- # </code></pre>
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;">&quot;hello&quot;
121
+ # </span><span style="font-weight:bold;color:#a71d5d;">end
122
+ # </span>
123
+ # </code></pre>
124
+ ````
121
125
 
122
- You can disable plugins just the same as with options, by passing `nil`:
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.
@@ -13,7 +13,7 @@ module Commonmarker
13
13
  hardbreaks: true,
14
14
  github_pre_lang: true,
15
15
  width: 80,
16
- unsafe_: false,
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commonmarker
4
- VERSION = "1.0.0.pre6"
4
+ VERSION = "1.0.0.pre8"
5
5
  end
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.pre6
4
+ version: 1.0.0.pre8
5
5
  platform: arm64-darwin
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-01-09 00:00:00.000000000 Z
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.bundle
92
54
  - lib/commonmarker/3.2/commonmarker.bundle
@@ -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.3
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.