github-markup 1.5.0 → 1.6.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/Gemfile +1 -1
- data/HISTORY.md +25 -0
- data/github-markup.gemspec +0 -1
- data/lib/github-markup.rb +1 -1
- data/lib/github/markup.rb +2 -2
- data/lib/github/markup/command_implementation.rb +1 -1
- data/lib/github/markup/gem_implementation.rb +2 -2
- data/lib/github/markup/implementation.rb +1 -1
- data/lib/github/markup/markdown.rb +1 -1
- data/lib/github/markup/rdoc.rb +1 -1
- data/lib/github/markups.rb +17 -6
- data/test/markups/README.asciidoc +2 -0
- data/test/markups/README.asciidoc.html +3 -0
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a84a52be34f80606a5f1242e796a1b46c385fb87
|
4
|
+
data.tar.gz: d36d6d7c3e3148bbdc0cb5bceea4fef4a953fe74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b555eb0a0b7b5483894380a3c25c22747e0e1cc582f3e7161b9f7eca0070047aaae84d91c328a9751e0bf27696a9c9abca0e4fb1d8c102cd2e9838c516cf3885
|
7
|
+
data.tar.gz: cc7e932e048021775673258daac64a8406f0d48fdb3951b9ab35578c51f6eb07c14ed367303f2a0c119b21e8114ab8872e15b301d75f330a8b02ecfab2a622b3
|
data/Gemfile
CHANGED
data/HISTORY.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
## 1.6.0 - 2017-04-03
|
2
|
+
|
3
|
+
### Changed
|
4
|
+
|
5
|
+
* Added filename argument to all renderers for additional context
|
6
|
+
* Removed superfluous `rinku` dependency [#1035](https://github.com/github/markup/pull/1035)
|
7
|
+
* Enable source-to-source navigation for `.adoc` AsciiDoc files, plus additional attributes passed through [#1039](https://github.com/github/markup/pull/1039) and [#1041](https://github.com/github/markup/pull/1041)
|
8
|
+
|
9
|
+
## 1.5.0 - 2017-03-27
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
* Re-introduce [#537](https://github.com/github/markup/pull/537) to detect language of markup document
|
14
|
+
However `github-linguist` is optional and this gem will fallback to extensions for detection.
|
15
|
+
|
16
|
+
[Full changelog](https://github.com/github/markup/compare/v1.4.9...v1.5.0)
|
17
|
+
|
18
|
+
## 1.4.9 - 2017-03-27
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
|
22
|
+
* Reverted [#537](https://github.com/github/markup/pull/537) to avoid extra dependencies
|
23
|
+
|
24
|
+
[Full changelog](https://github.com/github/markup/compare/v1.4.8...v1.4.9)
|
25
|
+
|
1
26
|
## 1.3.3 (2015-02-17)
|
2
27
|
|
3
28
|
* Address a slight typo with `POSIX` [#456](https://github.com/github/markup/pull/456)
|
data/github-markup.gemspec
CHANGED
@@ -16,7 +16,6 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
17
17
|
s.require_paths = %w[lib]
|
18
18
|
|
19
|
-
s.add_dependency "rinku"
|
20
19
|
s.add_development_dependency 'rake', '~> 12'
|
21
20
|
s.add_development_dependency 'activesupport', '~> 4.0'
|
22
21
|
s.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3'
|
data/lib/github-markup.rb
CHANGED
data/lib/github/markup.rb
CHANGED
@@ -44,7 +44,7 @@ module GitHub
|
|
44
44
|
content ||= File.read(filename)
|
45
45
|
|
46
46
|
if impl = renderer(filename, content)
|
47
|
-
impl.render(content)
|
47
|
+
impl.render(filename, content)
|
48
48
|
else
|
49
49
|
content
|
50
50
|
end
|
@@ -54,7 +54,7 @@ module GitHub
|
|
54
54
|
if content.nil?
|
55
55
|
raise ArgumentError, 'Can not render a nil.'
|
56
56
|
elsif markups.has_key?(symbol)
|
57
|
-
markups[symbol].render(content)
|
57
|
+
markups[symbol].render(nil, content)
|
58
58
|
else
|
59
59
|
content
|
60
60
|
end
|
data/lib/github/markup/rdoc.rb
CHANGED
data/lib/github/markups.rb
CHANGED
@@ -4,32 +4,43 @@ require "shellwords"
|
|
4
4
|
|
5
5
|
markup_impl(::GitHub::Markups::MARKUP_MARKDOWN, ::GitHub::Markup::Markdown.new)
|
6
6
|
|
7
|
-
markup(::GitHub::Markups::MARKUP_TEXTILE, :redcloth, /textile/, ["Textile"]) do |content|
|
7
|
+
markup(::GitHub::Markups::MARKUP_TEXTILE, :redcloth, /textile/, ["Textile"]) do |filename, content|
|
8
8
|
RedCloth.new(content).to_html
|
9
9
|
end
|
10
10
|
|
11
11
|
markup_impl(::GitHub::Markups::MARKUP_RDOC, GitHub::Markup::RDoc.new)
|
12
12
|
|
13
|
-
markup(::GitHub::Markups::MARKUP_ORG, 'org-ruby', /org/, ["Org"]) do |content|
|
13
|
+
markup(::GitHub::Markups::MARKUP_ORG, 'org-ruby', /org/, ["Org"]) do |filename, content|
|
14
14
|
Orgmode::Parser.new(content, {
|
15
15
|
:allow_include_files => false,
|
16
16
|
:skip_syntax_highlight => true
|
17
17
|
}).to_html
|
18
18
|
end
|
19
19
|
|
20
|
-
markup(::GitHub::Markups::MARKUP_CREOLE, :creole, /creole/, ["Creole"]) do |content|
|
20
|
+
markup(::GitHub::Markups::MARKUP_CREOLE, :creole, /creole/, ["Creole"]) do |filename, content|
|
21
21
|
Creole.creolize(content)
|
22
22
|
end
|
23
23
|
|
24
|
-
markup(::GitHub::Markups::MARKUP_MEDIAWIKI, :wikicloth, /mediawiki|wiki/, ["MediaWiki"]) do |content|
|
24
|
+
markup(::GitHub::Markups::MARKUP_MEDIAWIKI, :wikicloth, /mediawiki|wiki/, ["MediaWiki"]) do |filename, content|
|
25
25
|
wikicloth = WikiCloth::WikiCloth.new(:data => content)
|
26
26
|
WikiCloth::WikiBuffer::HTMLElement::ESCAPED_TAGS << 'tt' unless WikiCloth::WikiBuffer::HTMLElement::ESCAPED_TAGS.include?('tt')
|
27
27
|
wikicloth.to_html(:noedit => true)
|
28
28
|
end
|
29
29
|
|
30
|
-
markup(::GitHub::Markups::MARKUP_ASCIIDOC, :asciidoctor, /adoc|asc(iidoc)?/, ["AsciiDoc"]) do |content|
|
30
|
+
markup(::GitHub::Markups::MARKUP_ASCIIDOC, :asciidoctor, /adoc|asc(iidoc)?/, ["AsciiDoc"]) do |filename, content|
|
31
|
+
attributes = {
|
32
|
+
'showtitle' => '@',
|
33
|
+
'idprefix' => '',
|
34
|
+
'idseparator' => '-',
|
35
|
+
'docname' => File.basename(filename, (extname = File.extname(filename))),
|
36
|
+
'docfilesuffix' => extname,
|
37
|
+
'outfilesuffix' => extname,
|
38
|
+
'env' => 'github',
|
39
|
+
'env-github' => '',
|
40
|
+
'source-highlighter' => 'html-pipeline'
|
41
|
+
}
|
31
42
|
Asciidoctor::Compliance.unique_id_start_index = 1
|
32
|
-
Asciidoctor.convert(content, :safe => :secure, :attributes =>
|
43
|
+
Asciidoctor.convert(content, :safe => :secure, :attributes => attributes)
|
33
44
|
end
|
34
45
|
|
35
46
|
command(
|
@@ -15,6 +15,9 @@
|
|
15
15
|
<div>
|
16
16
|
<p>Refer to <a href="#another-section">Another Section</a> or <a href="#another-section-1">Another Section</a>.</p>
|
17
17
|
</div>
|
18
|
+
<div>
|
19
|
+
<p>Navigate from README.asciidoc to <a href="another-document.asciidoc">another document</a>.</p>
|
20
|
+
</div>
|
18
21
|
</div>
|
19
22
|
</div>
|
20
23
|
<div>
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github-markup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Wanstrath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03
|
11
|
+
date: 2017-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rinku
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|