govuk_markdown 0.3.0 → 0.4.0
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/.editorconfig +10 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/example/example.html +4 -0
- data/example/example.md +8 -0
- data/lib/govuk_markdown.rb +1 -1
- data/lib/govuk_markdown/renderer.rb +0 -5
- data/lib/govuk_markdown/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 587d477359637429b19f4b8657940ad42c53ef5d1e7566432c89ded9e08edad3
|
|
4
|
+
data.tar.gz: c52c08b4ce188235ba63c2445e372320cfdaafcd2c7be44faf052e1fec80a05d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1c54cd75ccfab04de4b900c61802a3a36f9b0e525baa36303c5be7f0a859c1cbbf443467a130b5c322f00be3cd511915f03cd07ba272450a5530802d80c2467
|
|
7
|
+
data.tar.gz: 1dc06a438f269eabf63de6bb2baa27ff221ffb019c2dcd990e7122dc8b27fbf77202cf80ced11ce2e204aeef5d090e5c742352b54c05b22126b7324404500fe5
|
data/.editorconfig
ADDED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/example/example.html
CHANGED
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
<div class="govuk-width-container">
|
|
41
41
|
<main class="govuk-main-wrapper" id="main-content" role="main">
|
|
42
42
|
<h1 id="a-h1-title-header" class="govuk-heading-xl">A h1 title header</h1>
|
|
43
|
+
<h2 id="links" class="govuk-heading-l">Links</h2>
|
|
44
|
+
<p class="govuk-body-m">This is <a href="https://gov.uk" class="govuk-link">linked text</a>.</p>
|
|
45
|
+
<p class="govuk-body-m">This is <a href="https://gov.uk" title="The best place to find government services and information" class="govuk-link">linked text with a title</a>.</p>
|
|
46
|
+
<p class="govuk-body-m">This is a linked URL <a href="https://www.gov.uk/help" class="govuk-link">https://www.gov.uk/help</a> and this is a linked email address <a href="mailto:noreply@gov.uk" class="govuk-link">noreply@gov.uk</a>.</p>
|
|
43
47
|
<h2 id="lists" class="govuk-heading-l">Lists</h2>
|
|
44
48
|
<p class="govuk-body-m">This is a list:</p>
|
|
45
49
|
<ul class="govuk-list govuk-list--bullet">
|
data/example/example.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# A h1 title header
|
|
2
2
|
|
|
3
|
+
## Links
|
|
4
|
+
|
|
5
|
+
This is [linked text](https://gov.uk).
|
|
6
|
+
|
|
7
|
+
This is [linked text with a title](https://gov.uk "The best place to find government services and information").
|
|
8
|
+
|
|
9
|
+
This is a linked URL <https://www.gov.uk/help> and this is a linked email address <noreply@gov.uk>.
|
|
10
|
+
|
|
3
11
|
## Lists
|
|
4
12
|
|
|
5
13
|
This is a list:
|
data/lib/govuk_markdown.rb
CHANGED
|
@@ -6,7 +6,7 @@ require_relative "./govuk_markdown/renderer"
|
|
|
6
6
|
|
|
7
7
|
module GovukMarkdown
|
|
8
8
|
def self.render(markdown)
|
|
9
|
-
renderer = GovukMarkdown::Renderer.new(with_toc_data: true)
|
|
9
|
+
renderer = GovukMarkdown::Renderer.new(with_toc_data: true, link_attributes: { class: "govuk-link" })
|
|
10
10
|
Redcarpet::Markdown.new(renderer, tables: true, no_intra_emphasis: true).render(markdown).strip
|
|
11
11
|
end
|
|
12
12
|
end
|
|
@@ -67,11 +67,6 @@ module GovukMarkdown
|
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
|
|
70
|
-
def link(link, title, content)
|
|
71
|
-
title_attribute = title.present? ? " title=\"#{title}\"" : ""
|
|
72
|
-
%(<a href="#{link}" class="govuk-link"#{title_attribute}>#{content}</a>)
|
|
73
|
-
end
|
|
74
|
-
|
|
75
70
|
def hrule
|
|
76
71
|
<<~HTML
|
|
77
72
|
<hr class="govuk-section-break govuk-section-break--xl govuk-section-break--visible">
|
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: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tijmen Brommet
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-11-
|
|
11
|
+
date: 2020-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -87,6 +87,7 @@ executables: []
|
|
|
87
87
|
extensions: []
|
|
88
88
|
extra_rdoc_files: []
|
|
89
89
|
files:
|
|
90
|
+
- ".editorconfig"
|
|
90
91
|
- ".github/workflows/publish_gem.yml"
|
|
91
92
|
- ".github/workflows/tests.yml"
|
|
92
93
|
- ".gitignore"
|