commonmarker 1.0.0.pre6-x86_64-darwin → 1.0.0.pre8-x86_64-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: 758613f4d5ca0637011f3aa340960333c4f39e88618d000c06cdeea6e914864b
4
- data.tar.gz: c1e1333fc34a92893c66cad15a93f2a46bf797be405d731146aa97d2f0e618f0
3
+ metadata.gz: 283817410ec0216785f247e14ddbc8ca69b985bc4516074c95207536fe331d3d
4
+ data.tar.gz: 5994e7cef31999711368b71412043b3da55f046da027f8864de94c2c2f7a20cb
5
5
  SHA512:
6
- metadata.gz: 18bbe43f0a02ff7dfe9df8ac02139a8b2c7b5b5751e471cc71a875b3620befba3c58f6be22ddf1b2465be8e6427fb6e1d97f152b783b366909086f01ef41439a
7
- data.tar.gz: cda8b14df71e2b2c0b1c9037c562e002d7ad910398056d64c77bfcb1424965997d416af1e7510ab62894df6a50475e9d636c82abd4f8c200e487bfadf179ad06
6
+ metadata.gz: 313a2f43f896b2e8815b859f0df32d7ec167cc3ed4a984c9bf8aed397080c211cb9269793f474c198a1c447572fa581b6cf2809f9a5bbeef68264e74767d6ce6
7
+ data.tar.gz: f82627b1e342ca9606f4c353a2c199344712a2c410c3d49a9ad59e4373b1828da0a98f42d9e61f5cd8ba554ca54f5872b9dac246ef66374652f57afa31d27a74
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: x86_64-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.