nanoc 3.7.4 → 3.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +19 -18
- data/LICENSE +1 -1
- data/NEWS.md +14 -0
- data/Rakefile +1 -1
- data/doc/yardoc_handlers/identifier.rb +1 -5
- data/lib/nanoc.rb +1 -3
- data/lib/nanoc/base.rb +1 -4
- data/lib/nanoc/base/checksummer.rb +10 -12
- data/lib/nanoc/base/compilation/checksum_store.rb +0 -4
- data/lib/nanoc/base/compilation/compiled_content_cache.rb +0 -4
- data/lib/nanoc/base/compilation/compiler.rb +27 -31
- data/lib/nanoc/base/compilation/compiler_dsl.rb +3 -7
- data/lib/nanoc/base/compilation/dependency_tracker.rb +2 -6
- data/lib/nanoc/base/compilation/filter.rb +1 -7
- data/lib/nanoc/base/compilation/item_rep_proxy.rb +0 -4
- data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +0 -4
- data/lib/nanoc/base/compilation/outdatedness_checker.rb +0 -4
- data/lib/nanoc/base/compilation/outdatedness_reasons.rb +0 -6
- data/lib/nanoc/base/compilation/rule.rb +1 -5
- data/lib/nanoc/base/compilation/rule_context.rb +7 -11
- data/lib/nanoc/base/compilation/rule_memory_calculator.rb +0 -4
- data/lib/nanoc/base/compilation/rule_memory_store.rb +0 -4
- data/lib/nanoc/base/compilation/rules_collection.rb +5 -9
- data/lib/nanoc/base/context.rb +0 -3
- data/lib/nanoc/base/core_ext.rb +0 -1
- data/lib/nanoc/base/core_ext/array.rb +0 -2
- data/lib/nanoc/base/core_ext/hash.rb +0 -2
- data/lib/nanoc/base/core_ext/pathname.rb +0 -2
- data/lib/nanoc/base/core_ext/string.rb +0 -2
- data/lib/nanoc/base/directed_graph.rb +0 -4
- data/lib/nanoc/base/errors.rb +1 -39
- data/lib/nanoc/base/memoization.rb +0 -4
- data/lib/nanoc/base/notification_center.rb +1 -7
- data/lib/nanoc/base/plugin_registry.rb +4 -10
- data/lib/nanoc/base/result_data/item_rep.rb +8 -16
- data/lib/nanoc/base/source_data/code_snippet.rb +1 -5
- data/lib/nanoc/base/source_data/configuration.rb +0 -4
- data/lib/nanoc/base/source_data/data_source.rb +2 -5
- data/lib/nanoc/base/source_data/item.rb +3 -7
- data/lib/nanoc/base/source_data/item_array.rb +1 -5
- data/lib/nanoc/base/source_data/layout.rb +2 -6
- data/lib/nanoc/base/source_data/site.rb +20 -23
- data/lib/nanoc/base/store.rb +1 -5
- data/lib/nanoc/base/temp_filename_factory.rb +0 -4
- data/lib/nanoc/cli.rb +3 -5
- data/lib/nanoc/cli/ansi_string_colorizer.rb +6 -10
- data/lib/nanoc/cli/cleaning_stream.rb +2 -6
- data/lib/nanoc/cli/command_runner.rb +1 -5
- data/lib/nanoc/cli/commands/autocompile.rb +2 -6
- data/lib/nanoc/cli/commands/check.rb +0 -4
- data/lib/nanoc/cli/commands/compile.rb +12 -27
- data/lib/nanoc/cli/commands/create-item.rb +1 -5
- data/lib/nanoc/cli/commands/create-layout.rb +0 -4
- data/lib/nanoc/cli/commands/create-site.rb +2 -8
- data/lib/nanoc/cli/commands/deploy.rb +3 -7
- data/lib/nanoc/cli/commands/prune.rb +2 -6
- data/lib/nanoc/cli/commands/shell.rb +4 -8
- data/lib/nanoc/cli/commands/show-data.rb +3 -7
- data/lib/nanoc/cli/commands/show-plugins.rb +3 -7
- data/lib/nanoc/cli/commands/show-rules.rb +11 -15
- data/lib/nanoc/cli/commands/sync.rb +0 -4
- data/lib/nanoc/cli/commands/update.rb +1 -7
- data/lib/nanoc/cli/commands/validate-css.rb +0 -4
- data/lib/nanoc/cli/commands/validate-html.rb +0 -4
- data/lib/nanoc/cli/commands/validate-links.rb +0 -4
- data/lib/nanoc/cli/commands/view.rb +3 -7
- data/lib/nanoc/cli/commands/watch.rb +4 -10
- data/lib/nanoc/cli/error_handler.rb +9 -13
- data/lib/nanoc/cli/logger.rb +8 -12
- data/lib/nanoc/cli/stream_cleaners.rb +0 -4
- data/lib/nanoc/cli/stream_cleaners/abstract.rb +1 -5
- data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +0 -4
- data/lib/nanoc/cli/stream_cleaners/utf8.rb +1 -5
- data/lib/nanoc/data_sources.rb +2 -4
- data/lib/nanoc/data_sources/deprecated/delicious.rb +6 -10
- data/lib/nanoc/data_sources/deprecated/last_fm.rb +7 -11
- data/lib/nanoc/data_sources/deprecated/twitter.rb +2 -6
- data/lib/nanoc/data_sources/filesystem.rb +10 -13
- data/lib/nanoc/data_sources/filesystem_unified.rb +0 -4
- data/lib/nanoc/data_sources/filesystem_verbose.rb +0 -4
- data/lib/nanoc/data_sources/static.rb +4 -8
- data/lib/nanoc/extra.rb +2 -4
- data/lib/nanoc/extra/auto_compiler.rb +2 -6
- data/lib/nanoc/extra/checking.rb +0 -4
- data/lib/nanoc/extra/checking/check.rb +0 -4
- data/lib/nanoc/extra/checking/checks.rb +0 -2
- data/lib/nanoc/extra/checking/checks/css.rb +6 -6
- data/lib/nanoc/extra/checking/checks/external_links.rb +3 -11
- data/lib/nanoc/extra/checking/checks/html.rb +6 -6
- data/lib/nanoc/extra/checking/checks/internal_links.rb +3 -7
- data/lib/nanoc/extra/checking/checks/stale.rb +3 -7
- data/lib/nanoc/extra/checking/dsl.rb +0 -4
- data/lib/nanoc/extra/checking/issue.rb +0 -4
- data/lib/nanoc/extra/checking/runner.rb +4 -7
- data/lib/nanoc/extra/chick.rb +7 -17
- data/lib/nanoc/extra/core_ext.rb +0 -1
- data/lib/nanoc/extra/core_ext/pathname.rb +0 -4
- data/lib/nanoc/extra/core_ext/time.rb +0 -2
- data/lib/nanoc/extra/deployer.rb +0 -4
- data/lib/nanoc/extra/deployers.rb +0 -4
- data/lib/nanoc/extra/deployers/fog.rb +7 -11
- data/lib/nanoc/extra/deployers/rsync.rb +1 -5
- data/lib/nanoc/extra/file_proxy.rb +1 -5
- data/lib/nanoc/extra/filesystem_tools.rb +37 -12
- data/lib/nanoc/extra/jruby_nokogiri_warner.rb +0 -4
- data/lib/nanoc/extra/link_collector.rb +3 -7
- data/lib/nanoc/extra/piper.rb +0 -6
- data/lib/nanoc/extra/pruner.rb +1 -7
- data/lib/nanoc/extra/validators.rb +0 -4
- data/lib/nanoc/extra/validators/links.rb +0 -4
- data/lib/nanoc/extra/validators/w3c.rb +0 -4
- data/lib/nanoc/extra/vcs.rb +3 -7
- data/lib/nanoc/extra/vcses.rb +0 -2
- data/lib/nanoc/extra/vcses/bazaar.rb +0 -4
- data/lib/nanoc/extra/vcses/dummy.rb +0 -4
- data/lib/nanoc/extra/vcses/git.rb +0 -4
- data/lib/nanoc/extra/vcses/mercurial.rb +0 -4
- data/lib/nanoc/extra/vcses/subversion.rb +0 -4
- data/lib/nanoc/filters.rb +0 -2
- data/lib/nanoc/filters/asciidoc.rb +1 -5
- data/lib/nanoc/filters/bluecloth.rb +0 -2
- data/lib/nanoc/filters/coderay.rb +0 -2
- data/lib/nanoc/filters/coffeescript.rb +0 -4
- data/lib/nanoc/filters/colorize_syntax.rb +17 -15
- data/lib/nanoc/filters/erb.rb +1 -3
- data/lib/nanoc/filters/erubis.rb +2 -4
- data/lib/nanoc/filters/haml.rb +2 -4
- data/lib/nanoc/filters/handlebars.rb +0 -4
- data/lib/nanoc/filters/kramdown.rb +7 -4
- data/lib/nanoc/filters/less.rb +1 -3
- data/lib/nanoc/filters/markaby.rb +0 -2
- data/lib/nanoc/filters/maruku.rb +0 -2
- data/lib/nanoc/filters/mustache.rb +1 -5
- data/lib/nanoc/filters/pandoc.rb +0 -2
- data/lib/nanoc/filters/rainpress.rb +0 -2
- data/lib/nanoc/filters/rdiscount.rb +0 -2
- data/lib/nanoc/filters/rdoc.rb +0 -2
- data/lib/nanoc/filters/redcarpet.rb +0 -4
- data/lib/nanoc/filters/redcloth.rb +0 -2
- data/lib/nanoc/filters/relativize_paths.rb +2 -4
- data/lib/nanoc/filters/rubypants.rb +0 -2
- data/lib/nanoc/filters/sass.rb +2 -4
- data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +0 -2
- data/lib/nanoc/filters/slim.rb +2 -6
- data/lib/nanoc/filters/typogruby.rb +0 -4
- data/lib/nanoc/filters/uglify_js.rb +0 -2
- data/lib/nanoc/filters/xsl.rb +1 -5
- data/lib/nanoc/filters/yui_compressor.rb +0 -4
- data/lib/nanoc/helpers.rb +0 -2
- data/lib/nanoc/helpers/blogging.rb +12 -20
- data/lib/nanoc/helpers/breadcrumbs.rb +0 -4
- data/lib/nanoc/helpers/capturing.rb +2 -10
- data/lib/nanoc/helpers/filtering.rb +0 -4
- data/lib/nanoc/helpers/html_escape.rb +3 -7
- data/lib/nanoc/helpers/link_to.rb +0 -4
- data/lib/nanoc/helpers/rendering.rb +8 -12
- data/lib/nanoc/helpers/tagging.rb +0 -4
- data/lib/nanoc/helpers/text.rb +1 -5
- data/lib/nanoc/helpers/xml_sitemap.rb +3 -7
- data/lib/nanoc/tasks/clean.rb +1 -7
- data/lib/nanoc/tasks/deploy/rsync.rake +0 -2
- data/lib/nanoc/tasks/validate.rake +0 -4
- data/lib/nanoc/version.rb +1 -3
- data/nanoc.gemspec +12 -9
- data/tasks/rubocop.rake +1 -1
- data/tasks/test.rake +6 -7
- data/test/base/checksummer_spec.rb +28 -44
- data/test/base/core_ext/array_spec.rb +1 -9
- data/test/base/core_ext/hash_spec.rb +7 -19
- data/test/base/core_ext/pathname_spec.rb +2 -4
- data/test/base/core_ext/string_spec.rb +0 -4
- data/test/base/temp_filename_factory_spec.rb +0 -8
- data/test/base/test_checksum_store.rb +0 -2
- data/test/base/test_code_snippet.rb +0 -2
- data/test/base/test_compiler.rb +15 -17
- data/test/base/test_compiler_dsl.rb +7 -9
- data/test/base/test_context.rb +2 -4
- data/test/base/test_data_source.rb +0 -2
- data/test/base/test_dependency_tracker.rb +0 -2
- data/test/base/test_directed_graph.rb +2 -4
- data/test/base/test_filter.rb +5 -7
- data/test/base/test_item.rb +17 -13
- data/test/base/test_item_array.rb +2 -4
- data/test/base/test_item_rep.rb +79 -73
- data/test/base/test_layout.rb +3 -5
- data/test/base/test_memoization.rb +13 -21
- data/test/base/test_notification_center.rb +0 -2
- data/test/base/test_outdatedness_checker.rb +34 -36
- data/test/base/test_plugin.rb +0 -2
- data/test/base/test_rule.rb +3 -5
- data/test/base/test_rule_context.rb +4 -6
- data/test/base/test_site.rb +9 -17
- data/test/base/test_store.rb +2 -6
- data/test/cli/commands/test_check.rb +1 -3
- data/test/cli/commands/test_compile.rb +24 -15
- data/test/cli/commands/test_create_item.rb +1 -3
- data/test/cli/commands/test_create_layout.rb +0 -2
- data/test/cli/commands/test_create_site.rb +0 -3
- data/test/cli/commands/test_deploy.rb +9 -11
- data/test/cli/commands/test_help.rb +0 -2
- data/test/cli/commands/test_info.rb +0 -2
- data/test/cli/commands/test_prune.rb +6 -8
- data/test/cli/commands/test_sync.rb +0 -2
- data/test/cli/commands/test_update.rb +0 -2
- data/test/cli/commands/test_watch.rb +4 -6
- data/test/cli/test_cleaning_stream.rb +4 -6
- data/test/cli/test_cli.rb +9 -5
- data/test/cli/test_error_handler.rb +9 -7
- data/test/cli/test_logger.rb +0 -2
- data/test/data_sources/test_filesystem.rb +8 -10
- data/test/data_sources/test_filesystem_unified.rb +35 -34
- data/test/data_sources/test_filesystem_verbose.rb +31 -33
- data/test/data_sources/test_static.rb +20 -21
- data/test/extra/checking/checks/test_css.rb +23 -2
- data/test/extra/checking/checks/test_external_links.rb +2 -4
- data/test/extra/checking/checks/test_html.rb +4 -3
- data/test/extra/checking/checks/test_internal_links.rb +1 -3
- data/test/extra/checking/checks/test_stale.rb +4 -6
- data/test/extra/checking/test_check.rb +0 -2
- data/test/extra/checking/test_dsl.rb +1 -3
- data/test/extra/checking/test_runner.rb +0 -2
- data/test/extra/core_ext/test_pathname.rb +0 -3
- data/test/extra/core_ext/test_time.rb +0 -2
- data/test/extra/deployers/test_fog.rb +13 -15
- data/test/extra/deployers/test_rsync.rb +4 -6
- data/test/extra/test_auto_compiler.rb +47 -25
- data/test/extra/test_file_proxy.rb +1 -3
- data/test/extra/test_filesystem_tools.rb +47 -7
- data/test/extra/test_link_collector.rb +0 -2
- data/test/extra/test_piper.rb +3 -5
- data/test/extra/test_vcs.rb +0 -2
- data/test/extra/validators/test_links.rb +0 -1
- data/test/extra/validators/test_w3c.rb +2 -4
- data/test/filters/test_asciidoc.rb +0 -2
- data/test/filters/test_bluecloth.rb +0 -2
- data/test/filters/test_coderay.rb +2 -4
- data/test/filters/test_coffeescript.rb +0 -2
- data/test/filters/test_colorize_syntax.rb +16 -18
- data/test/filters/test_erb.rb +12 -14
- data/test/filters/test_erubis.rb +4 -6
- data/test/filters/test_haml.rb +7 -9
- data/test/filters/test_handlebars.rb +10 -12
- data/test/filters/test_kramdown.rb +13 -1
- data/test/filters/test_less.rb +9 -11
- data/test/filters/test_markaby.rb +0 -2
- data/test/filters/test_maruku.rb +0 -2
- data/test/filters/test_mustache.rb +4 -6
- data/test/filters/test_pandoc.rb +1 -3
- data/test/filters/test_rainpress.rb +1 -3
- data/test/filters/test_rdiscount.rb +1 -3
- data/test/filters/test_rdoc.rb +0 -2
- data/test/filters/test_redcarpet.rb +6 -8
- data/test/filters/test_redcloth.rb +1 -3
- data/test/filters/test_relativize_paths.rb +29 -34
- data/test/filters/test_rubypants.rb +0 -2
- data/test/filters/test_sass.rb +8 -10
- data/test/filters/test_slim.rb +2 -4
- data/test/filters/test_typogruby.rb +0 -3
- data/test/filters/test_uglify_js.rb +2 -4
- data/test/filters/test_xsl.rb +16 -18
- data/test/filters/test_yui_compressor.rb +3 -5
- data/test/fixtures/vcr_cassettes/css_run_parse_error.yml +65 -0
- data/test/gem_loader.rb +1 -1
- data/test/helper.rb +11 -15
- data/test/helpers/test_blogging.rb +61 -63
- data/test/helpers/test_breadcrumbs.rb +0 -2
- data/test/helpers/test_capturing.rb +4 -6
- data/test/helpers/test_filtering.rb +2 -4
- data/test/helpers/test_html_escape.rb +0 -2
- data/test/helpers/test_link_to.rb +5 -6
- data/test/helpers/test_rendering.rb +2 -4
- data/test/helpers/test_tagging.rb +9 -11
- data/test/helpers/test_text.rb +6 -8
- data/test/helpers/test_xml_sitemap.rb +11 -13
- data/test/tasks/test_clean.rb +0 -2
- data/test/test_gem.rb +1 -3
- metadata +15 -14
- data/Gemfile.lock +0 -252
- data/lib/nanoc/base/core_ext/date.rb +0 -29
- data/lib/nanoc/base/ordered_hash.rb +0 -228
- data/lib/nanoc/extra/core_ext/enumerable.rb +0 -33
- data/test/base/core_ext/date_spec.rb +0 -15
- data/test/extra/core_ext/test_enumerable.rb +0 -28
data/lib/nanoc/filters/maruku.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
4
|
class Maruku < Nanoc::Filter
|
5
|
-
|
6
5
|
requires 'maruku'
|
7
6
|
|
8
7
|
# Runs the content through [Maruku](https://github.com/bhollis/maruku/).
|
@@ -15,6 +14,5 @@ module Nanoc::Filters
|
|
15
14
|
# Get result
|
16
15
|
::Maruku.new(content, params).to_html
|
17
16
|
end
|
18
|
-
|
19
17
|
end
|
20
18
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
|
-
|
5
4
|
# @since 3.2.0
|
6
5
|
class Mustache < Nanoc::Filter
|
7
|
-
|
8
6
|
requires 'mustache'
|
9
7
|
|
10
8
|
# Runs the content through
|
@@ -15,10 +13,8 @@ module Nanoc::Filters
|
|
15
13
|
#
|
16
14
|
# @return [String] The filtered content
|
17
15
|
def run(content, _params = {})
|
18
|
-
context = item.attributes.merge({ :
|
16
|
+
context = item.attributes.merge({ yield: assigns[:content] })
|
19
17
|
::Mustache.render(content, context)
|
20
18
|
end
|
21
|
-
|
22
19
|
end
|
23
|
-
|
24
20
|
end
|
data/lib/nanoc/filters/pandoc.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
4
|
class Pandoc < Nanoc::Filter
|
5
|
-
|
6
5
|
requires 'pandoc-ruby'
|
7
6
|
|
8
7
|
# Runs the content through [Pandoc](http://johnmacfarlane.net/pandoc/)
|
@@ -15,6 +14,5 @@ module Nanoc::Filters
|
|
15
14
|
def run(content, *params)
|
16
15
|
PandocRuby.convert(content, *params)
|
17
16
|
end
|
18
|
-
|
19
17
|
end
|
20
18
|
end
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
4
|
class Rainpress < Nanoc::Filter
|
5
|
-
|
6
5
|
requires 'rainpress'
|
7
6
|
|
8
7
|
# Runs the content through [Rainpress](http://code.google.com/p/rainpress/).
|
@@ -14,6 +13,5 @@ module Nanoc::Filters
|
|
14
13
|
def run(content, params = {})
|
15
14
|
::Rainpress.compress(content, params)
|
16
15
|
end
|
17
|
-
|
18
16
|
end
|
19
17
|
end
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
4
|
class RDiscount < Nanoc::Filter
|
5
|
-
|
6
5
|
requires 'rdiscount'
|
7
6
|
|
8
7
|
# Runs the content through [RDiscount](http://github.com/rtomayko/rdiscount).
|
@@ -17,6 +16,5 @@ module Nanoc::Filters
|
|
17
16
|
|
18
17
|
::RDiscount.new(content, *extensions).to_html
|
19
18
|
end
|
20
|
-
|
21
19
|
end
|
22
20
|
end
|
data/lib/nanoc/filters/rdoc.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
4
|
class RDoc < Nanoc::Filter
|
5
|
-
|
6
5
|
requires 'rdoc'
|
7
6
|
|
8
7
|
def self.setup
|
@@ -21,6 +20,5 @@ module Nanoc::Filters
|
|
21
20
|
to_html = ::RDoc::Markup::ToHtml.new(options)
|
22
21
|
::RDoc::Markup.new.convert(content, to_html)
|
23
22
|
end
|
24
|
-
|
25
23
|
end
|
26
24
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
|
-
|
5
4
|
# @since 3.2.0
|
6
5
|
class Redcarpet < Nanoc::Filter
|
7
|
-
|
8
6
|
requires 'redcarpet'
|
9
7
|
|
10
8
|
# Runs the content through [Redcarpet](https://github.com/vmg/redcarpet).
|
@@ -81,7 +79,5 @@ module Nanoc::Filters
|
|
81
79
|
end
|
82
80
|
end
|
83
81
|
end
|
84
|
-
|
85
82
|
end
|
86
|
-
|
87
83
|
end
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
4
|
class RelativizePaths < Nanoc::Filter
|
5
|
-
|
6
5
|
require 'nanoc/helpers/link_to'
|
7
6
|
include Nanoc::Helpers::LinkTo
|
8
7
|
|
@@ -37,7 +36,7 @@ module Nanoc::Filters
|
|
37
36
|
# Filter
|
38
37
|
case params[:type]
|
39
38
|
when :css
|
40
|
-
# FIXME parse CSS the proper way using csspool or something
|
39
|
+
# FIXME: parse CSS the proper way using csspool or something
|
41
40
|
content.gsub(/url\((['"]?)(\/(?:[^\/].*?)?)\1\)/) do
|
42
41
|
'url(' + $1 + relative_path_to($2) + $1 + ')'
|
43
42
|
end
|
@@ -53,7 +52,7 @@ module Nanoc::Filters
|
|
53
52
|
klass = ::Nokogiri::XML
|
54
53
|
when :xhtml
|
55
54
|
klass = ::Nokogiri::XML
|
56
|
-
# FIXME cleanup because it is ugly
|
55
|
+
# FIXME: cleanup because it is ugly
|
57
56
|
# this cleans the XHTML namespace to process fragments and full
|
58
57
|
# documents in the same way. At least, Nokogiri adds this namespace
|
59
58
|
# if detects the `html` element.
|
@@ -98,6 +97,5 @@ module Nanoc::Filters
|
|
98
97
|
def path_is_relativizable?(s)
|
99
98
|
s[0, 1] == '/'
|
100
99
|
end
|
101
|
-
|
102
100
|
end
|
103
101
|
end
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
4
|
class RubyPants < Nanoc::Filter
|
5
|
-
|
6
5
|
requires 'rubypants'
|
7
6
|
|
8
7
|
# Runs the content through [RubyPants](http://rubydoc.info/gems/rubypants/).
|
@@ -15,6 +14,5 @@ module Nanoc::Filters
|
|
15
14
|
# Get result
|
16
15
|
::RubyPants.new(content).to_html
|
17
16
|
end
|
18
|
-
|
19
17
|
end
|
20
18
|
end
|
data/lib/nanoc/filters/sass.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
4
|
class Sass < Nanoc::Filter
|
5
|
-
|
6
5
|
requires 'sass', 'nanoc/filters/sass/sass_filesystem_importer'
|
7
6
|
|
8
7
|
# Runs the content through [Sass](http://sass-lang.com/).
|
@@ -13,8 +12,8 @@ module Nanoc::Filters
|
|
13
12
|
# @return [String] The filtered content
|
14
13
|
def run(content, params = {})
|
15
14
|
options = params.merge({
|
16
|
-
:
|
17
|
-
:
|
15
|
+
nanoc_current_filter: self,
|
16
|
+
filename: @item && @item.raw_filename,
|
18
17
|
})
|
19
18
|
engine = ::Sass::Engine.new(content, options)
|
20
19
|
engine.render
|
@@ -26,6 +25,5 @@ module Nanoc::Filters
|
|
26
25
|
Pathname.new(i.raw_filename).realpath == Pathname.new(filename).realpath
|
27
26
|
end
|
28
27
|
end
|
29
|
-
|
30
28
|
end
|
31
29
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class ::Sass::Importers::Filesystem
|
4
|
-
|
5
4
|
alias_method :_orig_find, :_find
|
6
5
|
|
7
6
|
def _find(dir, name, options)
|
@@ -17,5 +16,4 @@ class ::Sass::Importers::Filesystem
|
|
17
16
|
# Call original _find
|
18
17
|
_orig_find(dir, name, options)
|
19
18
|
end
|
20
|
-
|
21
19
|
end
|
data/lib/nanoc/filters/slim.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
|
-
|
5
4
|
# @since 3.2.0
|
6
5
|
class Slim < Nanoc::Filter
|
7
|
-
|
8
6
|
requires 'slim'
|
9
7
|
|
10
8
|
# Runs the content through [Slim](http://slim-lang.com/).
|
@@ -15,8 +13,8 @@ module Nanoc::Filters
|
|
15
13
|
# @return [String] The filtered content
|
16
14
|
def run(content, params = {})
|
17
15
|
params = {
|
18
|
-
:
|
19
|
-
:
|
16
|
+
disable_capture: true, # Capture managed by nanoc
|
17
|
+
buffer: '_erbout', # Force slim to output to the buffer used by nanoc
|
20
18
|
}.merge params
|
21
19
|
|
22
20
|
# Create context
|
@@ -24,7 +22,5 @@ module Nanoc::Filters
|
|
24
22
|
|
25
23
|
::Slim::Template.new(params) { content }.render(context) { assigns[:content] }
|
26
24
|
end
|
27
|
-
|
28
25
|
end
|
29
|
-
|
30
26
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
|
-
|
5
4
|
# @since 3.2.0
|
6
5
|
class Typogruby < Nanoc::Filter
|
7
|
-
|
8
6
|
requires 'typogruby'
|
9
7
|
|
10
8
|
# Runs the content through [Typogruby](http://avdgaag.github.com/typogruby/).
|
@@ -17,7 +15,5 @@ module Nanoc::Filters
|
|
17
15
|
# Get result
|
18
16
|
::Typogruby.improve(content)
|
19
17
|
end
|
20
|
-
|
21
18
|
end
|
22
|
-
|
23
19
|
end
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
4
|
class UglifyJS < Nanoc::Filter
|
5
|
-
|
6
5
|
requires 'uglifier'
|
7
6
|
|
8
7
|
# Runs the content through [UglifyJS](https://github.com/mishoo/UglifyJS2/).
|
@@ -17,6 +16,5 @@ module Nanoc::Filters
|
|
17
16
|
# Add filename to load path
|
18
17
|
Uglifier.new(params).compile(content)
|
19
18
|
end
|
20
|
-
|
21
19
|
end
|
22
20
|
end
|
data/lib/nanoc/filters/xsl.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
|
-
|
5
4
|
# @since 3.3.0
|
6
5
|
class XSL < Nanoc::Filter
|
7
|
-
|
8
6
|
requires 'nokogiri'
|
9
7
|
|
10
8
|
# Runs the item content through an [XSLT](http://www.w3.org/TR/xslt)
|
@@ -25,7 +23,7 @@ module Nanoc::Filters
|
|
25
23
|
#
|
26
24
|
# layout 'xsl-report', :xsl, :awesome => 'definitely'
|
27
25
|
#
|
28
|
-
# @param [String]
|
26
|
+
# @param [String] _content Ignored. As the filter can be run only as a
|
29
27
|
# layout, the value of the `:content` parameter passed to the class at
|
30
28
|
# initialization is used as the content to transform.
|
31
29
|
#
|
@@ -45,7 +43,5 @@ module Nanoc::Filters
|
|
45
43
|
|
46
44
|
xsl.apply_to(xml, ::Nokogiri::XSLT.quote_params(params))
|
47
45
|
end
|
48
|
-
|
49
46
|
end
|
50
|
-
|
51
47
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
|
-
|
5
4
|
# @since 3.3.0
|
6
5
|
class YUICompressor < Nanoc::Filter
|
7
|
-
|
8
6
|
requires 'yuicompressor'
|
9
7
|
|
10
8
|
# Compress Javascript or CSS using [YUICompressor](http://rubydoc.info/gems/yuicompressor).
|
@@ -19,7 +17,5 @@ module Nanoc::Filters
|
|
19
17
|
def run(content, params = {})
|
20
18
|
::YUICompressor.compress(content, params)
|
21
19
|
end
|
22
|
-
|
23
20
|
end
|
24
|
-
|
25
21
|
end
|
data/lib/nanoc/helpers.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Helpers
|
4
|
-
|
5
4
|
autoload 'Blogging', 'nanoc/helpers/blogging'
|
6
5
|
autoload 'Breadcrumbs', 'nanoc/helpers/breadcrumbs'
|
7
6
|
autoload 'Capturing', 'nanoc/helpers/capturing'
|
@@ -12,5 +11,4 @@ module Nanoc::Helpers
|
|
12
11
|
autoload 'Tagging', 'nanoc/helpers/tagging'
|
13
12
|
autoload 'Text', 'nanoc/helpers/text'
|
14
13
|
autoload 'XMLSitemap', 'nanoc/helpers/xml_sitemap'
|
15
|
-
|
16
14
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Helpers
|
4
|
-
|
5
4
|
# Provides functionality for building blogs, such as finding articles and
|
6
5
|
# constructing feeds.
|
7
6
|
#
|
@@ -22,13 +21,12 @@ module Nanoc::Helpers
|
|
22
21
|
#
|
23
22
|
# The two main functions are {#sorted_articles} and {#atom_feed}.
|
24
23
|
module Blogging
|
25
|
-
|
26
24
|
# Returns an unsorted list of articles, i.e. items where the `kind`
|
27
25
|
# attribute is set to `"article"`.
|
28
26
|
#
|
29
27
|
# @return [Array] An array containing all articles
|
30
28
|
def articles
|
31
|
-
blk =
|
29
|
+
blk = -> { @items.select { |item| item[:kind] == 'article' } }
|
32
30
|
if @items.frozen?
|
33
31
|
@article_items ||= blk.call
|
34
32
|
else
|
@@ -42,9 +40,7 @@ module Nanoc::Helpers
|
|
42
40
|
#
|
43
41
|
# @return [Array] A sorted array containing all articles
|
44
42
|
def sorted_articles
|
45
|
-
blk =
|
46
|
-
articles.sort_by { |a| attribute_to_time(a[:created_at]) }.reverse
|
47
|
-
end
|
43
|
+
blk = -> { articles.sort_by { |a| attribute_to_time(a[:created_at]) }.reverse }
|
48
44
|
|
49
45
|
if @items.frozen?
|
50
46
|
@sorted_article_items ||= blk.call
|
@@ -54,7 +50,6 @@ module Nanoc::Helpers
|
|
54
50
|
end
|
55
51
|
|
56
52
|
class AtomFeedBuilder
|
57
|
-
|
58
53
|
include Nanoc::Helpers::Blogging
|
59
54
|
|
60
55
|
attr_accessor :site
|
@@ -82,7 +77,7 @@ module Nanoc::Helpers
|
|
82
77
|
|
83
78
|
def build
|
84
79
|
buffer = ''
|
85
|
-
xml = Builder::XmlMarkup.new(:
|
80
|
+
xml = Builder::XmlMarkup.new(target: buffer, indent: 2)
|
86
81
|
build_for_feed(xml)
|
87
82
|
buffer
|
88
83
|
end
|
@@ -128,7 +123,7 @@ module Nanoc::Helpers
|
|
128
123
|
|
129
124
|
def build_for_feed(xml)
|
130
125
|
xml.instruct!
|
131
|
-
xml.feed(:
|
126
|
+
xml.feed(xmlns: 'http://www.w3.org/2005/Atom') do
|
132
127
|
root_url = @site.config[:base_url] + '/'
|
133
128
|
|
134
129
|
# Add primary attributes
|
@@ -139,8 +134,8 @@ module Nanoc::Helpers
|
|
139
134
|
xml.updated(attribute_to_time(last_article[:created_at]).to_iso8601_time)
|
140
135
|
|
141
136
|
# Add links
|
142
|
-
xml.link(:
|
143
|
-
xml.link(:
|
137
|
+
xml.link(rel: 'alternate', href: root_url)
|
138
|
+
xml.link(rel: 'self', href: feed_url)
|
144
139
|
|
145
140
|
# Add author information
|
146
141
|
xml.author do
|
@@ -167,7 +162,7 @@ module Nanoc::Helpers
|
|
167
162
|
xml.entry do
|
168
163
|
# Add primary attributes
|
169
164
|
xml.id atom_tag_for(a)
|
170
|
-
xml.title a[:title], :
|
165
|
+
xml.title a[:title], type: 'html'
|
171
166
|
|
172
167
|
# Add dates
|
173
168
|
xml.published attribute_to_time(a[:created_at]).to_iso8601_time
|
@@ -182,15 +177,14 @@ module Nanoc::Helpers
|
|
182
177
|
end
|
183
178
|
|
184
179
|
# Add link
|
185
|
-
xml.link(:
|
180
|
+
xml.link(rel: 'alternate', href: url)
|
186
181
|
|
187
182
|
# Add content
|
188
183
|
summary = excerpt_proc.call(a)
|
189
|
-
xml.content content_proc.call(a), :
|
190
|
-
xml.summary summary, :
|
184
|
+
xml.content content_proc.call(a), type: 'html'
|
185
|
+
xml.summary summary, type: 'html' unless summary.nil?
|
191
186
|
end
|
192
187
|
end
|
193
|
-
|
194
188
|
end
|
195
189
|
|
196
190
|
# Returns a string representing the atom feed containing recent articles,
|
@@ -309,8 +303,8 @@ module Nanoc::Helpers
|
|
309
303
|
# Fill builder
|
310
304
|
builder.limit = params[:limit] || 5
|
311
305
|
builder.relevant_articles = params[:articles] || articles || []
|
312
|
-
builder.content_proc = params[:content_proc] ||
|
313
|
-
builder.excerpt_proc = params[:excerpt_proc] ||
|
306
|
+
builder.content_proc = params[:content_proc] || ->(a) { a.compiled_content(snapshot: :pre) }
|
307
|
+
builder.excerpt_proc = params[:excerpt_proc] || ->(a) { a[:excerpt] }
|
314
308
|
builder.title = params[:title] || @item[:title] || @site.config[:title]
|
315
309
|
builder.author_name = params[:author_name] || @item[:author_name] || @site.config[:author_name]
|
316
310
|
builder.author_uri = params[:author_uri] || @item[:author_uri] || @site.config[:author_uri]
|
@@ -386,7 +380,5 @@ module Nanoc::Helpers
|
|
386
380
|
time = Time.parse(time) if time.is_a?(String)
|
387
381
|
time
|
388
382
|
end
|
389
|
-
|
390
383
|
end
|
391
|
-
|
392
384
|
end
|