kramdown-pages 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +2 -0
- data/MIT-LICENSE +20 -0
- data/README.md +62 -0
- data/Rakefile +1 -0
- data/kramdown-pages.gemspec +26 -0
- data/lib/kramdown-pages.rb +12 -0
- data/lib/kramdown-pages/converter.rb +32 -0
- data/lib/kramdown-pages/parser.rb +1 -0
- data/lib/kramdown-pages/parser/kramdown.rb +24 -0
- data/lib/kramdown-pages/version.rb +5 -0
- data/spec/fixtures/page.html +49 -0
- data/spec/fixtures/page.md +31 -0
- data/spec/fixtures/page.tex +40 -0
- data/spec/fixtures/standard.html +45 -0
- data/spec/fixtures/standard.md +27 -0
- data/spec/fixtures/standard.tex +36 -0
- data/spec/kramdown-pages_spec.rb +97 -0
- metadata +125 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4eea036a317801cbbb5d54ddb1d2157d7d6f6493
|
4
|
+
data.tar.gz: 3c4cc1eddfca892482a8533d48517010b20c5c73
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bbe82697663cbbe7d885aa1baac6a8b3257722e23c1fab953b340d3d35a97b50c74f7ddfb132c99211a3f9649fc64c60301d2916714ee402a1f877da06f7cdc1
|
7
|
+
data.tar.gz: 7efdac7823c45f8f7a6a03b332893934b95d4df9f4b746692a1ded0e4df8dc4cfef1b6890e8ec237c6c5f9120c663a3d1ebcc669917d095fd8fe4f0bd542b2a1
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2014 Michael Lang
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
kramdown-pages
|
2
|
+
==============
|
3
|
+
|
4
|
+
This gem extends the default [kramdown][] parser with a new block-level
|
5
|
+
element which adds support for embedding Custom Page links in a Markdown document.
|
6
|
+
|
7
|
+
Installation
|
8
|
+
------------
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
gem 'kramdown-pages'
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install kramdown-pages
|
21
|
+
|
22
|
+
|
23
|
+
Usage
|
24
|
+
-----
|
25
|
+
|
26
|
+
### With standalone kramdown and Rails
|
27
|
+
|
28
|
+
* Ensure you have a Page model that responds to #title and Page::find_by_path, and #path where
|
29
|
+
* #title returns the Page title
|
30
|
+
* #path returns fully-qualified URL to the page
|
31
|
+
* Page::find_by_path returns a Page instance (or nil) given <permalink>
|
32
|
+
|
33
|
+
* Pass the `input` option as shown below when initializing a new Kramdown::Document
|
34
|
+
|
35
|
+
Kramdown::Document.new(content, :input => 'KramdownPages')
|
36
|
+
|
37
|
+
Syntax
|
38
|
+
------
|
39
|
+
|
40
|
+
All kramdown supported markup [syntax][] is supported. This gem simply extends the parser to support `{page:<permalink>}` span-level element. The element
|
41
|
+
will be replaced with an appropriate `<a href="page#path">page#title</a>` tag.
|
42
|
+
|
43
|
+
`<permalink>` should be replaced with the identifier of the Page you are referencing. The identifier can be hyphenated text, underscored text, or numerical identifier, but cannot contain spaces and special characters. That is, it's regular expression matcher is: `[\_\-\/0-9a-zA-Z]+?`
|
44
|
+
|
45
|
+
|
46
|
+
Contributing
|
47
|
+
------------
|
48
|
+
|
49
|
+
1. Fork
|
50
|
+
2. Create a topic branch (`git checkout -b my-new-feature`)
|
51
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
52
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
53
|
+
5. Create a new Pull Request
|
54
|
+
|
55
|
+
|
56
|
+
License
|
57
|
+
-------
|
58
|
+
|
59
|
+
MIT License — see `MIT-LICENSE` for more information
|
60
|
+
|
61
|
+
[kramdown]: http://kramdown.rubyforge.org/
|
62
|
+
[syntax]: http://kramdown.rubyforge.org/syntax.html
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'kramdown-pages/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "kramdown-pages"
|
8
|
+
gem.version = Kramdown::Parser::PAGES_VERSION
|
9
|
+
gem.platform = Gem::Platform::RUBY
|
10
|
+
gem.authors = ["Michael lang"]
|
11
|
+
gem.email = ["mwlang@cybrains.net"]
|
12
|
+
gem.description = %q{Kramdown syntax for embedding Rails app served page links}
|
13
|
+
gem.summary = %q{Extend Kramdown syntax to generate a href tags for embedded pages}
|
14
|
+
gem.homepage = "https://github.com/mwlang/kramdown-pages"
|
15
|
+
|
16
|
+
gem.add_dependency('kramdown', '~> 1.6.0')
|
17
|
+
|
18
|
+
gem.add_development_dependency('yard', '~> 0.8.3')
|
19
|
+
gem.add_development_dependency('bundler', '>= 1.0.0')
|
20
|
+
gem.add_development_dependency('rspec', '~> 2.12.0')
|
21
|
+
|
22
|
+
gem.files = `git ls-files`.split($/)
|
23
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
24
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
25
|
+
gem.require_paths = ["lib"]
|
26
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Kramdown
|
2
|
+
module Converter
|
3
|
+
|
4
|
+
class Html
|
5
|
+
def convert_page(el, indent)
|
6
|
+
if page = Page.find_by_path(el.value)
|
7
|
+
%{<a href="#{page.path}">#{page.title}</a>}
|
8
|
+
else
|
9
|
+
%{<a>#{el.value}</a>}
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class Kramdown
|
15
|
+
def convert_page(el, opts)
|
16
|
+
"{page:#{el.value}}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class Latex
|
21
|
+
def convert_page(el, opts)
|
22
|
+
if page = Page.find_by_path(el.value)
|
23
|
+
"\\href{#{page.path}}{page.title}"
|
24
|
+
else
|
25
|
+
el.value
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'kramdown-pages/parser/kramdown'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'kramdown/parser/kramdown'
|
2
|
+
|
3
|
+
module Kramdown
|
4
|
+
module Parser
|
5
|
+
|
6
|
+
class KramdownPages < ::Kramdown::Parser::Kramdown
|
7
|
+
|
8
|
+
def initialize(source, options)
|
9
|
+
super
|
10
|
+
@span_parsers.unshift(:page)
|
11
|
+
end
|
12
|
+
|
13
|
+
def parse_page
|
14
|
+
@src.pos += @src.matched_size
|
15
|
+
permalink = @src[1]
|
16
|
+
@tree.children << Element.new(:page, permalink)
|
17
|
+
end
|
18
|
+
|
19
|
+
define_parser(:page, /\{page:([\_\-\/0-9a-zA-Z]+?)\}/)
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<p>Search me <a href="http://google.com">Google</a>
|
2
|
+
Welcome <a href="http://google.com">http://google.com</a> via <span id="test">test</span>.</p>
|
3
|
+
|
4
|
+
<blockquote class="test">
|
5
|
+
<p>Red <em class="red">text</em> here!</p>
|
6
|
+
</blockquote>
|
7
|
+
|
8
|
+
<ul>
|
9
|
+
<li>Simple unordered list</li>
|
10
|
+
<li>presented here</li>
|
11
|
+
</ul>
|
12
|
+
|
13
|
+
<p>Do links within a paragaph like this, <a href="http://localhost/pages/simple-test">simple test</a> and this <a href="http://localhost/pages/parent-page/child-page">parent page/child page</a> work?</p>
|
14
|
+
|
15
|
+
<p>What about <a>bogus</a> pages?</p>
|
16
|
+
|
17
|
+
<h1 id="title-time">Title Time</h1>
|
18
|
+
|
19
|
+
<h2 id="hot">Another <em>title</em> and more</h2>
|
20
|
+
|
21
|
+
<pre><code>Code
|
22
|
+
block
|
23
|
+
</code></pre>
|
24
|
+
|
25
|
+
<dl>
|
26
|
+
<dt>Here</dt>
|
27
|
+
<dd>What</dd>
|
28
|
+
<dd>Not</dd>
|
29
|
+
</dl>
|
30
|
+
|
31
|
+
<table>
|
32
|
+
<thead>
|
33
|
+
<tr>
|
34
|
+
<th>Uno</th>
|
35
|
+
<th>Dos</th>
|
36
|
+
<th>Tres</th>
|
37
|
+
</tr>
|
38
|
+
</thead>
|
39
|
+
<tbody>
|
40
|
+
<tr>
|
41
|
+
<td>One</td>
|
42
|
+
<td>Two</td>
|
43
|
+
<td>Three</td>
|
44
|
+
</tr>
|
45
|
+
</tbody>
|
46
|
+
</table>
|
47
|
+
|
48
|
+
<p>A paragraph
|
49
|
+
to consider</p>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Search me [Google](http://google.com)
|
2
|
+
Welcome <http://google.com> via <span id='test'>test</span>.
|
3
|
+
|
4
|
+
> Red *text*{:.red} here!
|
5
|
+
{:.test}
|
6
|
+
|
7
|
+
* Simple unordered list
|
8
|
+
* presented here
|
9
|
+
|
10
|
+
Do links within a paragaph like this, {page:simple-test} and this {page:parent-page/child-page} work?
|
11
|
+
|
12
|
+
What about {page:bogus} pages?
|
13
|
+
|
14
|
+
Title Time
|
15
|
+
==================
|
16
|
+
|
17
|
+
## Another *title* and more {#hot}
|
18
|
+
|
19
|
+
Code
|
20
|
+
block
|
21
|
+
|
22
|
+
Here
|
23
|
+
: What
|
24
|
+
: Not
|
25
|
+
|
26
|
+
| Uno | Dos | Tres |
|
27
|
+
|----------------------------|
|
28
|
+
| One | Two | Three |
|
29
|
+
|
30
|
+
<p markdown='1'>A paragraph
|
31
|
+
to consider</p>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
Search me \href{http://google.com}{Google}
|
2
|
+
Welcome \href{http://google.com}{http://google.com} via .
|
3
|
+
|
4
|
+
\begin{quote} % class="test"
|
5
|
+
Red \emph{text} here!
|
6
|
+
\end{quote} % class="test"
|
7
|
+
|
8
|
+
\begin{itemize}
|
9
|
+
\item Simple unordered list
|
10
|
+
\item presented here
|
11
|
+
\end{itemize}
|
12
|
+
|
13
|
+
Do links within a paragaph like this, \href{http://localhost/pages/simple-test}{page.title} and this \href{http://localhost/pages/parent-page/child-page}{page.title} work?
|
14
|
+
|
15
|
+
What about bogus pages?
|
16
|
+
|
17
|
+
\section{Title Time}\hypertarget{title-time}{}\label{title-time}
|
18
|
+
|
19
|
+
\subsection{Another \emph{title} and more}\hypertarget{hot}{}\label{hot}
|
20
|
+
|
21
|
+
\begin{verbatim}Code
|
22
|
+
block
|
23
|
+
\end{verbatim}
|
24
|
+
|
25
|
+
\begin{description}
|
26
|
+
\item[Here] What
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
Not
|
31
|
+
\end{description}
|
32
|
+
|
33
|
+
\begin{longtable}{|l|l|l|}
|
34
|
+
\hline
|
35
|
+
Uno & Dos & Tres\\
|
36
|
+
\hline
|
37
|
+
One & Two & Three\\
|
38
|
+
\hline
|
39
|
+
\end{longtable}
|
40
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<p>Search me <a href="http://google.com">Google</a>
|
2
|
+
Welcome <a href="http://google.com">http://google.com</a> via <span id="test">test</span>.</p>
|
3
|
+
|
4
|
+
<blockquote class="test">
|
5
|
+
<p>Red <em class="red">text</em> here!</p>
|
6
|
+
</blockquote>
|
7
|
+
|
8
|
+
<ul>
|
9
|
+
<li>Simple unordered list</li>
|
10
|
+
<li>presented here</li>
|
11
|
+
</ul>
|
12
|
+
|
13
|
+
<h1 id="title-time">Title Time</h1>
|
14
|
+
|
15
|
+
<h2 id="hot">Another <em>title</em> and more</h2>
|
16
|
+
|
17
|
+
<pre><code>Code
|
18
|
+
block
|
19
|
+
</code></pre>
|
20
|
+
|
21
|
+
<dl>
|
22
|
+
<dt>Here</dt>
|
23
|
+
<dd>What</dd>
|
24
|
+
<dd>Not</dd>
|
25
|
+
</dl>
|
26
|
+
|
27
|
+
<table>
|
28
|
+
<thead>
|
29
|
+
<tr>
|
30
|
+
<th>Uno</th>
|
31
|
+
<th>Dos</th>
|
32
|
+
<th>Tres</th>
|
33
|
+
</tr>
|
34
|
+
</thead>
|
35
|
+
<tbody>
|
36
|
+
<tr>
|
37
|
+
<td>One</td>
|
38
|
+
<td>Two</td>
|
39
|
+
<td>Three</td>
|
40
|
+
</tr>
|
41
|
+
</tbody>
|
42
|
+
</table>
|
43
|
+
|
44
|
+
<p>A paragraph
|
45
|
+
to consider</p>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Search me [Google](http://google.com)
|
2
|
+
Welcome <http://google.com> via <span id='test'>test</span>.
|
3
|
+
|
4
|
+
> Red *text*{:.red} here!
|
5
|
+
{:.test}
|
6
|
+
|
7
|
+
* Simple unordered list
|
8
|
+
* presented here
|
9
|
+
|
10
|
+
Title Time
|
11
|
+
==================
|
12
|
+
|
13
|
+
## Another *title* and more {#hot}
|
14
|
+
|
15
|
+
Code
|
16
|
+
block
|
17
|
+
|
18
|
+
Here
|
19
|
+
: What
|
20
|
+
: Not
|
21
|
+
|
22
|
+
| Uno | Dos | Tres |
|
23
|
+
|----------------------------|
|
24
|
+
| One | Two | Three |
|
25
|
+
|
26
|
+
<p markdown='1'>A paragraph
|
27
|
+
to consider</p>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
Search me \href{http://google.com}{Google}
|
2
|
+
Welcome \href{http://google.com}{http://google.com} via .
|
3
|
+
|
4
|
+
\begin{quote} % class="test"
|
5
|
+
Red \emph{text} here!
|
6
|
+
\end{quote} % class="test"
|
7
|
+
|
8
|
+
\begin{itemize}
|
9
|
+
\item Simple unordered list
|
10
|
+
\item presented here
|
11
|
+
\end{itemize}
|
12
|
+
|
13
|
+
\section{Title Time}\hypertarget{title-time}{}\label{title-time}
|
14
|
+
|
15
|
+
\subsection{Another \emph{title} and more}\hypertarget{hot}{}\label{hot}
|
16
|
+
|
17
|
+
\begin{verbatim}Code
|
18
|
+
block
|
19
|
+
\end{verbatim}
|
20
|
+
|
21
|
+
\begin{description}
|
22
|
+
\item[Here] What
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
Not
|
27
|
+
\end{description}
|
28
|
+
|
29
|
+
\begin{longtable}{|l|l|l|}
|
30
|
+
\hline
|
31
|
+
Uno & Dos & Tres\\
|
32
|
+
\hline
|
33
|
+
One & Two & Three\\
|
34
|
+
\hline
|
35
|
+
\end{longtable}
|
36
|
+
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'kramdown-pages'
|
2
|
+
|
3
|
+
describe Kramdown::Parser::KramdownPages do
|
4
|
+
class Page
|
5
|
+
attr_accessor :path, :permalink, :title
|
6
|
+
|
7
|
+
def initialize permalink
|
8
|
+
@permalink = permalink
|
9
|
+
@path = "http://localhost/pages/#{permalink}"
|
10
|
+
@title = permalink.gsub("-", ' ')
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.find_by_path permalink
|
14
|
+
return nil if permalink == 'bogus'
|
15
|
+
Page.new permalink
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def md text
|
20
|
+
::Kramdown::Document.new(text, :input => 'KramdownPages')
|
21
|
+
end
|
22
|
+
|
23
|
+
def md_to_html text
|
24
|
+
md(text).to_html
|
25
|
+
end
|
26
|
+
|
27
|
+
context "when parsing a simple block" do
|
28
|
+
it "converts a valid public page tag to an href tag" do
|
29
|
+
expect(md_to_html("{page:simple-test}")).to eq "<p><a href=\"http://localhost/pages/simple-test\">simple test</a></p>\n"
|
30
|
+
end
|
31
|
+
|
32
|
+
it "converts a valid child page" do
|
33
|
+
expect(md_to_html("{page:parent-page/child-page}")).to eq "<p><a href=\"http://localhost/pages/parent-page/child-page\">parent page/child page</a></p>\n"
|
34
|
+
end
|
35
|
+
|
36
|
+
it "falls back to default behaviour when the tag is malformed" do
|
37
|
+
expect(md_to_html("{page:garbage page}")).to eq "<p>{page:garbage page}</p>\n"
|
38
|
+
end
|
39
|
+
|
40
|
+
it "treats the page tag as a span-level element" do
|
41
|
+
expect(md_to_html("testing 123 {page:simple-test}")).to eq %{<p>testing 123 <a href="http://localhost/pages/simple-test">simple test</a></p>\n}
|
42
|
+
expect(md_to_html("testing 123\n{page:1234}")).to eq %{<p>testing 123\n<a href="http://localhost/pages/1234">1234</a></p>\n}
|
43
|
+
expect(md_to_html("testing 123\n\n{page:1234}")).to eq %{<p>testing 123</p>\n\n<p><a href="http://localhost/pages/1234">1234</a></p>\n}
|
44
|
+
end
|
45
|
+
|
46
|
+
it "is idempotent when generating kramdown" do
|
47
|
+
expect(md("{page:simple-test}").to_kramdown).to eq "{page:simple-test}\n\n"
|
48
|
+
end
|
49
|
+
|
50
|
+
it "renders to a suitable placeholder when generating LaTeX" do
|
51
|
+
expect(md("{page:simple-test}").to_latex).to eq "\\href{http://localhost/pages/simple-test}{page.title}\n\n"
|
52
|
+
end
|
53
|
+
|
54
|
+
context "non-existent page" do
|
55
|
+
let(:content) { "{page:bogus}" }
|
56
|
+
|
57
|
+
it "returns the text of the tag for HTML" do
|
58
|
+
expect(md_to_html(content)).to eq "<p><a>bogus</a></p>\n"
|
59
|
+
end
|
60
|
+
it "returns the text of the tag for LaTeX" do
|
61
|
+
expect(md(content).to_latex).to eq "bogus\n\n"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context "when parsing a complex document" do
|
67
|
+
# Standard kramdown source and rendered files
|
68
|
+
let(:standard_src) { File.read(File.expand_path("../fixtures/standard.md", __FILE__)) }
|
69
|
+
let(:standard_html) { File.read(File.expand_path("../fixtures/standard.html", __FILE__)) }
|
70
|
+
let(:standard_latex) { File.read(File.expand_path("../fixtures/standard.tex", __FILE__)) }
|
71
|
+
|
72
|
+
# KramdownPages source and rendered files
|
73
|
+
let(:page_src) { File.read(File.expand_path("../fixtures/page.md", __FILE__)) }
|
74
|
+
let(:page_html) { File.read(File.expand_path("../fixtures/page.html", __FILE__)) }
|
75
|
+
let(:page_latex) { File.read(File.expand_path("../fixtures/page.tex", __FILE__)) }
|
76
|
+
|
77
|
+
context "without page tags" do
|
78
|
+
it "produces valid HTML output" do
|
79
|
+
expect(md_to_html(standard_src)).to eq standard_html
|
80
|
+
end
|
81
|
+
|
82
|
+
it "produces valid LaTeX output" do
|
83
|
+
expect(md(standard_src).to_latex).to eq standard_latex
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
context "with page tags" do
|
88
|
+
it "produces valid HTML output" do
|
89
|
+
expect(md_to_html(page_src)).to eq page_html
|
90
|
+
end
|
91
|
+
|
92
|
+
it "produces valid LaTeX output" do
|
93
|
+
expect(md(page_src).to_latex).to eq page_latex
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kramdown-pages
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michael lang
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: kramdown
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.6.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.6.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: yard
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.8.3
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.8.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.0.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.0.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.12.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.12.0
|
69
|
+
description: Kramdown syntax for embedding Rails app served page links
|
70
|
+
email:
|
71
|
+
- mwlang@cybrains.net
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- Gemfile
|
78
|
+
- MIT-LICENSE
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- kramdown-pages.gemspec
|
82
|
+
- lib/kramdown-pages.rb
|
83
|
+
- lib/kramdown-pages/converter.rb
|
84
|
+
- lib/kramdown-pages/parser.rb
|
85
|
+
- lib/kramdown-pages/parser/kramdown.rb
|
86
|
+
- lib/kramdown-pages/version.rb
|
87
|
+
- spec/fixtures/page.html
|
88
|
+
- spec/fixtures/page.md
|
89
|
+
- spec/fixtures/page.tex
|
90
|
+
- spec/fixtures/standard.html
|
91
|
+
- spec/fixtures/standard.md
|
92
|
+
- spec/fixtures/standard.tex
|
93
|
+
- spec/kramdown-pages_spec.rb
|
94
|
+
homepage: https://github.com/mwlang/kramdown-pages
|
95
|
+
licenses: []
|
96
|
+
metadata: {}
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.4.3
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: Extend Kramdown syntax to generate a href tags for embedded pages
|
117
|
+
test_files:
|
118
|
+
- spec/fixtures/page.html
|
119
|
+
- spec/fixtures/page.md
|
120
|
+
- spec/fixtures/page.tex
|
121
|
+
- spec/fixtures/standard.html
|
122
|
+
- spec/fixtures/standard.md
|
123
|
+
- spec/fixtures/standard.tex
|
124
|
+
- spec/kramdown-pages_spec.rb
|
125
|
+
has_rdoc:
|