jekyll-viewsource 1.0.0 → 1.0.1
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/README.md +5 -1
- data/bin/console +1 -1
- data/jekyll-viewsource.gemspec +1 -1
- data/lib/{jekyll/viewsource.rb → jekyll-viewsource.rb} +3 -3
- data/lib/{jekyll/viewsource → jekyll-viewsource}/cache.rb +3 -4
- data/lib/{jekyll/viewsource → jekyll-viewsource}/constants.rb +0 -0
- data/lib/jekyll-viewsource/lexer.rb +62 -0
- data/lib/{jekyll/viewsource → jekyll-viewsource}/renderer.rb +0 -0
- data/lib/{jekyll/viewsource → jekyll-viewsource}/utils.rb +0 -0
- data/lib/{jekyll/viewsource → jekyll-viewsource}/version.rb +1 -1
- metadata +9 -9
- data/lib/jekyll/viewsource/lexer.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 405f987cb2179dc287faa09164395009a4905663
|
4
|
+
data.tar.gz: f702c8e22fa490b5fec0c3125eb1b9c3b522f22d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26f45da8f28d82013226db98bd0fc84e0211ce426dfc0d5668510a373555e8c71aa31e7d3cf69db8c6a453ee8d705cb2dbc3a8354b78980173a9cda3518f39b1
|
7
|
+
data.tar.gz: 633c9aebe11d17da0199469881420a99591bbf2765ecf01750271000a0ac5c0cb301dd1ccba49dc80c8ce340245413e8b9a8e521c03c3be509c59831f2921dc6
|
data/README.md
CHANGED
@@ -4,6 +4,10 @@
|
|
4
4
|
|
5
5
|
*Jekyll:ViewSource* is a plugin for [Jekyll](https://jekyllrb.com/) that generates plain or pretty Markdown and HTML source code pages from your content.
|
6
6
|
|
7
|
+
## What's new?
|
8
|
+
|
9
|
+
*v1.0.1* Improvements to lexer; cache location; inclusion in `_config.yml`
|
10
|
+
|
7
11
|
## Installation
|
8
12
|
|
9
13
|
Add the gem to your application's Gemfile:
|
@@ -126,7 +130,7 @@ e.g.
|
|
126
130
|
|
127
131
|
## Cache
|
128
132
|
|
129
|
-
*ViewSource* maintains a cache in a hidden folder inside your
|
133
|
+
*ViewSource* maintains a cache in a hidden folder inside your home directory: `.jekyll-plugins/jekyll-viewsource`. If you encounter problems that you think may be related to the cache, you may remove this.
|
130
134
|
|
131
135
|
## Contributing
|
132
136
|
|
data/bin/console
CHANGED
data/jekyll-viewsource.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'jekyll
|
2
|
-
require 'jekyll
|
3
|
-
require 'jekyll
|
1
|
+
require 'jekyll-viewsource/constants'
|
2
|
+
require 'jekyll-viewsource/cache'
|
3
|
+
require 'jekyll-viewsource/renderer'
|
4
4
|
|
5
5
|
module Jekyll
|
6
6
|
module ViewSource
|
@@ -1,17 +1,16 @@
|
|
1
|
-
require 'jekyll
|
1
|
+
require 'jekyll-viewsource/renderer'
|
2
2
|
|
3
3
|
module Jekyll
|
4
4
|
module ViewSource
|
5
5
|
|
6
6
|
class Cache
|
7
|
-
DEFAULT_CACHE =
|
7
|
+
DEFAULT_CACHE = File.join(Dir.home, '.jekyll-plugins', 'jekyll-viewsource', 'cache').freeze
|
8
8
|
|
9
9
|
def self.setup(site, cache)
|
10
10
|
@site = site
|
11
11
|
|
12
12
|
if cache
|
13
|
-
@cache_dir =
|
14
|
-
(cache.is_a?(String) ? cache : DEFAULT_CACHE))
|
13
|
+
@cache_dir = (cache.is_a?(String) ? cache : DEFAULT_CACHE)
|
15
14
|
|
16
15
|
ViewSource.debug 'startup', "Setting up cache at #{@cache_dir}" if Renderer.first_run
|
17
16
|
|
File without changes
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'rouge'
|
2
|
+
|
3
|
+
module Rouge
|
4
|
+
module Lexers
|
5
|
+
class ViewSource < Markdown
|
6
|
+
tag 'viewsource'
|
7
|
+
|
8
|
+
def liquid
|
9
|
+
@liquid ||= Liquid.new(options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def javascript
|
13
|
+
@javascript ||= Javascript.new(options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def html
|
17
|
+
@html ||= HTML.new(options)
|
18
|
+
end
|
19
|
+
|
20
|
+
prepend :root do
|
21
|
+
rule(%r[\s*(?<!:)//.*?$]) { delegate javascript }
|
22
|
+
rule(%r(\s*/[*].*?[*]/\s*)m) { delegate javascript }
|
23
|
+
|
24
|
+
rule(%r(\s*<!--.*?-->\s*)m) { delegate html }
|
25
|
+
|
26
|
+
rule %r(({%)(\s*)(macro)(\s+)(/.*?/\S*)(\s*)({)) do
|
27
|
+
groups Punctuation, Text::Whitespace, Name::Tag, Text::Whitespace, Str::Double, Text::Whitespace, Punctuation
|
28
|
+
end
|
29
|
+
|
30
|
+
rule %r((})(\s*)(%})) do
|
31
|
+
groups Punctuation, Text::Whitespace, Punctuation
|
32
|
+
end
|
33
|
+
|
34
|
+
rule %r(({%)(\s*)(constant)(\s+)(\S+)(\s*)(=?)(\s*)(['"]?)(.*?)(['"]?)(\s*)(%})) do
|
35
|
+
groups Punctuation, Text::Whitespace, Name::Tag, Text::Whitespace,
|
36
|
+
Name::Attribute, Text::Whitespace, Punctuation, Text::Whitespace,
|
37
|
+
Punctuation, Str::Double, Punctuation, Text::Whitespace, Punctuation
|
38
|
+
end
|
39
|
+
|
40
|
+
rule %r((\s*)({%)(\s*)(hashkeys)(\s+)(\S+)(\s*)(%})) do
|
41
|
+
groups Text::Whitespace, Punctuation, Text::Whitespace, Name::Tag,
|
42
|
+
Text::Whitespace, Name::Attribute, Text::Whitespace, Punctuation
|
43
|
+
end
|
44
|
+
|
45
|
+
rule %r((\s*)({%)(\s*)(hashkeys)(\s+)(\S+)(\s*)({)(.*?)(})(\s*)(%})) do
|
46
|
+
groups Text::Whitespace, Punctuation, Text::Whitespace,
|
47
|
+
Name::Tag, Text::Whitespace, Name::Attribute, Text::Whitespace,
|
48
|
+
Punctuation, Text, Punctuation, Text::Whitespace, Punctuation
|
49
|
+
end
|
50
|
+
|
51
|
+
rule %r(({%)(\s*)(project)(\s*)(.*?)(\s*)(%})) do
|
52
|
+
groups Punctuation, Text::Whitespace, Name::Tag, Text::Whitespace, Text,
|
53
|
+
Text::Whitespace, Punctuation
|
54
|
+
end
|
55
|
+
|
56
|
+
rule(%r(.*?{%.*?%}.?)) { delegate liquid }
|
57
|
+
rule(%r(.*{{.*?}}.?)) { delegate liquid }
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-viewsource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Ibrado
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -119,13 +119,13 @@ files:
|
|
119
119
|
- bin/console
|
120
120
|
- bin/setup
|
121
121
|
- jekyll-viewsource.gemspec
|
122
|
-
- lib/jekyll
|
123
|
-
- lib/jekyll
|
124
|
-
- lib/jekyll
|
125
|
-
- lib/jekyll
|
126
|
-
- lib/jekyll
|
127
|
-
- lib/jekyll
|
128
|
-
- lib/jekyll
|
122
|
+
- lib/jekyll-viewsource.rb
|
123
|
+
- lib/jekyll-viewsource/cache.rb
|
124
|
+
- lib/jekyll-viewsource/constants.rb
|
125
|
+
- lib/jekyll-viewsource/lexer.rb
|
126
|
+
- lib/jekyll-viewsource/renderer.rb
|
127
|
+
- lib/jekyll-viewsource/utils.rb
|
128
|
+
- lib/jekyll-viewsource/version.rb
|
129
129
|
homepage: https://github.com/ibrado/jekyll-viewsource
|
130
130
|
licenses:
|
131
131
|
- MIT
|
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'rouge'
|
2
|
-
|
3
|
-
module Rouge
|
4
|
-
module Lexers
|
5
|
-
class ViewSource < Markdown
|
6
|
-
tag 'viewsource'
|
7
|
-
|
8
|
-
def liquid
|
9
|
-
@liquid ||= Liquid.new(options)
|
10
|
-
end
|
11
|
-
|
12
|
-
def javascript
|
13
|
-
@javascript ||= Javascript.new(options)
|
14
|
-
end
|
15
|
-
|
16
|
-
def html
|
17
|
-
@html ||= HTML.new(options)
|
18
|
-
end
|
19
|
-
|
20
|
-
prepend :root do
|
21
|
-
rule(%r[\s*(?<!:)//.*?$]) { delegate javascript }
|
22
|
-
rule(%r(\s*/[*].*?[*]/\s*)m) { delegate javascript }
|
23
|
-
|
24
|
-
rule(%r(.*?%}.?)) { delegate liquid }
|
25
|
-
rule(%r(.*{{.*?}}.?)) { delegate liquid }
|
26
|
-
|
27
|
-
rule(%r(\s*<!--.*?-->\s*)m) { delegate html }
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|