static_site_builder 0.3.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -2
- data/.ruby-version +1 -1
- data/Gemfile +3 -1
- data/Gemfile.lock +21 -13
- data/README.md +23 -7
- data/Rakefile +3 -2
- data/exe/{static_site_builder → site_builder} +7 -6
- data/lib/static_site_builder/renderers/markdown_renderer.rb +30 -0
- data/lib/static_site_builder/renderers/renderer.rb +11 -0
- data/lib/static_site_builder/{html_templater.rb → renderers/template_renderer.rb} +12 -9
- data/lib/static_site_builder/renderers/yart_renderer.rb +56 -0
- data/lib/static_site_builder/version.rb +1 -1
- data/lib/static_site_builder.rb +36 -36
- data/static_site_builder.gemspec +9 -7
- data/templates/default_template.html +1 -1
- metadata +44 -16
- data/.travis.yml +0 -5
- data/Dockerfile +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38a16b2cbd426b2c6cb677d4622c77f6dd35a12f5d08a671528865164e6cf3d0
|
4
|
+
data.tar.gz: b2f4216782693622921c0f25b19758d5085706ad74205f09bb53eda45ac1861e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e9463929b6cd1eeef361d81197cad845e76cd0599cb7052e9e9ea1761a8515141fbfb6c807c9a5e0f7e3c1779ed0f63e0b95b5a61faa9391bf6c7b0f24fb5d2
|
7
|
+
data.tar.gz: cb724da0fd50819e82217f6ff8fc36b935bb24bf8c1a228beafa7e4d375186efae5c2e0b87bded9335d851079218a9e2cb7b3bd8b4a05fccd1e913e43026edf6
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.4
|
data/Gemfile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
|
3
|
+
ruby "~> 2.7"
|
4
|
+
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
6
|
|
5
7
|
# Specify your gem's dependencies in static_site_builder.gemspec
|
6
8
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,32 +1,40 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
static_site_builder (0.
|
4
|
+
static_site_builder (0.6.0)
|
5
5
|
redcarpet (~> 3.4)
|
6
|
-
thor (~>
|
6
|
+
thor (~> 1.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
byebug (11.1.3)
|
12
|
+
coderay (1.1.3)
|
13
|
+
method_source (1.0.0)
|
14
|
+
minitest (5.15.0)
|
15
|
+
pry (0.14.1)
|
16
|
+
coderay (~> 1.1)
|
17
|
+
method_source (~> 1.0)
|
18
|
+
rake (13.0.6)
|
19
|
+
redcarpet (3.5.1)
|
20
|
+
thor (1.2.1)
|
21
|
+
yart (0.2.0)
|
20
22
|
|
21
23
|
PLATFORMS
|
22
24
|
ruby
|
25
|
+
x86_64-linux
|
23
26
|
|
24
27
|
DEPENDENCIES
|
25
28
|
bundler (~> 2.0)
|
29
|
+
byebug (~> 11.1)
|
26
30
|
minitest (~> 5.11)
|
27
31
|
pry (~> 0.12)
|
28
|
-
rake (~>
|
32
|
+
rake (~> 13.0)
|
29
33
|
static_site_builder!
|
34
|
+
yart (~> 0.1)
|
35
|
+
|
36
|
+
RUBY VERSION
|
37
|
+
ruby 2.7.0p0
|
30
38
|
|
31
39
|
BUNDLED WITH
|
32
|
-
2.
|
40
|
+
2.2.31
|
data/README.md
CHANGED
@@ -2,21 +2,21 @@
|
|
2
2
|
|
3
3
|
Build a HTML website from markdown files.
|
4
4
|
|
5
|
-
This gem will convert your markdown files into HTML files, embedding the generated HTML into a template (making up the full webpage). This gem's default [
|
5
|
+
This gem will convert your markdown files into HTML files, embedding the generated HTML into a template (making up the full webpage). This gem's default [Simple.css](https://simplecss.org/) template will be used unless you specify a template of your own. More on this further down.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
9
|
$ gem install static_site_builder
|
10
10
|
|
11
|
-
This will add an executable called `
|
11
|
+
This will add an executable called `site_builder` to your `$PATH`.
|
12
12
|
|
13
13
|
## Usage
|
14
14
|
|
15
15
|
```sh
|
16
16
|
$ mkdir -p ~/my_site
|
17
17
|
$ cd ~/my_site
|
18
|
-
$ echo "# My Amazing Website"
|
19
|
-
$
|
18
|
+
$ echo "# My Amazing Website" > index.md
|
19
|
+
$ site_builder build
|
20
20
|
Site built with 1 HTML file(s):
|
21
21
|
./index.html
|
22
22
|
$ open index.html
|
@@ -26,13 +26,13 @@ That's it! In this instance, there will be a newly generated mobile friendly `in
|
|
26
26
|
|
27
27
|
Of course, you can specify an input and output directory as well as a custom HTML template to use instead of the default one.
|
28
28
|
|
29
|
-
For full usage of `
|
29
|
+
For full usage of `site_builder`, see:
|
30
30
|
|
31
|
-
$
|
31
|
+
$ site_builder help build
|
32
32
|
|
33
33
|
## Templating
|
34
34
|
|
35
|
-
The default template uses
|
35
|
+
The default template uses [Simple.css](https://simplecss.org/) to enable a stylish and responsive web design out of the box.
|
36
36
|
|
37
37
|
Custom templates are simply HTML files which include an editable region (inside a `<body>` tag) consisting of the following markdown:
|
38
38
|
|
@@ -53,6 +53,22 @@ If using your own template, you must ensure it's valid HTML and that it contains
|
|
53
53
|
|
54
54
|
You can use this gem's built in [default template](https://github.com/michaeltelford/static_site_builder/blob/master/templates/default_template.html) as an example.
|
55
55
|
|
56
|
+
## Beyond Markdown
|
57
|
+
|
58
|
+
Markdown makes writing static content easy, but it doesn't support more advanced HTML features (like forms etc). You can write your own HTML within the markdown document and it will be parsed as is. Alternatively, you can use the [`yart`](https://github.com/michaeltelford/yart) gem to turn Ruby into HTML, removing the boiler plate from generating HTML.
|
59
|
+
|
60
|
+
For example, placing the following code snippet inside your markdown will create a contact form in the generated HTML page:
|
61
|
+
|
62
|
+
```yart
|
63
|
+
form action: "/api/contact" do
|
64
|
+
input type: :email, required: true
|
65
|
+
input type: :textarea, required: true
|
66
|
+
button(type: :submit) { "Send Message" }
|
67
|
+
end
|
68
|
+
```
|
69
|
+
|
70
|
+
The important bit here is the ` ```yart ` line which tells the `YART` parser to render this snippet of Ruby into HTML. Check out the [`yart README`](https://github.com/michaeltelford/yart) for more details on how to use the `YART` DSL.
|
71
|
+
|
56
72
|
## Development
|
57
73
|
|
58
74
|
I welcome community contribution as long as the changes makes sense.
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rake/testtask"
|
3
3
|
require "static_site_builder"
|
4
|
+
require "byebug"
|
4
5
|
|
5
6
|
task default: :help
|
6
7
|
|
@@ -17,10 +18,10 @@ end
|
|
17
18
|
desc "Builds a static HTML site from markdown files"
|
18
19
|
task :build_site, :markdown_dirpath, :output_dirpath do |t, args|
|
19
20
|
args.with_defaults(markdown_dirpath: "./markdown")
|
20
|
-
args.with_defaults(output_dirpath:
|
21
|
+
args.with_defaults(output_dirpath: "./markdown/html")
|
21
22
|
puts StaticSiteBuilder.build_website(
|
22
23
|
args[:markdown_dirpath],
|
23
|
-
StaticSiteBuilder::
|
24
|
+
StaticSiteBuilder::TemplateRenderer.new,
|
24
25
|
args[:output_dirpath]
|
25
26
|
)
|
26
27
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
4
|
+
|
4
5
|
require "static_site_builder"
|
5
6
|
require "thor"
|
6
7
|
|
7
|
-
DEFAULT_TEMPLATE = StaticSiteBuilder::
|
8
|
+
DEFAULT_TEMPLATE = StaticSiteBuilder::TemplateRenderer::DEFAULT_TEMPLATE
|
8
9
|
|
9
10
|
class SiteBuilderCLI < Thor
|
10
11
|
desc "build", "Builds a static HTML website from markdown"
|
@@ -16,20 +17,20 @@ class SiteBuilderCLI < Thor
|
|
16
17
|
desc: "HTML template which embeds the markdown (<body>) of each webpage"
|
17
18
|
)
|
18
19
|
def build
|
19
|
-
template = StaticSiteBuilder::
|
20
|
+
template = StaticSiteBuilder::TemplateRenderer.new(
|
20
21
|
template_filepath: options[:template],
|
21
22
|
gem_included_template: options[:template] == DEFAULT_TEMPLATE
|
22
23
|
)
|
23
24
|
|
24
|
-
|
25
|
+
html_files = StaticSiteBuilder.build_website(
|
25
26
|
options[:in],
|
26
27
|
template,
|
27
28
|
options[:out]
|
28
29
|
)
|
29
30
|
|
30
|
-
|
31
|
-
puts "Site built with #{
|
32
|
-
puts
|
31
|
+
unless html_files.empty?
|
32
|
+
puts "Site built with #{html_files.length} HTML file(s):"
|
33
|
+
puts html_files
|
33
34
|
else
|
34
35
|
puts "No markdown files found in: #{options[:in]}"
|
35
36
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module StaticSiteBuilder
|
2
|
+
# Renders Markdown into HTML. Any existing HTML inside the Markdown will NOT be removed,
|
3
|
+
# allowing other renderers to be applied before this one where required.
|
4
|
+
class MarkdownRenderer < Renderer
|
5
|
+
attr_reader :markdown
|
6
|
+
|
7
|
+
def initialize(markdown)
|
8
|
+
super()
|
9
|
+
|
10
|
+
@markdown = markdown
|
11
|
+
@redcarpet = Redcarpet::Markdown.new(
|
12
|
+
Redcarpet::Render::HTML,
|
13
|
+
tables: true,
|
14
|
+
fenced_code_blocks: true,
|
15
|
+
autolink: true,
|
16
|
+
strikethrough: true,
|
17
|
+
superscript: true,
|
18
|
+
underline: true,
|
19
|
+
highlight: true,
|
20
|
+
quote: true,
|
21
|
+
footnotes: true,
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Returns a String of HTML (rendered from the given Markdown).
|
26
|
+
def render
|
27
|
+
@redcarpet.render(@markdown)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,14 +1,15 @@
|
|
1
1
|
module StaticSiteBuilder
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
# Renders the given HTML body inside the given HTML webpage template.
|
3
|
+
class TemplateRenderer < Renderer
|
4
|
+
EDITABLE_REGION = '<div id="editable_region"></div>'.freeze
|
5
|
+
DEFAULT_TEMPLATE = File.join("..", "templates", "default_template.html").freeze
|
5
6
|
|
6
7
|
attr_reader :template_filepath, :gem_included_template, :html
|
7
8
|
|
8
9
|
# Initializes a HTML template with either a template_filepath to a HTML file
|
9
10
|
# or a HTML string. Either way the HTML should be valid and contain the
|
10
11
|
# EDITABLE_REGION. If no params are provided then the DEFAULT_TEMPLATE is
|
11
|
-
# used instead. The DEFAULT_TEMPLATE uses
|
12
|
+
# used instead. The DEFAULT_TEMPLATE uses simple.css (from a CDN).
|
12
13
|
# The html takes precedence over the template_filepath if provided.
|
13
14
|
# The gem_included_template param distinguishes between a user created
|
14
15
|
# template (on their local file system) and an included template (built
|
@@ -18,15 +19,15 @@ module StaticSiteBuilder
|
|
18
19
|
gem_included_template: true,
|
19
20
|
html: nil
|
20
21
|
)
|
22
|
+
super()
|
23
|
+
|
21
24
|
@template_filepath = template_filepath
|
22
25
|
@gem_included_template = gem_included_template
|
23
26
|
@html = html
|
24
27
|
|
25
28
|
read_template unless @html
|
26
29
|
|
27
|
-
|
28
|
-
raise "Missing editable region in template: #{EDITABLE_REGION}"
|
29
|
-
end
|
30
|
+
raise "Missing editable region in template: #{EDITABLE_REGION}" unless valid?
|
30
31
|
end
|
31
32
|
|
32
33
|
# Returns wether or not the @html has an EDITABLE_REGION or not.
|
@@ -45,15 +46,17 @@ module StaticSiteBuilder
|
|
45
46
|
|
46
47
|
private
|
47
48
|
|
48
|
-
# Reads the @template_filepath file and sets @html to
|
49
|
+
# Reads the @template_filepath file and sets @html to its contents.
|
49
50
|
# The correct filepath is decided on based on wether or not the template is
|
50
51
|
# built into the gem or on the user's local filesystem.
|
51
52
|
def read_template
|
52
53
|
path = @template_filepath
|
54
|
+
|
53
55
|
if @gem_included_template
|
54
|
-
relative_path = "
|
56
|
+
relative_path = File.join("..", "..", @template_filepath)
|
55
57
|
path = File.expand_path(relative_path, File.dirname(__FILE__))
|
56
58
|
end
|
59
|
+
|
57
60
|
@html = File.read(path)
|
58
61
|
end
|
59
62
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
def yart_installed?
|
2
|
+
require("yart")
|
3
|
+
true
|
4
|
+
rescue LoadError
|
5
|
+
puts "Skipping YART rendering because the 'yart' gem isn't installed"
|
6
|
+
false
|
7
|
+
end
|
8
|
+
|
9
|
+
$yart_installed = yart_installed?
|
10
|
+
|
11
|
+
module StaticSiteBuilder
|
12
|
+
# Renders YART snippets into HTML (within a Markdown document).
|
13
|
+
class YARTRenderer < Renderer
|
14
|
+
YART_START_LINE = "```yart"
|
15
|
+
YART_END_LINE = "```"
|
16
|
+
YART_PARSE_ERROR = "'YART.parse' detected in markdown, remove it leaving just the block to be parsed by YART"
|
17
|
+
|
18
|
+
attr_reader :markdown
|
19
|
+
|
20
|
+
def initialize(markdown)
|
21
|
+
super()
|
22
|
+
|
23
|
+
@markdown = markdown
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns a String of Markdown (having recursively rendered any found YART snippets into HTML).
|
27
|
+
def render
|
28
|
+
return @markdown unless $yart_installed
|
29
|
+
|
30
|
+
lines = @markdown.split("\n")
|
31
|
+
return @markdown unless yart_snippet?(lines)
|
32
|
+
|
33
|
+
yart_lines = extract_yart_lines(lines)
|
34
|
+
yart_snippet = yart_lines[1..-2].join("\n")
|
35
|
+
raise YART_PARSE_ERROR if yart_snippet.include?("YART.parse")
|
36
|
+
|
37
|
+
html = YART.parse { eval(yart_snippet) }
|
38
|
+
@markdown.sub!(yart_lines.join("\n"), html)
|
39
|
+
|
40
|
+
render
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def yart_snippet?(lines)
|
46
|
+
lines.include?(YART_START_LINE) && lines.include?(YART_END_LINE)
|
47
|
+
end
|
48
|
+
|
49
|
+
def extract_yart_lines(lines)
|
50
|
+
start = lines.find_index(YART_START_LINE)
|
51
|
+
finish = lines.find_index(YART_END_LINE)
|
52
|
+
|
53
|
+
lines[start..finish]
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/static_site_builder.rb
CHANGED
@@ -1,64 +1,64 @@
|
|
1
|
-
# Require all lib files here to enable a single require.
|
2
|
-
require "static_site_builder/version"
|
3
|
-
require "static_site_builder/html_templater"
|
4
|
-
|
5
1
|
# Require any non lib code here to enable a single require.
|
6
2
|
require "fileutils"
|
7
3
|
require "redcarpet"
|
8
4
|
|
5
|
+
# Require all lib files here to enable a single require.
|
6
|
+
require "static_site_builder/version"
|
7
|
+
require "static_site_builder/renderers/renderer"
|
8
|
+
require "static_site_builder/renderers/yart_renderer"
|
9
|
+
require "static_site_builder/renderers/markdown_renderer"
|
10
|
+
require "static_site_builder/renderers/template_renderer"
|
11
|
+
|
9
12
|
module StaticSiteBuilder
|
10
|
-
#
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
underline: true,
|
19
|
-
highlight: true,
|
20
|
-
quote: true,
|
21
|
-
footnotes: true
|
22
|
-
)
|
23
|
-
renderer.render(markdown)
|
13
|
+
# Takes a markdown_dirpath, finds all "*.md" files and converts each to a
|
14
|
+
# "*.html" file in order to build a static website. A template is used to
|
15
|
+
# embed each built webpage in. The output_dirpath will default to the
|
16
|
+
# markdown_dirpath if not set.
|
17
|
+
def self.build_website(markdown_dirpath, template, output_dirpath=nil)
|
18
|
+
pattern = File.join(markdown_dirpath, "*.md")
|
19
|
+
|
20
|
+
Dir.glob(pattern).map { |f| self.build_webpage(f, template, output_dirpath) }
|
24
21
|
end
|
25
22
|
|
23
|
+
private
|
24
|
+
|
26
25
|
# Takes a markdown_filepath, reads and converts its contents to html before
|
27
26
|
# creating a html file of the same name in the output_dirpath directory.
|
28
27
|
# If not provided, the output_dirpath will be the same directory as the
|
29
28
|
# markdown file. The output_dirpath will be created if not already.
|
30
|
-
# Note: If the html file already exists
|
29
|
+
# Note: If the html file already exists its contents will be overwritten.
|
31
30
|
# A template is used to house the html body in, creating a full webpage.
|
32
31
|
def self.build_webpage(markdown_filepath, template, output_dirpath=nil)
|
33
|
-
|
32
|
+
markdown_filepath = self.remove_trailing_slash(markdown_filepath)
|
33
|
+
output_dirpath = self.remove_trailing_slash(output_dirpath)
|
34
34
|
|
35
|
-
|
36
|
-
html =
|
35
|
+
markdown = File.read(markdown_filepath)
|
36
|
+
html = self.apply_renderers(template, markdown)
|
37
37
|
|
38
38
|
dirpath = File.dirname(markdown_filepath)
|
39
39
|
output_dirpath ||= dirpath
|
40
|
-
FileUtils.mkdir_p(output_dirpath) unless Dir.
|
40
|
+
FileUtils.mkdir_p(output_dirpath) unless Dir.exist?(output_dirpath)
|
41
41
|
|
42
42
|
filename_with_md_ext = File.basename(markdown_filepath)
|
43
|
-
filename_without_md_ext = filename_with_md_ext.
|
44
|
-
html_filepath = "#{output_dirpath}/#{filename_without_md_ext}.html"
|
43
|
+
filename_without_md_ext = filename_with_md_ext.gsub(".md", "")
|
45
44
|
|
45
|
+
html_filepath = File.join(output_dirpath, "#{filename_without_md_ext}.html")
|
46
46
|
File.open(html_filepath, "w") { |f| f.write(html) }
|
47
|
+
|
47
48
|
html_filepath
|
48
49
|
end
|
49
50
|
|
50
|
-
#
|
51
|
-
|
52
|
-
|
53
|
-
# markdown_dirpath if not set.
|
54
|
-
def self.build_website(markdown_dirpath, template, output_dirpath=nil)
|
55
|
-
html_filepaths = []
|
56
|
-
pattern = "#{markdown_dirpath}/*.md"
|
51
|
+
# Removes the trailing / (if present) and returns.
|
52
|
+
def self.remove_trailing_slash(filepath)
|
53
|
+
return filepath unless filepath.end_with?("/")
|
57
54
|
|
58
|
-
|
59
|
-
|
60
|
-
end
|
55
|
+
filepath.chop
|
56
|
+
end
|
61
57
|
|
62
|
-
|
58
|
+
# Apply the necessary renderers to the Markdown, returning a HTML String.
|
59
|
+
def self.apply_renderers(template, markdown)
|
60
|
+
markdown = YARTRenderer.new(markdown).render
|
61
|
+
html_body = MarkdownRenderer.new(markdown).render
|
62
|
+
template.render(html_body)
|
63
63
|
end
|
64
64
|
end
|
data/static_site_builder.gemspec
CHANGED
@@ -9,14 +9,14 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Michael Telford"]
|
10
10
|
spec.email = ["michael.telford@live.com"]
|
11
11
|
|
12
|
-
spec.summary = "
|
12
|
+
spec.summary = "Gem for building static content websites from markdown."
|
13
13
|
spec.description = "Gem for building static content websites from markdown."
|
14
14
|
spec.homepage = "https://github.com/michaeltelford/static_site_builder"
|
15
15
|
spec.license = "MIT"
|
16
|
-
|
17
|
-
spec.post_install_message = "Added the executable 'static_site_builder' to $PATH"
|
18
16
|
|
19
|
-
spec.
|
17
|
+
spec.post_install_message = "Added the executable 'site_builder' to $PATH"
|
18
|
+
|
19
|
+
spec.required_ruby_version = '~> 2.7'
|
20
20
|
|
21
21
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
22
22
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
@@ -31,14 +31,16 @@ Gem::Specification.new do |spec|
|
|
31
31
|
f.match(%r{^(test|spec|features)/})
|
32
32
|
end
|
33
33
|
spec.bindir = "exe"
|
34
|
-
spec.executables = ["
|
34
|
+
spec.executables = ["site_builder"]
|
35
35
|
spec.require_paths = ["lib"]
|
36
36
|
|
37
37
|
spec.add_development_dependency "bundler", "~> 2.0"
|
38
|
-
spec.add_development_dependency "rake", "~>
|
38
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
39
39
|
spec.add_development_dependency "minitest", "~> 5.11"
|
40
40
|
spec.add_development_dependency "pry", "~> 0.12"
|
41
|
+
spec.add_development_dependency "byebug", "~> 11.1"
|
42
|
+
spec.add_development_dependency "yart", "~> 0.1"
|
41
43
|
|
42
44
|
spec.add_runtime_dependency "redcarpet", "~> 3.4"
|
43
|
-
spec.add_runtime_dependency "thor", "~>
|
45
|
+
spec.add_runtime_dependency "thor", "~> 1.1"
|
44
46
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8">
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
6
|
-
<link rel="stylesheet" href="https://
|
6
|
+
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
<div id="editable_region"></div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: static_site_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Telford
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +66,34 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.12'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: byebug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '11.1'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '11.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: yart
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.1'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.1'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: redcarpet
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,28 +114,26 @@ dependencies:
|
|
86
114
|
requirements:
|
87
115
|
- - "~>"
|
88
116
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
117
|
+
version: '1.1'
|
90
118
|
type: :runtime
|
91
119
|
prerelease: false
|
92
120
|
version_requirements: !ruby/object:Gem::Requirement
|
93
121
|
requirements:
|
94
122
|
- - "~>"
|
95
123
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
124
|
+
version: '1.1'
|
97
125
|
description: Gem for building static content websites from markdown.
|
98
126
|
email:
|
99
127
|
- michael.telford@live.com
|
100
128
|
executables:
|
101
|
-
-
|
129
|
+
- site_builder
|
102
130
|
extensions: []
|
103
131
|
extra_rdoc_files: []
|
104
132
|
files:
|
105
133
|
- ".dockerignore"
|
106
134
|
- ".gitignore"
|
107
135
|
- ".ruby-version"
|
108
|
-
- ".travis.yml"
|
109
136
|
- CODE_OF_CONDUCT.md
|
110
|
-
- Dockerfile
|
111
137
|
- Gemfile
|
112
138
|
- Gemfile.lock
|
113
139
|
- LICENSE.txt
|
@@ -115,9 +141,12 @@ files:
|
|
115
141
|
- Rakefile
|
116
142
|
- bin/console
|
117
143
|
- bin/setup
|
118
|
-
- exe/
|
144
|
+
- exe/site_builder
|
119
145
|
- lib/static_site_builder.rb
|
120
|
-
- lib/static_site_builder/
|
146
|
+
- lib/static_site_builder/renderers/markdown_renderer.rb
|
147
|
+
- lib/static_site_builder/renderers/renderer.rb
|
148
|
+
- lib/static_site_builder/renderers/template_renderer.rb
|
149
|
+
- lib/static_site_builder/renderers/yart_renderer.rb
|
121
150
|
- lib/static_site_builder/version.rb
|
122
151
|
- static_site_builder.gemspec
|
123
152
|
- templates/default_template.html
|
@@ -126,7 +155,7 @@ licenses:
|
|
126
155
|
- MIT
|
127
156
|
metadata:
|
128
157
|
allowed_push_host: https://rubygems.org
|
129
|
-
post_install_message: Added the executable '
|
158
|
+
post_install_message: Added the executable 'site_builder' to $PATH
|
130
159
|
rdoc_options: []
|
131
160
|
require_paths:
|
132
161
|
- lib
|
@@ -134,16 +163,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
134
163
|
requirements:
|
135
164
|
- - "~>"
|
136
165
|
- !ruby/object:Gem::Version
|
137
|
-
version: '2.
|
166
|
+
version: '2.7'
|
138
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
168
|
requirements:
|
140
169
|
- - ">="
|
141
170
|
- !ruby/object:Gem::Version
|
142
171
|
version: '0'
|
143
172
|
requirements: []
|
144
|
-
|
145
|
-
rubygems_version: 2.7.8
|
173
|
+
rubygems_version: 3.2.31
|
146
174
|
signing_key:
|
147
175
|
specification_version: 4
|
148
|
-
summary:
|
176
|
+
summary: Gem for building static content websites from markdown.
|
149
177
|
test_files: []
|
data/.travis.yml
DELETED
data/Dockerfile
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
FROM ruby:2.4-alpine3.4
|
2
|
-
MAINTAINER Michael Telford
|
3
|
-
|
4
|
-
RUN apk --update add --virtual \
|
5
|
-
build_deps \
|
6
|
-
build-base \
|
7
|
-
ruby-dev \
|
8
|
-
libc-dev \
|
9
|
-
linux-headers \
|
10
|
-
openssl-dev \
|
11
|
-
postgresql-dev \
|
12
|
-
libxml2-dev \
|
13
|
-
libxslt-dev \
|
14
|
-
bash \
|
15
|
-
make \
|
16
|
-
git \
|
17
|
-
curl \
|
18
|
-
curl-dev \
|
19
|
-
jq
|
20
|
-
|
21
|
-
WORKDIR /app
|
22
|
-
COPY . /app
|
23
|
-
|
24
|
-
CMD ["bash"]
|