markly 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/conduct.md +133 -0
- data/ext/markly/Makefile +270 -0
- data/ext/markly/arena.c +9 -8
- data/ext/markly/arena.o +0 -0
- data/ext/markly/autolink.c +217 -134
- data/ext/markly/autolink.o +0 -0
- data/ext/markly/blocks.c +27 -2
- data/ext/markly/blocks.o +0 -0
- data/ext/markly/buffer.o +0 -0
- data/ext/markly/cmark-gfm-core-extensions.h +11 -11
- data/ext/markly/cmark-gfm-extension_api.h +1 -0
- data/ext/markly/cmark-gfm.h +18 -2
- data/ext/markly/cmark.c +3 -3
- data/ext/markly/cmark.o +0 -0
- data/ext/markly/cmark_ctype.o +0 -0
- data/ext/markly/commonmark.c +19 -34
- data/ext/markly/commonmark.o +0 -0
- data/ext/markly/core-extensions.o +0 -0
- data/ext/markly/ext_scanners.o +0 -0
- data/ext/markly/extconf.rb +8 -1
- data/ext/markly/footnotes.o +0 -0
- data/ext/markly/houdini_href_e.o +0 -0
- data/ext/markly/houdini_html_e.o +0 -0
- data/ext/markly/houdini_html_u.o +0 -0
- data/ext/markly/html.c +22 -6
- data/ext/markly/html.o +0 -0
- data/ext/markly/inlines.c +148 -51
- data/ext/markly/inlines.o +0 -0
- data/ext/markly/iterator.o +0 -0
- data/ext/markly/latex.c +6 -4
- data/ext/markly/latex.o +0 -0
- data/ext/markly/linked_list.o +0 -0
- data/ext/markly/man.c +7 -11
- data/ext/markly/man.o +0 -0
- data/ext/markly/map.c +11 -4
- data/ext/markly/map.h +5 -2
- data/ext/markly/map.o +0 -0
- data/ext/markly/markly.bundle +0 -0
- data/ext/markly/markly.c +582 -586
- data/ext/markly/markly.h +1 -1
- data/ext/markly/markly.o +0 -0
- data/ext/markly/node.c +76 -10
- data/ext/markly/node.h +42 -1
- data/ext/markly/node.o +0 -0
- data/ext/markly/parser.h +1 -0
- data/ext/markly/plaintext.c +12 -29
- data/ext/markly/plaintext.o +0 -0
- data/ext/markly/plugin.o +0 -0
- data/ext/markly/references.c +1 -0
- data/ext/markly/references.o +0 -0
- data/ext/markly/registry.o +0 -0
- data/ext/markly/render.c +15 -7
- data/ext/markly/render.o +0 -0
- data/ext/markly/scanners.c +13916 -10380
- data/ext/markly/scanners.h +8 -0
- data/ext/markly/scanners.o +0 -0
- data/ext/markly/scanners.re +47 -8
- data/ext/markly/strikethrough.c +1 -1
- data/ext/markly/strikethrough.o +0 -0
- data/ext/markly/syntax_extension.o +0 -0
- data/ext/markly/table.c +81 -31
- data/ext/markly/table.o +0 -0
- data/ext/markly/tagfilter.o +0 -0
- data/ext/markly/tasklist.o +0 -0
- data/ext/markly/utf8.o +0 -0
- data/ext/markly/xml.c +2 -1
- data/ext/markly/xml.o +0 -0
- data/lib/markly/flags.rb +16 -0
- data/lib/markly/node/inspect.rb +59 -53
- data/lib/markly/node.rb +125 -58
- data/lib/markly/renderer/generic.rb +129 -124
- data/lib/markly/renderer/html.rb +294 -275
- data/lib/markly/version.rb +7 -1
- data/lib/markly.rb +36 -30
- data/license.md +39 -0
- data/readme.md +36 -0
- data.tar.gz.sig +0 -0
- metadata +98 -29
- metadata.gz.sig +0 -0
- data/bin/markly +0 -94
- data/lib/markly/markly.bundle +0 -0
data/lib/markly.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
#
|
4
|
+
# Released under the MIT License.
|
5
|
+
# Copyright, 2014, by John MacFarlane.
|
6
|
+
# Copyright, 2015-2019, by Garen Torikian.
|
7
|
+
# Copyright, 2015, by Nick Wellnhofer.
|
8
|
+
# Copyright, 2016-2017, by Yuki Izumi.
|
9
|
+
# Copyright, 2020-2023, by Samuel Williams.
|
10
|
+
|
5
11
|
require 'markly/markly'
|
6
12
|
|
7
13
|
require_relative 'markly/flags'
|
@@ -11,33 +17,33 @@ require_relative 'markly/renderer/html'
|
|
11
17
|
require_relative 'markly/version'
|
12
18
|
|
13
19
|
module Markly
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
20
|
+
# Public: Parses a Markdown string into a `document` node.
|
21
|
+
#
|
22
|
+
# string - {String} to be parsed
|
23
|
+
# option - A {Symbol} or {Array of Symbol}s indicating the parse options
|
24
|
+
# extensions - An {Array of Symbol}s indicating the extensions to use
|
25
|
+
#
|
26
|
+
# Returns the `parser` node.
|
27
|
+
def self.parse(text, flags: DEFAULT, extensions: nil)
|
28
|
+
parser = Parser.new(flags)
|
29
|
+
|
30
|
+
extensions&.each do |extension|
|
31
|
+
parser.enable(extension)
|
32
|
+
end
|
33
|
+
|
34
|
+
return parser.parse(text.encode(Encoding::UTF_8))
|
35
|
+
end
|
36
|
+
|
37
|
+
# Public: Parses a Markdown string into an HTML string.
|
38
|
+
#
|
39
|
+
# text - A {String} of text
|
40
|
+
# option - Either a {Symbol} or {Array of Symbol}s indicating the render options
|
41
|
+
# extensions - An {Array of Symbol}s indicating the extensions to use
|
42
|
+
#
|
43
|
+
# Returns a {String} of converted HTML.
|
44
|
+
def self.render_html(text, flags: DEFAULT, parse_flags: flags, render_flags: flags, extensions: [])
|
45
|
+
root = self.parse(text, flags: parse_flags, extensions: extensions)
|
46
|
+
|
47
|
+
return root.to_html(flags: render_flags, extensions: extensions)
|
48
|
+
end
|
43
49
|
end
|
data/license.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# MIT License
|
2
|
+
|
3
|
+
Copyright, 2014, by John MacFarlane.
|
4
|
+
Copyright, 2015-2020, by Garen Torikian.
|
5
|
+
Copyright, 2015, by Nick Wellnhofer.
|
6
|
+
Copyright, 2015-2017, by Andrew Anderson.
|
7
|
+
Copyright, 2016-2017, by Yuki Izumi.
|
8
|
+
Copyright, 2017, by Mu-An Chiou.
|
9
|
+
Copyright, 2017-2018, by Goro Fuji.
|
10
|
+
Copyright, 2017, by Ben Woosley.
|
11
|
+
Copyright, 2017, by Roberto Hidalgo.
|
12
|
+
Copyright, 2017-2020, by Ashe Connor.
|
13
|
+
Copyright, 2018, by Jerry van Leeuwen.
|
14
|
+
Copyright, 2018, by Vitaliy Klachkov.
|
15
|
+
Copyright, 2018, by Michael Camilleri.
|
16
|
+
Copyright, 2018, by Akira Matsuda.
|
17
|
+
Copyright, 2018, by Danny Iachini.
|
18
|
+
Copyright, 2019-2020, by Tomoya Chiba.
|
19
|
+
Copyright, 2019, by Brett Walker.
|
20
|
+
Copyright, 2020, by Olle Jonsson.
|
21
|
+
Copyright, 2020-2023, by Samuel Williams.
|
22
|
+
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
24
|
+
of this software and associated documentation files (the "Software"), to deal
|
25
|
+
in the Software without restriction, including without limitation the rights
|
26
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
27
|
+
copies of the Software, and to permit persons to whom the Software is
|
28
|
+
furnished to do so, subject to the following conditions:
|
29
|
+
|
30
|
+
The above copyright notice and this permission notice shall be included in all
|
31
|
+
copies or substantial portions of the Software.
|
32
|
+
|
33
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
34
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
35
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
36
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
37
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
38
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
39
|
+
SOFTWARE.
|
data/readme.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Markly
|
2
|
+
|
3
|
+
A parser and abstract syntax tree for Markdown documents (CommonMark compatible) in Ruby. Originally forked from
|
4
|
+
[CommonMarker](https://github.com/gjtorikian/commonmarker). It also includes extensions to the CommonMark spec as
|
5
|
+
documented in the [GitHub Flavored Markdown spec](http://github.github.com/gfm/), such as support for tables,
|
6
|
+
strikethroughs, and autolinking.
|
7
|
+
|
8
|
+
[](https://github.com/ioquatix/markly/actions?workflow=Test)
|
10
|
+
|
11
|
+
## Motivation
|
12
|
+
|
13
|
+
This code base was originally forked from [Commonmarker](https://github.com/gjtorikian/commonmarker) before they
|
14
|
+
switched from `cmark-gfm` (C) to `comrak` (Rust). The original implementation provided access to the abstract syntax
|
15
|
+
tree (AST), which is useful for building tools on top of Markdown. The Rust implementation does not provide this
|
16
|
+
functionality, and so this fork was created to continue to provide these (and more) features.
|
17
|
+
|
18
|
+
## Usage
|
19
|
+
|
20
|
+
Please see the [project documentation](https://ioquatix.github.io/markly/) for more details.
|
21
|
+
|
22
|
+
- [Getting Started](https://ioquatix.github.io/markly/guides/getting-started/index) - This guide explains now to
|
23
|
+
install and use Markly.
|
24
|
+
|
25
|
+
- [Abstract Syntax Tree](https://ioquatix.github.io/markly/guides/abstract-syntax-tree/index) - This guide explains
|
26
|
+
how to use Markly's abstract syntax tree (AST) to parse and manipulate Markdown documents.
|
27
|
+
|
28
|
+
## Contributing
|
29
|
+
|
30
|
+
We welcome contributions to this project.
|
31
|
+
|
32
|
+
1. Fork it.
|
33
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
34
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
35
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
36
|
+
5. Create new Pull Request.
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
CHANGED
@@ -1,16 +1,61 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
|
-
-
|
8
|
+
- Yuki Izumi
|
9
9
|
- Samuel Williams
|
10
|
+
- John MacFarlane
|
11
|
+
- Ashe Connor
|
12
|
+
- Nick Wellnhofer
|
13
|
+
- Brett Walker
|
14
|
+
- Andrew Anderson
|
15
|
+
- Ben Woosley
|
16
|
+
- Goro Fuji
|
17
|
+
- Tomoya Chiba
|
18
|
+
- Akira Matsuda
|
19
|
+
- Danny Iachini
|
20
|
+
- Jerry van Leeuwen
|
21
|
+
- Michael Camilleri
|
22
|
+
- Mu-An Chiou
|
23
|
+
- Olle Jonsson
|
24
|
+
- Roberto Hidalgo
|
25
|
+
- Vitaliy Klachkov
|
10
26
|
autorequire:
|
11
27
|
bindir: bin
|
12
|
-
cert_chain:
|
13
|
-
|
28
|
+
cert_chain:
|
29
|
+
- |
|
30
|
+
-----BEGIN CERTIFICATE-----
|
31
|
+
MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
|
32
|
+
ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
|
33
|
+
CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
|
34
|
+
MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
|
35
|
+
MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
|
36
|
+
bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
|
37
|
+
igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
|
38
|
+
9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW
|
39
|
+
sGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPfaJOglovdxf7dgsHz67Xgd/ka+Wo1YqoE
|
40
|
+
e5AUKRwUuvaUaumAKgPH+4E4oiLXI4T1Ff5Q7xxv6yXvHuYtlMHhYfgNn8iiW8WN
|
41
|
+
XibYXPNP7NtieSQqwR/xM6IRSoyXKuS+ZNGDPUUGk8RoiV/xvVN4LrVm9upSc0ss
|
42
|
+
RZ6qwOQmXCo/lLcDUxJAgG95cPw//sI00tZan75VgsGzSWAOdjQpFM0l4dxvKwHn
|
43
|
+
tUeT3ZsAgt0JnGqNm2Bkz81kG4A2hSyFZTFA8vZGhp+hz+8Q573tAR89y9YJBdYM
|
44
|
+
zp0FM4zwMNEUwgfRzv1tEVVUEXmoFCyhzonUUw4nE4CFu/sE3ffhjKcXcY//qiSW
|
45
|
+
xm4erY3XAgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
46
|
+
BBYEFO9t7XWuFf2SKLmuijgqR4sGDlRsMC4GA1UdEQQnMCWBI3NhbXVlbC53aWxs
|
47
|
+
aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWBI3NhbXVlbC53aWxs
|
48
|
+
aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEBCwUAA4IBgQB5sxkE
|
49
|
+
cBsSYwK6fYpM+hA5B5yZY2+L0Z+27jF1pWGgbhPH8/FjjBLVn+VFok3CDpRqwXCl
|
50
|
+
xCO40JEkKdznNy2avOMra6PFiQyOE74kCtv7P+Fdc+FhgqI5lMon6tt9rNeXmnW/
|
51
|
+
c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp
|
52
|
+
8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
|
53
|
+
JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
|
54
|
+
eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
|
55
|
+
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
56
|
+
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
57
|
+
-----END CERTIFICATE-----
|
58
|
+
date: 2023-06-17 00:00:00.000000000 Z
|
14
59
|
dependencies:
|
15
60
|
- !ruby/object:Gem::Dependency
|
16
61
|
name: bake
|
@@ -27,21 +72,7 @@ dependencies:
|
|
27
72
|
- !ruby/object:Gem::Version
|
28
73
|
version: '0'
|
29
74
|
- !ruby/object:Gem::Dependency
|
30
|
-
name:
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
32
|
-
requirements:
|
33
|
-
- - "~>"
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '5.6'
|
36
|
-
type: :development
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - "~>"
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '5.6'
|
43
|
-
- !ruby/object:Gem::Dependency
|
44
|
-
name: rake
|
75
|
+
name: covered
|
45
76
|
requirement: !ruby/object:Gem::Requirement
|
46
77
|
requirements:
|
47
78
|
- - ">="
|
@@ -55,34 +86,38 @@ dependencies:
|
|
55
86
|
- !ruby/object:Gem::Version
|
56
87
|
version: '0'
|
57
88
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
89
|
+
name: sus
|
59
90
|
requirement: !ruby/object:Gem::Requirement
|
60
91
|
requirements:
|
61
|
-
- - "
|
92
|
+
- - ">="
|
62
93
|
- !ruby/object:Gem::Version
|
63
|
-
version: '0
|
94
|
+
version: '0'
|
64
95
|
type: :development
|
65
96
|
prerelease: false
|
66
97
|
version_requirements: !ruby/object:Gem::Requirement
|
67
98
|
requirements:
|
68
|
-
- - "
|
99
|
+
- - ">="
|
69
100
|
- !ruby/object:Gem::Version
|
70
|
-
version: '0
|
101
|
+
version: '0'
|
71
102
|
description:
|
72
103
|
email:
|
73
|
-
executables:
|
74
|
-
- markly
|
104
|
+
executables: []
|
75
105
|
extensions:
|
76
106
|
- ext/markly/extconf.rb
|
77
107
|
extra_rdoc_files: []
|
78
108
|
files:
|
79
|
-
-
|
109
|
+
- conduct.md
|
110
|
+
- ext/markly/Makefile
|
80
111
|
- ext/markly/arena.c
|
112
|
+
- ext/markly/arena.o
|
81
113
|
- ext/markly/autolink.c
|
82
114
|
- ext/markly/autolink.h
|
115
|
+
- ext/markly/autolink.o
|
83
116
|
- ext/markly/blocks.c
|
117
|
+
- ext/markly/blocks.o
|
84
118
|
- ext/markly/buffer.c
|
85
119
|
- ext/markly/buffer.h
|
120
|
+
- ext/markly/buffer.o
|
86
121
|
- ext/markly/case_fold_switch.inc
|
87
122
|
- ext/markly/chunk.h
|
88
123
|
- ext/markly/cmark-gfm-core-extensions.h
|
@@ -92,75 +127,109 @@ files:
|
|
92
127
|
- ext/markly/cmark-gfm_export.h
|
93
128
|
- ext/markly/cmark-gfm_version.h
|
94
129
|
- ext/markly/cmark.c
|
130
|
+
- ext/markly/cmark.o
|
95
131
|
- ext/markly/cmark_ctype.c
|
96
132
|
- ext/markly/cmark_ctype.h
|
133
|
+
- ext/markly/cmark_ctype.o
|
97
134
|
- ext/markly/commonmark.c
|
135
|
+
- ext/markly/commonmark.o
|
98
136
|
- ext/markly/config.h
|
99
137
|
- ext/markly/core-extensions.c
|
138
|
+
- ext/markly/core-extensions.o
|
100
139
|
- ext/markly/entities.inc
|
101
140
|
- ext/markly/ext_scanners.c
|
102
141
|
- ext/markly/ext_scanners.h
|
142
|
+
- ext/markly/ext_scanners.o
|
103
143
|
- ext/markly/extconf.rb
|
104
144
|
- ext/markly/footnotes.c
|
105
145
|
- ext/markly/footnotes.h
|
146
|
+
- ext/markly/footnotes.o
|
106
147
|
- ext/markly/houdini.h
|
107
148
|
- ext/markly/houdini_href_e.c
|
149
|
+
- ext/markly/houdini_href_e.o
|
108
150
|
- ext/markly/houdini_html_e.c
|
151
|
+
- ext/markly/houdini_html_e.o
|
109
152
|
- ext/markly/houdini_html_u.c
|
153
|
+
- ext/markly/houdini_html_u.o
|
110
154
|
- ext/markly/html.c
|
111
155
|
- ext/markly/html.h
|
156
|
+
- ext/markly/html.o
|
112
157
|
- ext/markly/inlines.c
|
113
158
|
- ext/markly/inlines.h
|
159
|
+
- ext/markly/inlines.o
|
114
160
|
- ext/markly/iterator.c
|
115
161
|
- ext/markly/iterator.h
|
162
|
+
- ext/markly/iterator.o
|
116
163
|
- ext/markly/latex.c
|
164
|
+
- ext/markly/latex.o
|
117
165
|
- ext/markly/linked_list.c
|
166
|
+
- ext/markly/linked_list.o
|
118
167
|
- ext/markly/man.c
|
168
|
+
- ext/markly/man.o
|
119
169
|
- ext/markly/map.c
|
120
170
|
- ext/markly/map.h
|
171
|
+
- ext/markly/map.o
|
172
|
+
- ext/markly/markly.bundle
|
121
173
|
- ext/markly/markly.c
|
122
174
|
- ext/markly/markly.h
|
175
|
+
- ext/markly/markly.o
|
123
176
|
- ext/markly/node.c
|
124
177
|
- ext/markly/node.h
|
178
|
+
- ext/markly/node.o
|
125
179
|
- ext/markly/parser.h
|
126
180
|
- ext/markly/plaintext.c
|
181
|
+
- ext/markly/plaintext.o
|
127
182
|
- ext/markly/plugin.c
|
128
183
|
- ext/markly/plugin.h
|
184
|
+
- ext/markly/plugin.o
|
129
185
|
- ext/markly/references.c
|
130
186
|
- ext/markly/references.h
|
187
|
+
- ext/markly/references.o
|
131
188
|
- ext/markly/registry.c
|
132
189
|
- ext/markly/registry.h
|
190
|
+
- ext/markly/registry.o
|
133
191
|
- ext/markly/render.c
|
134
192
|
- ext/markly/render.h
|
193
|
+
- ext/markly/render.o
|
135
194
|
- ext/markly/scanners.c
|
136
195
|
- ext/markly/scanners.h
|
196
|
+
- ext/markly/scanners.o
|
137
197
|
- ext/markly/scanners.re
|
138
198
|
- ext/markly/strikethrough.c
|
139
199
|
- ext/markly/strikethrough.h
|
200
|
+
- ext/markly/strikethrough.o
|
140
201
|
- ext/markly/syntax_extension.c
|
141
202
|
- ext/markly/syntax_extension.h
|
203
|
+
- ext/markly/syntax_extension.o
|
142
204
|
- ext/markly/table.c
|
143
205
|
- ext/markly/table.h
|
206
|
+
- ext/markly/table.o
|
144
207
|
- ext/markly/tagfilter.c
|
145
208
|
- ext/markly/tagfilter.h
|
209
|
+
- ext/markly/tagfilter.o
|
146
210
|
- ext/markly/tasklist.c
|
147
211
|
- ext/markly/tasklist.h
|
212
|
+
- ext/markly/tasklist.o
|
148
213
|
- ext/markly/utf8.c
|
149
214
|
- ext/markly/utf8.h
|
215
|
+
- ext/markly/utf8.o
|
150
216
|
- ext/markly/xml.c
|
217
|
+
- ext/markly/xml.o
|
151
218
|
- lib/markly.rb
|
152
219
|
- lib/markly/flags.rb
|
153
|
-
- lib/markly/markly.bundle
|
154
220
|
- lib/markly/node.rb
|
155
221
|
- lib/markly/node/inspect.rb
|
156
222
|
- lib/markly/renderer/generic.rb
|
157
223
|
- lib/markly/renderer/html.rb
|
158
224
|
- lib/markly/version.rb
|
225
|
+
- license.md
|
226
|
+
- readme.md
|
159
227
|
homepage: https://github.com/ioquatix/markly
|
160
228
|
licenses:
|
161
229
|
- MIT
|
162
230
|
metadata:
|
163
231
|
funding_uri: https://github.com/sponsors/ioquatix/
|
232
|
+
documentation_uri: https://ioquatix.github.io/markly/
|
164
233
|
post_install_message:
|
165
234
|
rdoc_options: []
|
166
235
|
require_paths:
|
@@ -176,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
245
|
- !ruby/object:Gem::Version
|
177
246
|
version: '0'
|
178
247
|
requirements: []
|
179
|
-
rubygems_version: 3.
|
248
|
+
rubygems_version: 3.4.7
|
180
249
|
signing_key:
|
181
250
|
specification_version: 4
|
182
251
|
summary: CommonMark parser and renderer. Written in C, wrapped in Ruby.
|
metadata.gz.sig
ADDED
Binary file
|
data/bin/markly
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'optparse'
|
5
|
-
require 'ostruct'
|
6
|
-
|
7
|
-
require_relative '../lib/markly'
|
8
|
-
|
9
|
-
def parse_options
|
10
|
-
options = OpenStruct.new
|
11
|
-
extensions = Markly.extensions
|
12
|
-
parse_flags = Markly::PARSE_FLAGS
|
13
|
-
render_flags = Markly::RENDER_FLAGS
|
14
|
-
|
15
|
-
options.active_extensions = []
|
16
|
-
options.active_parse_flags = Markly::DEFAULT
|
17
|
-
options.active_render_flags = Markly::DEFAULT
|
18
|
-
|
19
|
-
option_parser = OptionParser.new do |opts|
|
20
|
-
opts.banner = 'Usage: markly [--html-renderer] [--extension=EXTENSION]'
|
21
|
-
opts.separator ' [--parse-option=OPTION]'
|
22
|
-
opts.separator ' [--render-option=OPTION]'
|
23
|
-
opts.separator ' [FILE..]'
|
24
|
-
opts.separator ''
|
25
|
-
opts.separator 'Convert one or more CommonMark files to HTML and write to standard output.'
|
26
|
-
opts.separator 'If no FILE argument is provided, text will be read from STDIN.'
|
27
|
-
opts.separator ''
|
28
|
-
|
29
|
-
opts.on('--extension=EXTENSION', Array, 'Use EXTENSION for parsing and HTML output (unless --html-renderer is specified)') do |values|
|
30
|
-
values.each do |value|
|
31
|
-
if extensions.include?(value)
|
32
|
-
options.active_extensions << value.to_sym
|
33
|
-
else
|
34
|
-
abort("extension '#{value}' not found")
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
opts.on('-h', '--help', 'Prints this help') do
|
40
|
-
puts opts
|
41
|
-
puts
|
42
|
-
puts "Available extentions: #{extensions.join(', ')}"
|
43
|
-
puts "Available parse flags: #{parser_flags.keys.join(', ')}"
|
44
|
-
puts "Available render flags: #{render_flags.keys.join(', ')}"
|
45
|
-
puts
|
46
|
-
puts 'See the README for more information on these.'
|
47
|
-
exit
|
48
|
-
end
|
49
|
-
|
50
|
-
opts.on('--html-renderer', 'Use the HtmlRenderer renderer rather than the native C renderer') do
|
51
|
-
options.renderer = true
|
52
|
-
end
|
53
|
-
|
54
|
-
opts.on('--parse-option=OPTION', Array, 'OPTION passed during parsing') do |values|
|
55
|
-
values.each do |value|active_parser_flags
|
56
|
-
if parser_flags.key?(value.to_sym)
|
57
|
-
options.active_parser_flags << value.to_sym
|
58
|
-
else
|
59
|
-
abort("parse-option '#{value}' not found")
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
opts.on('--render-option=OPTION', Array, 'OPTION passed during rendering') do |values|
|
65
|
-
values.each do |value|
|
66
|
-
if render_flags.key?(value.to_sym)
|
67
|
-
options.active_render_flags << value.to_sym
|
68
|
-
else
|
69
|
-
abort("render-option '#{value}' not found")
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
opts.on('-v', '--version', 'Version information') do
|
75
|
-
puts "markly #{Markly::VERSION}"
|
76
|
-
exit
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
option_parser.parse!
|
81
|
-
|
82
|
-
options
|
83
|
-
end
|
84
|
-
|
85
|
-
options = parse_options
|
86
|
-
|
87
|
-
doc = Markly.parse(ARGF.read, flags: options.active_parse_flags, extensions: options.active_extensions)
|
88
|
-
|
89
|
-
if options.renderer
|
90
|
-
renderer = Markly::HtmlRenderer.new(extensions: options.active_extensions)
|
91
|
-
STDOUT.write(renderer.render(doc))
|
92
|
-
else
|
93
|
-
STDOUT.write(doc.to_html(flags: options.active_render_flags, extensions: options.active_extensions))
|
94
|
-
end
|
data/lib/markly/markly.bundle
DELETED
Binary file
|