govuk_markdown 2.0.1 → 2.0.2
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
- data/.github/workflows/publish_gem.yml +3 -3
- data/.github/workflows/tests.yml +2 -2
- data/.rubocop.yml +3 -0
- data/.ruby-version +1 -1
- data/Gemfile.lock +72 -49
- data/README.md +6 -6
- data/Rakefile +14 -1
- data/govuk_markdown.gemspec +1 -1
- data/lib/govuk_markdown/renderer.rb +14 -6
- data/lib/govuk_markdown/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 04e0653c66e2b3caa406acdfd07269a638ad834fd0791858f9d71dfa3eb43bbd
|
|
4
|
+
data.tar.gz: 1b1350d46fc9937987c5077a9130dc0602852afd72f8c57433cb746957290351
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0cb66e8911fc9c18b9a7b05e2737400acc32a6fc444ceccbc0cf1da1e48515f299d793d55be2ec8310fb8b9be759f05fa2abe90b2b7e98ab82fa7d2f1514550c
|
|
7
|
+
data.tar.gz: 707d0d37111906368efd76b9f9086a7e026ee502ce1e0e31a3651d3b6b952507dad4b262946f4feea980ded9a2dfd22008580f5c61822fee054a9cc2ead7b5ba
|
|
@@ -10,14 +10,14 @@ jobs:
|
|
|
10
10
|
name: Publish to RubyGems.org
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
steps:
|
|
13
|
-
- uses: actions/checkout@
|
|
13
|
+
- uses: actions/checkout@v3
|
|
14
14
|
with:
|
|
15
15
|
ref: ${{ github.event.inputs.tag }}
|
|
16
16
|
|
|
17
17
|
- name: Set up Ruby
|
|
18
18
|
uses: ruby/setup-ruby@v1
|
|
19
19
|
with:
|
|
20
|
-
ruby-version: '
|
|
20
|
+
ruby-version: '3.1.4'
|
|
21
21
|
|
|
22
22
|
- name: Install dependencies
|
|
23
23
|
run: |
|
|
@@ -26,5 +26,5 @@ jobs:
|
|
|
26
26
|
|
|
27
27
|
- name: Publish gem
|
|
28
28
|
uses: dawidd6/action-publish-gem@v1
|
|
29
|
-
with:
|
|
29
|
+
with:
|
|
30
30
|
api_key: ${{ secrets.RUBYGEMS_API_KEY }}
|
data/.github/workflows/tests.yml
CHANGED
|
@@ -6,7 +6,7 @@ jobs:
|
|
|
6
6
|
strategy:
|
|
7
7
|
fail-fast: false
|
|
8
8
|
matrix:
|
|
9
|
-
ruby: ['
|
|
9
|
+
ruby: ['3.1.4', '3.2.3', '3.3.0']
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
12
|
- uses: actions/checkout@v2
|
|
@@ -23,4 +23,4 @@ jobs:
|
|
|
23
23
|
run: bundle exec rubocop .
|
|
24
24
|
|
|
25
25
|
- name: Run tests
|
|
26
|
-
run: bundle exec
|
|
26
|
+
run: bundle exec rspec
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3.1.4
|
data/Gemfile.lock
CHANGED
|
@@ -1,83 +1,106 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
govuk_markdown (2.0.
|
|
4
|
+
govuk_markdown (2.0.2)
|
|
5
5
|
activesupport
|
|
6
6
|
redcarpet
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
activesupport (
|
|
11
|
+
activesupport (7.1.3.2)
|
|
12
|
+
base64
|
|
13
|
+
bigdecimal
|
|
12
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
15
|
+
connection_pool (>= 2.2.5)
|
|
16
|
+
drb
|
|
13
17
|
i18n (>= 1.6, < 2)
|
|
14
18
|
minitest (>= 5.1)
|
|
19
|
+
mutex_m
|
|
15
20
|
tzinfo (~> 2.0)
|
|
16
|
-
zeitwerk (~> 2.3)
|
|
17
21
|
ast (2.4.2)
|
|
22
|
+
base64 (0.2.0)
|
|
23
|
+
bigdecimal (3.1.7)
|
|
18
24
|
coderay (1.1.3)
|
|
19
|
-
concurrent-ruby (1.2.
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
concurrent-ruby (1.2.3)
|
|
26
|
+
connection_pool (2.4.1)
|
|
27
|
+
diff-lcs (1.5.1)
|
|
28
|
+
drb (2.2.1)
|
|
29
|
+
i18n (1.14.4)
|
|
22
30
|
concurrent-ruby (~> 1.0)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
json (2.7.2)
|
|
32
|
+
language_server-protocol (3.17.0.3)
|
|
33
|
+
method_source (1.1.0)
|
|
34
|
+
minitest (5.22.3)
|
|
35
|
+
mutex_m (0.2.0)
|
|
36
|
+
parallel (1.24.0)
|
|
37
|
+
parser (3.3.0.5)
|
|
27
38
|
ast (~> 2.4.1)
|
|
28
|
-
|
|
39
|
+
racc
|
|
40
|
+
pry (0.14.2)
|
|
29
41
|
coderay (~> 1.1)
|
|
30
42
|
method_source (~> 1.0)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
racc (1.7.3)
|
|
44
|
+
rack (3.0.10)
|
|
45
|
+
rainbow (3.1.1)
|
|
46
|
+
rake (13.2.1)
|
|
34
47
|
redcarpet (3.6.0)
|
|
35
|
-
regexp_parser (2.
|
|
36
|
-
rexml (3.2.
|
|
37
|
-
rspec (3.
|
|
38
|
-
rspec-core (~> 3.
|
|
39
|
-
rspec-expectations (~> 3.
|
|
40
|
-
rspec-mocks (~> 3.
|
|
41
|
-
rspec-core (3.
|
|
42
|
-
rspec-support (~> 3.
|
|
43
|
-
rspec-expectations (3.
|
|
48
|
+
regexp_parser (2.9.0)
|
|
49
|
+
rexml (3.2.6)
|
|
50
|
+
rspec (3.13.0)
|
|
51
|
+
rspec-core (~> 3.13.0)
|
|
52
|
+
rspec-expectations (~> 3.13.0)
|
|
53
|
+
rspec-mocks (~> 3.13.0)
|
|
54
|
+
rspec-core (3.13.0)
|
|
55
|
+
rspec-support (~> 3.13.0)
|
|
56
|
+
rspec-expectations (3.13.0)
|
|
44
57
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
45
|
-
rspec-support (~> 3.
|
|
46
|
-
rspec-mocks (3.
|
|
58
|
+
rspec-support (~> 3.13.0)
|
|
59
|
+
rspec-mocks (3.13.0)
|
|
47
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
48
|
-
rspec-support (~> 3.
|
|
49
|
-
rspec-support (3.
|
|
50
|
-
rubocop (1.
|
|
61
|
+
rspec-support (~> 3.13.0)
|
|
62
|
+
rspec-support (3.13.1)
|
|
63
|
+
rubocop (1.62.1)
|
|
64
|
+
json (~> 2.3)
|
|
65
|
+
language_server-protocol (>= 3.17.0)
|
|
51
66
|
parallel (~> 1.10)
|
|
52
|
-
parser (>= 3.
|
|
67
|
+
parser (>= 3.3.0.2)
|
|
53
68
|
rainbow (>= 2.2.2, < 4.0)
|
|
54
69
|
regexp_parser (>= 1.8, < 3.0)
|
|
55
|
-
rexml
|
|
56
|
-
rubocop-ast (>= 1.
|
|
70
|
+
rexml (>= 3.2.5, < 4.0)
|
|
71
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
|
57
72
|
ruby-progressbar (~> 1.7)
|
|
58
|
-
unicode-display_width (>=
|
|
59
|
-
rubocop-ast (1.
|
|
60
|
-
parser (>= 3.0.
|
|
61
|
-
rubocop-
|
|
62
|
-
rubocop (~> 1.
|
|
63
|
-
|
|
64
|
-
rubocop
|
|
65
|
-
|
|
66
|
-
rubocop
|
|
67
|
-
|
|
73
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
74
|
+
rubocop-ast (1.31.2)
|
|
75
|
+
parser (>= 3.3.0.4)
|
|
76
|
+
rubocop-capybara (2.20.0)
|
|
77
|
+
rubocop (~> 1.41)
|
|
78
|
+
rubocop-factory_bot (2.25.1)
|
|
79
|
+
rubocop (~> 1.41)
|
|
80
|
+
rubocop-govuk (4.16.1)
|
|
81
|
+
rubocop (= 1.62.1)
|
|
82
|
+
rubocop-ast (= 1.31.2)
|
|
83
|
+
rubocop-rails (= 2.24.1)
|
|
84
|
+
rubocop-rake (= 0.6.0)
|
|
85
|
+
rubocop-rspec (= 2.28.0)
|
|
86
|
+
rubocop-rails (2.24.1)
|
|
68
87
|
activesupport (>= 4.2.0)
|
|
69
88
|
rack (>= 1.1)
|
|
70
|
-
rubocop (>= 1.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
rubocop-rspec (2.3.0)
|
|
89
|
+
rubocop (>= 1.33.0, < 2.0)
|
|
90
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
|
91
|
+
rubocop-rake (0.6.0)
|
|
74
92
|
rubocop (~> 1.0)
|
|
75
|
-
|
|
76
|
-
|
|
93
|
+
rubocop-rspec (2.28.0)
|
|
94
|
+
rubocop (~> 1.40)
|
|
95
|
+
rubocop-capybara (~> 2.17)
|
|
96
|
+
rubocop-factory_bot (~> 2.22)
|
|
97
|
+
rubocop-rspec_rails (~> 2.28)
|
|
98
|
+
rubocop-rspec_rails (2.28.3)
|
|
99
|
+
rubocop (~> 1.40)
|
|
100
|
+
ruby-progressbar (1.13.0)
|
|
77
101
|
tzinfo (2.0.6)
|
|
78
102
|
concurrent-ruby (~> 1.0)
|
|
79
|
-
unicode-display_width (2.
|
|
80
|
-
zeitwerk (2.6.7)
|
|
103
|
+
unicode-display_width (2.5.0)
|
|
81
104
|
|
|
82
105
|
PLATFORMS
|
|
83
106
|
ruby
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ This Ruby gem converts Markdown into [GOV.UK Frontend](https://github.com/alphag
|
|
|
4
4
|
|
|
5
5
|
Don't confuse this gem with [govspeak](https://github.com/alphagov/govspeak), which is a Markdown dialect specifically built for the GOV.UK publishing system (www.gov.uk).
|
|
6
6
|
|
|
7
|
-
Note that this gem supports [GOV.UK
|
|
7
|
+
Note that this gem supports [GOV.UK Design System](https://design-system.service.gov.uk/) version 5.3.0.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -52,9 +52,9 @@ GovukMarkdown.render(markdown, headings_start_with: "l")
|
|
|
52
52
|
|
|
53
53
|
### Adding inset text to your markdown
|
|
54
54
|
|
|
55
|
-
To add [inset text](https://
|
|
55
|
+
To add [inset text](https://design-system.service.gov.uk/components/inset-text/) to your markdown document, use the following tags:
|
|
56
56
|
|
|
57
|
-
```
|
|
57
|
+
```
|
|
58
58
|
{inset-text}Text to be inset goes here{/inset-text}
|
|
59
59
|
```
|
|
60
60
|
|
|
@@ -70,10 +70,10 @@ The renderer also handles multi-line text as well as multiple paragraphs inside
|
|
|
70
70
|
|
|
71
71
|
### Adding details sections to your markdown
|
|
72
72
|
|
|
73
|
-
To add the [details component](https://
|
|
73
|
+
To add the [details component](https://design-system.service.gov.uk/components/details/) to your markdown, use the following tags:
|
|
74
74
|
|
|
75
|
-
```
|
|
76
|
-
{details} Find out about the fox and the dog. Whilst the fox is quick and brown, the dog is lazy.
|
|
75
|
+
```
|
|
76
|
+
{details} Find out about the fox and the dog. Whilst the fox is quick and brown, the dog is lazy.{/details}
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
The first sentence is rendered as the details summary text. The remaining text is rendered as the details text. The renderer handles multiple paragraphs for the details text.
|
data/Rakefile
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
require "mkmf"
|
|
1
2
|
require "bundler/gem_tasks"
|
|
3
|
+
require "rspec/core/rake_task"
|
|
4
|
+
|
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
6
|
+
|
|
2
7
|
task default: :spec
|
|
3
8
|
|
|
4
9
|
desc "Regenerate the example HTML in example/example.html"
|
|
@@ -9,7 +14,15 @@ task :generate_example do
|
|
|
9
14
|
html = GovukMarkdown.render(markdown)
|
|
10
15
|
|
|
11
16
|
File.write("example/example.html", ERB.new(File.read("example/example_layout.html.erb")).result(binding))
|
|
12
|
-
|
|
17
|
+
|
|
18
|
+
case
|
|
19
|
+
when find_executable("xdg-open") # linux
|
|
20
|
+
sh("xdg-open example/example.html")
|
|
21
|
+
when find_executable("open") # mac
|
|
22
|
+
sh("open example/example.html")
|
|
23
|
+
else
|
|
24
|
+
puts "View the example in example/example.html"
|
|
25
|
+
end
|
|
13
26
|
end
|
|
14
27
|
|
|
15
28
|
desc "Print the current version of the gem"
|
data/govuk_markdown.gemspec
CHANGED
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.summary = "Convert Markdown into GOV.UK styled HTML"
|
|
10
10
|
spec.description = "Convert Markdown into GOV.UK styled HTML"
|
|
11
11
|
spec.homepage = "https://github.com/DFE-Digital/govuk_markdown"
|
|
12
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.4")
|
|
13
13
|
|
|
14
14
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
15
15
|
spec.metadata["source_code_uri"] = spec.homepage
|
|
@@ -26,12 +26,20 @@ module GovukMarkdown
|
|
|
26
26
|
HTML
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def table_cell(content, _alignment)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
def table_cell(content, _alignment, header)
|
|
30
|
+
if header
|
|
31
|
+
<<~HTML
|
|
32
|
+
<th class='govuk-table__header'>
|
|
33
|
+
#{content}
|
|
34
|
+
</th>
|
|
35
|
+
HTML
|
|
36
|
+
else
|
|
37
|
+
<<~HTML
|
|
38
|
+
<td class='govuk-table__cell'>
|
|
39
|
+
#{content}
|
|
40
|
+
</td>
|
|
41
|
+
HTML
|
|
42
|
+
end
|
|
35
43
|
end
|
|
36
44
|
|
|
37
45
|
def header(text, header_level)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_markdown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tijmen Brommet
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-04-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -138,14 +138,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
138
138
|
requirements:
|
|
139
139
|
- - ">="
|
|
140
140
|
- !ruby/object:Gem::Version
|
|
141
|
-
version:
|
|
141
|
+
version: 3.1.4
|
|
142
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
requirements:
|
|
144
144
|
- - ">="
|
|
145
145
|
- !ruby/object:Gem::Version
|
|
146
146
|
version: '0'
|
|
147
147
|
requirements: []
|
|
148
|
-
rubygems_version: 3.
|
|
148
|
+
rubygems_version: 3.3.26
|
|
149
149
|
signing_key:
|
|
150
150
|
specification_version: 4
|
|
151
151
|
summary: Convert Markdown into GOV.UK styled HTML
|