djot 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mdl_style.rb +4 -0
- data/.mdlrc +1 -0
- data/.rubocop.yml +8 -3
- data/.rubocop_todo.yml +10 -5
- data/CHANGELOG.md +24 -0
- data/Gemfile +2 -0
- data/README.md +20 -2
- data/Rakefile +18 -1
- data/Steepfile +2 -0
- data/djot.gemspec +1 -1
- data/lib/djot/javascript.rb +93 -24
- data/lib/djot/lua.rb +52 -0
- data/lib/djot/version.rb +1 -1
- data/lib/djot.rb +7 -34
- data/sig/djot.gen.rbs +42 -0
- data/sig/djot.rbs +9 -4
- metadata +10 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2419533ac547deab5c4ec161d2147c47895839050151bf1233c093d03c7f6202
|
4
|
+
data.tar.gz: 2aae784074f6b9df2827d6dfc6ce05cb4a53fb9ad117b1c8a1141bc18234f6df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3e5caed7e26dd27fea38c2c323024d64803ed88de74ed37e81020d6cb8117a810b6926c3e4b0d877781989d526e83916ba441be7a81c8f8ee7074413e50de0d
|
7
|
+
data.tar.gz: aa3fa15f1deb0b930779806e0cad85b2a7a65be32a252825b8211089e38341c59f29fb9713a1755aef514b2a540067e706f022188571a35725190f94128654f6
|
data/.mdl_style.rb
ADDED
data/.mdlrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
style ".mdl_style.rb"
|
data/.rubocop.yml
CHANGED
@@ -15,11 +15,16 @@ Style/StringLiteralsInInterpolation:
|
|
15
15
|
Layout/LineLength:
|
16
16
|
Max: 120
|
17
17
|
|
18
|
-
Style/Documentation:
|
19
|
-
Enabled: false
|
20
|
-
|
21
18
|
Style/FrozenStringLiteralComment:
|
22
19
|
EnforcedStyle: never
|
23
20
|
|
21
|
+
Style/DocumentDynamicEvalDefinition:
|
22
|
+
Enabled: true
|
23
|
+
Exclude:
|
24
|
+
- lib/djot/javascript.rb
|
25
|
+
|
26
|
+
Metrics/ClassLength:
|
27
|
+
Enabled: false
|
28
|
+
|
24
29
|
require:
|
25
30
|
- rubocop-rake
|
data/.rubocop_todo.yml
CHANGED
@@ -1,18 +1,23 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2023-01-
|
3
|
+
# on 2023-01-30 13:50:23 UTC using RuboCop version 1.44.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
|
11
|
+
Metrics/AbcSize:
|
12
|
+
Max: 18
|
13
|
+
|
9
14
|
# Offense count: 2
|
10
15
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
|
11
16
|
# AllowedMethods: refine
|
12
17
|
Metrics/BlockLength:
|
13
18
|
Max: 37
|
14
19
|
|
15
|
-
# Offense count:
|
16
|
-
# Configuration parameters: CountComments, CountAsOne.
|
17
|
-
Metrics/
|
18
|
-
Max:
|
20
|
+
# Offense count: 2
|
21
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
|
22
|
+
Metrics/MethodLength:
|
23
|
+
Max: 22
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,30 @@
|
|
2
2
|
|
3
3
|
## [Unreleased]
|
4
4
|
|
5
|
+
## [0.0.6] - 2023-01-31
|
6
|
+
|
7
|
+
Note again that the default parser might be changed from djot.lua to djot.js in future version.
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
* `Djot::Lua` module, which contains ex-`Djot.render_*` methods.
|
12
|
+
Now `Djot.render_*` methods are pointers to `Djot::Lua.render_*` (default is not changed for this release).
|
13
|
+
* Option `warn` for `Djot::JavaScript.parse`.
|
14
|
+
* `Djot::JavaScript.parse_events` method.
|
15
|
+
* Option `warn` for `Djot::JavaScript.render_html`.
|
16
|
+
(Option `overrides` are not yet supported.)
|
17
|
+
* Option `warn` and `smart_punctuation_map` for `Djot::JavaScript.to_pandoc`.
|
18
|
+
(Please caution that `warn` options has not yet tested.)
|
19
|
+
* Option `warn` for `Djot::JavaScript.from_pandoc`.
|
20
|
+
(Please caution that `warn` options has not yet tested.)
|
21
|
+
|
22
|
+
### Changed
|
23
|
+
|
24
|
+
* JavaScript runtime has changed from ExecJS to MiniRacer, for passing Ruby proc to JavaScript runtime.
|
25
|
+
See also [rails/execjs#71 > Custom configuration of runtime](https://github.com/rails/execjs/issues/71).
|
26
|
+
* `Djot::JavaScript::VERSION` and `Djot::JavaScript::PATH` is deprecated.
|
27
|
+
Use `Djot::JavaScript.version` and `Djot::JavaScript.path` instead.
|
28
|
+
|
5
29
|
## [0.0.5] - 2023-01-21
|
6
30
|
|
7
31
|
Note that the default parser might be changed from djot.lua to djot.js in future version.
|
data/Gemfile
CHANGED
@@ -2,9 +2,11 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
+
gem "mdl", "~> 0.12.0"
|
5
6
|
gem "rake", "~> 13.0"
|
6
7
|
gem "rdoc", "~> 6.4"
|
7
8
|
gem "rubocop", "~> 1.21"
|
8
9
|
gem "rubocop-rake", "~> 0.6.0"
|
9
10
|
gem "steep", "~> 1.1"
|
10
11
|
gem "test-unit", "~> 3.0"
|
12
|
+
gem "typeprof", "~> 0.21.4"
|
data/README.md
CHANGED
@@ -20,7 +20,23 @@ gem install djot
|
|
20
20
|
|
21
21
|
```ruby
|
22
22
|
require 'djot'
|
23
|
+
|
23
24
|
Djot.render_html('This is *djot*')
|
25
|
+
#=> "<p>This is <strong>djot</strong></p>\n"
|
26
|
+
|
27
|
+
Djot::JavaScript.parse("- `hello", warn: ->(w) { p w })
|
28
|
+
#=>
|
29
|
+
# {"tag"=>"doc",
|
30
|
+
# "references"=>{},
|
31
|
+
# "footnotes"=>{},
|
32
|
+
# "children"=>
|
33
|
+
# [{"tag"=>"bullet_list",
|
34
|
+
# "tight"=>true,
|
35
|
+
# "style"=>"-",
|
36
|
+
# "children"=>[{"tag"=>"list_item", "children"=>[{"tag"=>"para", "children"=>[{"tag"=>"str", "text"=>"hello"}]}]}]}]}
|
37
|
+
#
|
38
|
+
# stdout:
|
39
|
+
# {"message"=>"Unclosed verbatim", "offset"=>7}
|
24
40
|
```
|
25
41
|
|
26
42
|
## Development
|
@@ -39,8 +55,10 @@ and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
39
55
|
|
40
56
|
### TODO
|
41
57
|
|
42
|
-
* Use [Attach global Ruby functions to your JavaScript context](https://github.com/rubyjs/mini_racer#attach-global-ruby-functions-to-your-javascript-context) for the functions' options which accepts lambda expressions.
|
43
58
|
* Create document class (and more) for idiomatic control in Ruby.
|
59
|
+
* Write parser in pure Ruby.
|
60
|
+
* Make JavaScript version as default. Currently the default is Lua version.
|
61
|
+
* Update Lua implementation from djot to djot.lua.
|
44
62
|
|
45
63
|
## Contributing
|
46
64
|
|
@@ -54,7 +72,7 @@ to the [code of conduct](CODE_OF_CONDUCT.md).
|
|
54
72
|
|
55
73
|
As mentioned earlier, this library only calls the original JavaScript and Lua implementations; the important work is done in those libraries.
|
56
74
|
The Lua implementation was sufficient to render in HTML, but thanks to the more Ruby-friendly JavaScript implementation, even more flexible operations can now be performed in Ruby.
|
57
|
-
This gem also uses [
|
75
|
+
This gem also uses [MiniRacer](https://github.com/rubyjs/mini_racer) and [ruby-lua](https://github.com/glejeune/ruby-lua) to call JavaScript and Lua source codes respectibly.
|
58
76
|
|
59
77
|
## License
|
60
78
|
|
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ require "rubocop/rake_task"
|
|
11
11
|
|
12
12
|
RuboCop::RakeTask.new
|
13
13
|
|
14
|
-
task default: %i[copy copy_js test rubocop]
|
14
|
+
task default: %i[copy copy_js test rubocop sig mdl]
|
15
15
|
|
16
16
|
desc "Copy JavaScript files"
|
17
17
|
task copy_js: "lib/js/djot.js"
|
@@ -53,3 +53,20 @@ RDoc::Task.new do |rdoc|
|
|
53
53
|
rdoc.main = readme
|
54
54
|
rdoc.rdoc_files.include(readme, "lib/**/*.rb")
|
55
55
|
end
|
56
|
+
|
57
|
+
desc "Lint Markdown files"
|
58
|
+
task "mdl" do
|
59
|
+
sh "bundle exec mdl CHANGELOG.md README.md"
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "Type check"
|
63
|
+
task tc: :sig do
|
64
|
+
sh "bundle exec steep check"
|
65
|
+
end
|
66
|
+
|
67
|
+
desc "Update generated RBS"
|
68
|
+
task sig: "sig/djot.gen.rbs"
|
69
|
+
|
70
|
+
file "sig/djot.gen.rbs" => ["sig/djot.rbs", *Dir["lib/**/*.rb"]] do |t|
|
71
|
+
sh "bundle", "exec", "typeprof", "-o", t.name, *t.sources
|
72
|
+
end
|
data/Steepfile
CHANGED
data/djot.gemspec
CHANGED
data/lib/djot/javascript.rb
CHANGED
@@ -1,75 +1,144 @@
|
|
1
1
|
require "pathname"
|
2
|
-
require "
|
2
|
+
require "mini_racer"
|
3
3
|
|
4
4
|
module Djot
|
5
5
|
# Functionalities of djot.js
|
6
6
|
module JavaScript
|
7
|
-
|
7
|
+
def self.path # :nodoc:
|
8
|
+
@path ||= Pathname(__dir__ || (raise Error)) / ".." / "js" / "djot.js"
|
9
|
+
end
|
10
|
+
|
11
|
+
PATH = path # :nodoc:
|
8
12
|
|
9
|
-
|
13
|
+
deprecate_constant :PATH
|
14
|
+
|
15
|
+
def self.source # :nodoc:
|
10
16
|
@source ||= PATH.read
|
11
17
|
end
|
12
18
|
|
13
|
-
def self.context
|
14
|
-
@context
|
19
|
+
def self.context # :nodoc:
|
20
|
+
return @context if @context
|
21
|
+
|
22
|
+
context = MiniRacer::Context.new
|
23
|
+
context.eval("let args, result")
|
24
|
+
context.eval(source)
|
25
|
+
@context = context
|
15
26
|
end
|
16
27
|
|
17
28
|
# Correspond to +djot.parse+
|
18
29
|
# (https://github.com/jgm/djot.js#parsing-djot-to-an-ast)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
30
|
+
def self.parse(input, source_positions: nil, warn: nil)
|
31
|
+
args = [input]
|
32
|
+
options = {}
|
33
|
+
options["sourcePositions"] = source_positions if source_positions
|
34
|
+
args << options
|
35
|
+
context.eval("args = #{JSON.generate(args)}")
|
36
|
+
if warn
|
37
|
+
context.attach("warn", warn)
|
38
|
+
context.eval('args[1]["warn"] = warn')
|
39
|
+
end
|
40
|
+
context.eval("djot.parse.apply(this, args)")
|
23
41
|
end
|
24
42
|
|
25
|
-
#
|
43
|
+
# Correspond to +djot.parseEvents+
|
26
44
|
# (https://github.com/jgm/djot.js#parsing-djot-to-a-stream-of-events)
|
45
|
+
def self.parse_events(input, warn: nil, &block)
|
46
|
+
context.eval("args = #{JSON.generate([input, {}])}")
|
47
|
+
if warn
|
48
|
+
context.attach("warn", warn)
|
49
|
+
context.eval('args[1]["warn"] = warn')
|
50
|
+
end
|
51
|
+
source = if block_given?
|
52
|
+
context.attach("fun", block)
|
53
|
+
<<~END_JAVASCRIPT
|
54
|
+
for (let event of djot.parseEvents(...args)) {
|
55
|
+
fun(event)
|
56
|
+
}
|
57
|
+
END_JAVASCRIPT
|
58
|
+
else
|
59
|
+
# TODO: Use enum_for
|
60
|
+
<<~END_JAVASCRIPT
|
61
|
+
events = []
|
62
|
+
for (let event of djot.parseEvents(...args)) {
|
63
|
+
events.push(event)
|
64
|
+
}
|
65
|
+
events
|
66
|
+
END_JAVASCRIPT
|
67
|
+
end
|
68
|
+
context.eval(source)
|
69
|
+
end
|
27
70
|
|
28
71
|
# Correspond to +djot.renderAST+
|
29
72
|
# (https://github.com/jgm/djot.js#pretty-printing-the-djot-ast)
|
30
73
|
def self.render_ast(doc)
|
31
|
-
|
74
|
+
call("renderAST", doc)
|
32
75
|
end
|
33
76
|
|
34
77
|
# Correspond to +djot.renderHTML+
|
35
78
|
# (https://github.com/jgm/djot.js#rendering-the-djot-ast-to-html)
|
36
79
|
#
|
37
|
-
# TODO: support +
|
38
|
-
def self.render_html(doc)
|
39
|
-
context.
|
80
|
+
# TODO: support +overrides+ option
|
81
|
+
def self.render_html(doc, warn: nil)
|
82
|
+
context.eval("args = #{JSON.generate([doc, {}])}")
|
83
|
+
if warn
|
84
|
+
context.attach("warn", warn)
|
85
|
+
context.eval('args[1]["warn"] = warn')
|
86
|
+
end
|
87
|
+
context.eval("djot.renderHTML.apply(this, args)")
|
40
88
|
end
|
41
89
|
|
42
90
|
# Correspond to +djot.renderDjot+
|
43
91
|
# (https://github.com/jgm/djot.js#rendering-djot)
|
44
|
-
#
|
45
|
-
# TODO: support options
|
46
92
|
def self.render_djot(doc, wrap_width: nil)
|
47
93
|
options = {}
|
48
94
|
options["wrapWidth"] = wrap_width if wrap_width
|
49
95
|
|
50
|
-
|
96
|
+
call("renderDjot", doc, options)
|
51
97
|
end
|
52
98
|
|
53
99
|
# Correspond to +djot.toPandoc+
|
54
100
|
# (https://github.com/jgm/djot.js#pandoc-interoperability)
|
55
101
|
#
|
56
|
-
#
|
57
|
-
|
58
|
-
|
102
|
+
# CAUTION: +warn+ option hasn't yet tested.
|
103
|
+
# There may be bugs.
|
104
|
+
def self.to_pandoc(doc, warn: nil, smart_punctuation_map: nil)
|
105
|
+
options = {}
|
106
|
+
options["smartPunctuationMap"] = smart_punctuation_map if smart_punctuation_map
|
107
|
+
context.eval("args = #{JSON.generate([doc, options])}")
|
108
|
+
if warn
|
109
|
+
context.attach("warn", warn)
|
110
|
+
context.eval('args[1]["warn"] = warn')
|
111
|
+
end
|
112
|
+
context.eval("djot.toPandoc.apply(this, args)")
|
59
113
|
end
|
60
114
|
|
61
115
|
# Correspond to +djot.fromPandoc+
|
62
116
|
# (https://github.com/jgm/djot.js#pandoc-interoperability)
|
63
117
|
#
|
64
|
-
#
|
65
|
-
def self.from_pandoc(pandoc)
|
66
|
-
context.
|
118
|
+
# CAUTION: +warn+ options hasn't yet tested.
|
119
|
+
def self.from_pandoc(pandoc, warn: nil)
|
120
|
+
context.eval("args = #{JSON.generate([pandoc, {}])}")
|
121
|
+
if warn
|
122
|
+
context.attach("warn", warn)
|
123
|
+
context.eval('args[1]["warn"] = warn')
|
124
|
+
end
|
125
|
+
context.eval("djot.fromPandoc.apply(this, args)")
|
67
126
|
end
|
68
127
|
|
69
128
|
# TODO: support filters
|
70
129
|
|
71
130
|
# Correspond to +djot.version+
|
72
131
|
# (https://github.com/jgm/djot.js#getting-the-version)
|
73
|
-
|
132
|
+
def self.version
|
133
|
+
@version ||= context.eval("djot.version")
|
134
|
+
end
|
135
|
+
|
136
|
+
VERSION = version # :nodoc:
|
137
|
+
|
138
|
+
deprecate_constant :VERSION
|
139
|
+
|
140
|
+
def self.call(name, *args) # :nodoc:
|
141
|
+
context.eval("djot.#{name}.apply(this, #{::JSON.generate(args)})")
|
142
|
+
end
|
74
143
|
end
|
75
144
|
end
|
data/lib/djot/lua.rb
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
require "language/lua"
|
2
|
+
require "pathname"
|
3
|
+
|
4
|
+
module Djot
|
5
|
+
# Functionalities of djot (Lua implementation)
|
6
|
+
module Lua
|
7
|
+
LUA = Language::Lua.new # :nodoc:
|
8
|
+
LUA.eval(<<~END_LUA)
|
9
|
+
function djot_parser(input)
|
10
|
+
local parser = require("djot").Parser:new(input)
|
11
|
+
parser:parse()
|
12
|
+
return parser
|
13
|
+
end
|
14
|
+
|
15
|
+
function djot_render_html(input)
|
16
|
+
return djot_parser(input):render_html()
|
17
|
+
end
|
18
|
+
|
19
|
+
function djot_render_matches(input)
|
20
|
+
return djot_parser(input):render_matches()
|
21
|
+
end
|
22
|
+
|
23
|
+
function djot_render_ast(input)
|
24
|
+
return djot_parser(input):render_ast()
|
25
|
+
end
|
26
|
+
END_LUA
|
27
|
+
|
28
|
+
ROOT = Pathname(__dir__ || (raise Error)) / ".." / "lua" # :nodoc:
|
29
|
+
|
30
|
+
def self.render_html(input)
|
31
|
+
run_at_root do
|
32
|
+
LUA.djot_render_html(input)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.render_matches(input)
|
37
|
+
run_at_root do
|
38
|
+
LUA.djot_render_matches(input)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.render_ast(input)
|
43
|
+
run_at_root do
|
44
|
+
LUA.djot_render_ast(input)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.run_at_root(&block) # :nodoc:
|
49
|
+
Dir.chdir(ROOT.to_s, &block)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
data/lib/djot/version.rb
CHANGED
data/lib/djot.rb
CHANGED
@@ -1,49 +1,22 @@
|
|
1
1
|
require_relative "djot/version"
|
2
2
|
require_relative "djot/javascript"
|
3
|
-
|
4
|
-
require "pathname"
|
3
|
+
require_relative "djot/lua"
|
5
4
|
|
5
|
+
# Provides Djot parsing functionalities.
|
6
|
+
# +Djot.*+ methods are pointing to Lua implementation now.
|
7
|
+
# See also Djot::JavaScript for ones pointing to JavaScript implementation.
|
6
8
|
module Djot
|
7
9
|
class Error < StandardError; end
|
8
10
|
|
9
|
-
LUA = Language::Lua.new
|
10
|
-
LUA.eval(<<~END_LUA)
|
11
|
-
function djot_parser(input)
|
12
|
-
local parser = require("djot").Parser:new(input)
|
13
|
-
parser:parse()
|
14
|
-
return parser
|
15
|
-
end
|
16
|
-
|
17
|
-
function djot_render_html(input)
|
18
|
-
return djot_parser(input):render_html()
|
19
|
-
end
|
20
|
-
|
21
|
-
function djot_render_matches(input)
|
22
|
-
return djot_parser(input):render_matches()
|
23
|
-
end
|
24
|
-
|
25
|
-
function djot_render_ast(input)
|
26
|
-
return djot_parser(input):render_ast()
|
27
|
-
end
|
28
|
-
END_LUA
|
29
|
-
|
30
|
-
ROOT = Pathname(__dir__) / "lua"
|
31
|
-
|
32
11
|
def self.render_html(input)
|
33
|
-
|
34
|
-
LUA.djot_render_html(input)
|
35
|
-
end
|
12
|
+
Lua.render_html(input)
|
36
13
|
end
|
37
14
|
|
38
15
|
def self.render_matches(input)
|
39
|
-
|
40
|
-
LUA.djot_render_matches(input)
|
41
|
-
end
|
16
|
+
Lua.render_matches(input)
|
42
17
|
end
|
43
18
|
|
44
19
|
def self.render_ast(input)
|
45
|
-
|
46
|
-
LUA.djot_render_ast(input)
|
47
|
-
end
|
20
|
+
Lua.render_ast(input)
|
48
21
|
end
|
49
22
|
end
|
data/sig/djot.gen.rbs
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# TypeProf 0.21.4
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module Djot
|
5
|
+
VERSION: String
|
6
|
+
|
7
|
+
def self.render_html: (untyped input) -> untyped
|
8
|
+
def self.render_matches: (untyped input) -> untyped
|
9
|
+
def self.render_ast: (untyped input) -> untyped
|
10
|
+
|
11
|
+
module JavaScript
|
12
|
+
PATH: Pathname
|
13
|
+
VERSION: (Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?
|
14
|
+
self.@path: Pathname
|
15
|
+
self.@version: (Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?
|
16
|
+
self.@context: MiniRacer::Context
|
17
|
+
self.@source: String
|
18
|
+
|
19
|
+
def self.path: -> Pathname
|
20
|
+
def self.source: -> String
|
21
|
+
def self.context: -> MiniRacer::Context?
|
22
|
+
def self.parse: (untyped input, ?source_positions: nil, ?warn: nil) -> ((Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?)
|
23
|
+
def self.parse_events: (untyped input, ?warn: nil) -> ((Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?)
|
24
|
+
def self.render_ast: (untyped doc) -> ((Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?)
|
25
|
+
def self.render_html: (untyped doc, ?warn: nil) -> ((Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?)
|
26
|
+
def self.render_djot: (untyped doc, ?wrap_width: nil) -> ((Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?)
|
27
|
+
def self.to_pandoc: (untyped doc, ?warn: nil, ?smart_punctuation_map: nil) -> ((Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?)
|
28
|
+
def self.from_pandoc: (untyped pandoc, ?warn: nil) -> ((Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?)
|
29
|
+
def self.version: -> ((Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?)
|
30
|
+
def self.call: (String name, *Hash[String, untyped] args) -> ((Array[untyped] | Hash[untyped, untyped] | MiniRacer::JavaScriptFunction | Time)?)
|
31
|
+
end
|
32
|
+
|
33
|
+
module Lua
|
34
|
+
LUA: untyped
|
35
|
+
ROOT: Pathname
|
36
|
+
|
37
|
+
def self.render_html: (untyped input) -> untyped
|
38
|
+
def self.render_matches: (untyped input) -> untyped
|
39
|
+
def self.render_ast: (untyped input) -> untyped
|
40
|
+
def self.run_at_root: { (String) -> untyped } -> untyped
|
41
|
+
end
|
42
|
+
end
|
data/sig/djot.rbs
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
# TODO
|
1
2
|
module Djot
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
module JavaScript
|
4
|
+
end
|
5
|
+
|
6
|
+
module Lua
|
7
|
+
end
|
8
|
+
|
9
|
+
class Error < StandardError
|
10
|
+
end
|
6
11
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: djot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gemmaro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: mini_racer
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.6.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.6.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ruby-lua
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,6 +46,8 @@ executables: []
|
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
+
- ".mdl_style.rb"
|
50
|
+
- ".mdlrc"
|
49
51
|
- ".rubocop.yml"
|
50
52
|
- ".rubocop_todo.yml"
|
51
53
|
- CHANGELOG.md
|
@@ -58,6 +60,7 @@ files:
|
|
58
60
|
- djot.gemspec
|
59
61
|
- lib/djot.rb
|
60
62
|
- lib/djot/javascript.rb
|
63
|
+
- lib/djot/lua.rb
|
61
64
|
- lib/djot/version.rb
|
62
65
|
- lib/js/djot.js
|
63
66
|
- lib/lua/djot.lua
|
@@ -68,6 +71,7 @@ files:
|
|
68
71
|
- lib/lua/djot/html.lua
|
69
72
|
- lib/lua/djot/inline.lua
|
70
73
|
- lib/lua/djot/match.lua
|
74
|
+
- sig/djot.gen.rbs
|
71
75
|
- sig/djot.rbs
|
72
76
|
homepage: https://gitlab.com/gemmaro/ruby-djot
|
73
77
|
licenses:
|
@@ -92,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
96
|
- !ruby/object:Gem::Version
|
93
97
|
version: '0'
|
94
98
|
requirements: []
|
95
|
-
rubygems_version: 3.
|
99
|
+
rubygems_version: 3.4.1
|
96
100
|
signing_key:
|
97
101
|
specification_version: 4
|
98
102
|
summary: Djot parser
|