rspec-documentation 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -4
- data/lib/rspec/documentation/version.rb +1 -1
- data/lib/rspec_documentation/kramdown_html_converter.rb +13 -0
- data/lib/rspec_documentation/project_initialization.rb +3 -1
- data/lib/rspec_documentation.rb +0 -3
- data/lib/templates/header.html.erb +1 -1
- data/lib/templates/modal_spec.html.erb +7 -1
- data/lib/templates/tabbed_spec.html.erb +1 -1
- data/rspec-documentation/pages/400-Dependencies.md +13 -0
- data/rspec-documentation.gemspec +0 -1
- metadata +3 -17
- data/lib/rspec_documentation/markdown_renderer.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33437a93f6595a9ed9fe7b0970b2736e8c2a83db3d63038021d8878f8b75065e
|
4
|
+
data.tar.gz: 3b973515d7a23afc87cb2ee2124ce07a41bed3a4a8e53d431b4bc70fa594fee1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60085cdc0fdd2c356d3783730683b88068a30e3093b5be151b062e0cf23c3c3dab6adc06b7facdf51e584e7ea532c804fe4613844bbdb96a9f9ed1f73c386c86
|
7
|
+
data.tar.gz: 76e43c185ae945964822c30dcee78221b182d9ad342fbbee720cf6d1947087eb25dde68085a0aefb5d9ec23d9e7ff12b702159cffb6c503ebedef63842746838
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rspec-documentation (0.0.
|
4
|
+
rspec-documentation (0.0.11)
|
5
5
|
htmlbeautifier (~> 1.4)
|
6
6
|
kramdown (~> 2.4)
|
7
7
|
kramdown-parser-gfm (~> 1.1)
|
8
8
|
nokogiri (~> 1.15)
|
9
9
|
paintbrush (~> 0.1.3)
|
10
|
-
redcarpet (~> 3.6)
|
11
10
|
rouge (~> 4.1)
|
12
11
|
rspec (~> 3.12)
|
13
12
|
|
@@ -37,7 +36,6 @@ GEM
|
|
37
36
|
racc (1.7.0)
|
38
37
|
rainbow (3.1.1)
|
39
38
|
rake (13.0.6)
|
40
|
-
redcarpet (3.6.0)
|
41
39
|
regexp_parser (2.8.1)
|
42
40
|
rexml (3.2.5)
|
43
41
|
rouge (4.1.2)
|
@@ -108,4 +106,4 @@ DEPENDENCIES
|
|
108
106
|
strong_versions (~> 0.4.5)
|
109
107
|
|
110
108
|
BUNDLED WITH
|
111
|
-
2.4.
|
109
|
+
2.4.14
|
@@ -6,11 +6,18 @@ module Kramdown
|
|
6
6
|
# Applies a custom CSS class to Markdown tables when rendered to HTML.
|
7
7
|
class HtmlRspecDocumentation < Converter::Html
|
8
8
|
def convert_table(element, indent)
|
9
|
+
return super if rspec_documentation_example?
|
10
|
+
|
9
11
|
element.attr['class'] ||= 'rspec-documentation-table table'
|
10
12
|
super
|
11
13
|
end
|
12
14
|
|
13
15
|
def convert_header(element, indent)
|
16
|
+
if rspec_documentation_example?
|
17
|
+
element.attr['class'] = "no_toc #{element.attr['class']}"
|
18
|
+
return super
|
19
|
+
end
|
20
|
+
|
14
21
|
[
|
15
22
|
'<div class="heading">',
|
16
23
|
super,
|
@@ -22,6 +29,12 @@ module Kramdown
|
|
22
29
|
def link_icon
|
23
30
|
@link_icon ||= RSpecDocumentation.template(:link, :svg).result
|
24
31
|
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def rspec_documentation_example?
|
36
|
+
@stack.any? { |frame| frame.attr['class']&.include?('rspec-documentation-example') }
|
37
|
+
end
|
25
38
|
end
|
26
39
|
end
|
27
40
|
end
|
@@ -17,7 +17,9 @@ module RSpecDocumentation
|
|
17
17
|
|
18
18
|
def print_welcome
|
19
19
|
warn(paintbrush { blue "\nWelcome to #{cyan 'RSpec Documentation'}. A new project is being initialized.\n" })
|
20
|
-
warn(paintbrush
|
20
|
+
warn(paintbrush do
|
21
|
+
blue "If you want to undo at any point, simply delete the #{cyan 'rspec-documentation/'} directory.\n"
|
22
|
+
end)
|
21
23
|
end
|
22
24
|
|
23
25
|
def create_base_dir
|
data/lib/rspec_documentation.rb
CHANGED
@@ -4,9 +4,7 @@ require 'htmlbeautifier'
|
|
4
4
|
require 'kramdown'
|
5
5
|
require 'kramdown-parser-gfm'
|
6
6
|
require 'paintbrush'
|
7
|
-
require 'redcarpet'
|
8
7
|
require 'rouge'
|
9
|
-
require 'rouge/plugins/redcarpet'
|
10
8
|
require 'rspec'
|
11
9
|
require 'rake'
|
12
10
|
|
@@ -32,7 +30,6 @@ require_relative 'rspec_documentation/parsed_document'
|
|
32
30
|
require_relative 'rspec_documentation/html_element'
|
33
31
|
require_relative 'rspec_documentation/formatters'
|
34
32
|
require_relative 'rspec_documentation/spec'
|
35
|
-
require_relative 'rspec_documentation/markdown_renderer'
|
36
33
|
require_relative 'rspec_documentation/documentation'
|
37
34
|
require_relative 'rspec_documentation/page_collection'
|
38
35
|
require_relative 'rspec_documentation/page_tree'
|
@@ -1,4 +1,10 @@
|
|
1
|
-
<div class="modal fade example-modal
|
1
|
+
<div class="modal fade example-modal rspec-documentation-example"
|
2
|
+
id="modal-<%= element_id %>-side-by-side"
|
3
|
+
data-bs-backdrop="static"
|
4
|
+
data-bs-keyboard="false"
|
5
|
+
tabindex="-1"
|
6
|
+
aria-labelledby="staticBackdropLabel"
|
7
|
+
aria-hidden="true">
|
2
8
|
<div class="modal-dialog modal-xl" id="modal-dialog-<%= element_id %>">
|
3
9
|
<div class="modal-content">
|
4
10
|
<div class="modal-header">
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Dependencies
|
2
|
+
|
3
|
+
_RSpec::Documentation_ has the following notable dependencies:
|
4
|
+
|
5
|
+
|Dependency|Purpose|
|
6
|
+
|-|-|
|
7
|
+
| [kramdown](https://kramdown.gettalong.org/) | Converts the parsed _Markdown_ document into _HTML_. Highly flexible, allowing _RSpec::Documentation_ to inject examples into the rendered output and perform numerous customizations. |
|
8
|
+
| [RSpec](https://rspec.info/) | Runs all examples and provides detailed output of failures. |
|
9
|
+
| [Rouge](https://github.com/rouge-ruby/rouge) | Syntax-highlights _Ruby_, _JSON_, _XML_, and _HTML_ output in examples. |
|
10
|
+
| [kramdown-parser-gfm](https://github.com/kramdown/parser-gfm) | Extends `kramdown` to provide _GitHub Flavored Markdown_, allowing syntax most developers are familiar with (e.g. triple-backticks for code blocks). |
|
11
|
+
| [HTML Beautifier](https://github.com/threedaymonk/htmlbeautifier) | Re-formats output generated with the `rspec:hthml` language specifier. |
|
12
|
+
| [Nokogiri](https://nokogiri.org/) | Re-formats output generated with the `rspec:xml` language specifier. |
|
13
|
+
| [Paintbrush](https://docs.bob.frl/paintbrush) | String colorization used in various outputs. |
|
data/rspec-documentation.gemspec
CHANGED
@@ -33,7 +33,6 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_runtime_dependency 'kramdown-parser-gfm', '~> 1.1'
|
34
34
|
spec.add_runtime_dependency 'nokogiri', '~> 1.15'
|
35
35
|
spec.add_runtime_dependency 'paintbrush', '~> 0.1.3'
|
36
|
-
spec.add_runtime_dependency 'redcarpet', '~> 3.6'
|
37
36
|
spec.add_runtime_dependency 'rouge', '~> 4.1'
|
38
37
|
spec.add_runtime_dependency 'rspec', '~> 3.12'
|
39
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-documentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Farrell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlbeautifier
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.1.3
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: redcarpet
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '3.6'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '3.6'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: rouge
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -155,7 +141,6 @@ files:
|
|
155
141
|
- lib/rspec_documentation/html_element.rb
|
156
142
|
- lib/rspec_documentation/javascript_bundle.rb
|
157
143
|
- lib/rspec_documentation/kramdown_html_converter.rb
|
158
|
-
- lib/rspec_documentation/markdown_renderer.rb
|
159
144
|
- lib/rspec_documentation/page_collection.rb
|
160
145
|
- lib/rspec_documentation/page_tree.rb
|
161
146
|
- lib/rspec_documentation/page_tree_element.rb
|
@@ -240,6 +225,7 @@ files:
|
|
240
225
|
- rspec-documentation/pages/060-Configuration/Table of Contents.md
|
241
226
|
- rspec-documentation/pages/070-Publishing.md
|
242
227
|
- rspec-documentation/pages/080-Rubocop.md
|
228
|
+
- rspec-documentation/pages/400-Dependencies.md
|
243
229
|
- rspec-documentation/pages/500-License.md
|
244
230
|
- rspec-documentation/spec_helper.rb
|
245
231
|
- sig/rspec/documentation.rbs
|