nanoc 3.8.0 → 4.0.0a1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +322 -0
- data/NEWS.md +6 -0
- data/bin/nanoc +0 -18
- data/lib/nanoc.rb +5 -3
- data/lib/nanoc/base.rb +24 -6
- data/lib/nanoc/base/checksummer.rb +6 -4
- data/lib/nanoc/base/compilation/checksum_store.rb +4 -4
- data/lib/nanoc/base/compilation/compiled_content_cache.rb +5 -5
- data/lib/nanoc/base/compilation/compiler.rb +60 -65
- data/lib/nanoc/base/compilation/compiler_dsl.rb +11 -9
- data/lib/nanoc/base/compilation/dependency_tracker.rb +24 -38
- data/lib/nanoc/base/compilation/filter.rb +22 -7
- data/lib/nanoc/base/compilation/item_rep_proxy.rb +14 -12
- data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +8 -8
- data/lib/nanoc/base/compilation/outdatedness_checker.rb +32 -32
- data/lib/nanoc/base/compilation/outdatedness_reasons.rb +3 -1
- data/lib/nanoc/base/compilation/rule.rb +9 -7
- data/lib/nanoc/base/compilation/rule_context.rb +15 -15
- data/lib/nanoc/base/compilation/rule_memory_calculator.rb +3 -3
- data/lib/nanoc/base/compilation/rule_memory_store.rb +7 -7
- data/lib/nanoc/base/compilation/rules_collection.rb +28 -30
- data/lib/nanoc/base/context.rb +2 -2
- data/lib/nanoc/base/core_ext/array.rb +17 -25
- data/lib/nanoc/base/core_ext/hash.rb +17 -25
- data/lib/nanoc/base/core_ext/pathname.rb +4 -2
- data/lib/nanoc/base/core_ext/string.rb +5 -3
- data/lib/nanoc/base/directed_graph.rb +4 -9
- data/lib/nanoc/base/error.rb +7 -0
- data/lib/nanoc/base/errors.rb +16 -23
- data/lib/nanoc/base/memoization.rb +4 -2
- data/lib/nanoc/base/notification_center.rb +3 -1
- data/lib/nanoc/base/plugin_registry.rb +14 -21
- data/lib/nanoc/base/result_data/item_rep.rb +43 -88
- data/lib/nanoc/base/source_data/code_snippet.rb +6 -4
- data/lib/nanoc/base/source_data/configuration.rb +3 -1
- data/lib/nanoc/base/source_data/data_source.rb +12 -94
- data/lib/nanoc/base/source_data/identifier.rb +50 -0
- data/lib/nanoc/base/source_data/item.rb +24 -67
- data/lib/nanoc/base/source_data/item_array.rb +6 -4
- data/lib/nanoc/base/source_data/layout.rb +17 -28
- data/lib/nanoc/base/source_data/site.rb +33 -44
- data/lib/nanoc/base/store.rb +3 -5
- data/lib/nanoc/base/temp_filename_factory.rb +3 -2
- data/lib/nanoc/base/views/config.rb +19 -0
- data/lib/nanoc/base/views/item.rb +77 -0
- data/lib/nanoc/base/views/item_collection.rb +43 -0
- data/lib/nanoc/base/views/item_rep.rb +125 -0
- data/lib/nanoc/base/views/layout.rb +42 -0
- data/lib/nanoc/base/views/layout_collection.rb +26 -0
- data/lib/nanoc/base/views/mutable_config.rb +9 -0
- data/lib/nanoc/base/views/mutable_item.rb +9 -0
- data/lib/nanoc/base/views/mutable_item_collection.rb +18 -0
- data/lib/nanoc/base/views/mutable_layout.rb +9 -0
- data/lib/nanoc/base/views/mutable_layout_collection.rb +18 -0
- data/lib/nanoc/base/views/site.rb +35 -0
- data/lib/nanoc/cli.rb +3 -6
- data/lib/nanoc/cli/ansi_string_colorizer.rb +2 -0
- data/lib/nanoc/cli/cleaning_stream.rb +2 -0
- data/lib/nanoc/cli/command_runner.rb +8 -42
- data/lib/nanoc/cli/commands/check.rb +2 -2
- data/lib/nanoc/cli/commands/compile.rb +19 -34
- data/lib/nanoc/cli/commands/create-site.rb +46 -83
- data/lib/nanoc/cli/commands/deploy.rb +4 -4
- data/lib/nanoc/cli/commands/shell.rb +1 -1
- data/lib/nanoc/cli/commands/show-plugins.rb +4 -6
- data/lib/nanoc/cli/error_handler.rb +4 -14
- data/lib/nanoc/cli/logger.rb +2 -0
- data/lib/nanoc/cli/stream_cleaners.rb +1 -0
- data/lib/nanoc/cli/stream_cleaners/abstract.rb +2 -0
- data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +2 -0
- data/lib/nanoc/cli/stream_cleaners/utf8.rb +2 -0
- data/lib/nanoc/data_sources.rb +1 -17
- data/lib/nanoc/data_sources/filesystem.rb +6 -37
- data/lib/nanoc/data_sources/filesystem_unified.rb +5 -3
- data/lib/nanoc/data_sources/filesystem_verbose.rb +5 -3
- data/lib/nanoc/data_sources/static.rb +4 -2
- data/lib/nanoc/extra.rb +1 -13
- data/lib/nanoc/extra/checking.rb +1 -0
- data/lib/nanoc/extra/checking/check.rb +4 -2
- data/lib/nanoc/extra/checking/checks.rb +1 -0
- data/lib/nanoc/extra/checking/checks/css.rb +1 -0
- data/lib/nanoc/extra/checking/checks/external_links.rb +2 -0
- data/lib/nanoc/extra/checking/checks/html.rb +1 -0
- data/lib/nanoc/extra/checking/checks/internal_links.rb +2 -0
- data/lib/nanoc/extra/checking/checks/mixed_content.rb +2 -0
- data/lib/nanoc/extra/checking/checks/stale.rb +1 -0
- data/lib/nanoc/extra/checking/dsl.rb +1 -0
- data/lib/nanoc/extra/checking/issue.rb +1 -0
- data/lib/nanoc/extra/checking/runner.rb +3 -3
- data/lib/nanoc/extra/core_ext/pathname.rb +5 -3
- data/lib/nanoc/extra/core_ext/time.rb +4 -2
- data/lib/nanoc/extra/deployer.rb +3 -1
- data/lib/nanoc/extra/deployers.rb +1 -0
- data/lib/nanoc/extra/deployers/fog.rb +2 -0
- data/lib/nanoc/extra/deployers/rsync.rb +2 -0
- data/lib/nanoc/extra/filesystem_tools.rb +3 -7
- data/lib/nanoc/extra/jruby_nokogiri_warner.rb +1 -0
- data/lib/nanoc/extra/link_collector.rb +1 -0
- data/lib/nanoc/extra/piper.rb +2 -1
- data/lib/nanoc/extra/pruner.rb +5 -3
- data/lib/nanoc/filters.rb +1 -2
- data/lib/nanoc/filters/asciidoc.rb +2 -0
- data/lib/nanoc/filters/bluecloth.rb +1 -0
- data/lib/nanoc/filters/coffeescript.rb +2 -0
- data/lib/nanoc/filters/colorize_syntax.rb +1 -12
- data/lib/nanoc/filters/erb.rb +2 -1
- data/lib/nanoc/filters/erubis.rb +2 -1
- data/lib/nanoc/filters/haml.rb +2 -1
- data/lib/nanoc/filters/handlebars.rb +2 -0
- data/lib/nanoc/filters/kramdown.rb +1 -0
- data/lib/nanoc/filters/less.rb +1 -0
- data/lib/nanoc/filters/markaby.rb +1 -0
- data/lib/nanoc/filters/maruku.rb +1 -0
- data/lib/nanoc/filters/mustache.rb +2 -0
- data/lib/nanoc/filters/pandoc.rb +1 -0
- data/lib/nanoc/filters/rainpress.rb +1 -0
- data/lib/nanoc/filters/rdiscount.rb +1 -0
- data/lib/nanoc/filters/rdoc.rb +1 -0
- data/lib/nanoc/filters/redcarpet.rb +2 -0
- data/lib/nanoc/filters/redcloth.rb +1 -0
- data/lib/nanoc/filters/relativize_paths.rb +1 -0
- data/lib/nanoc/filters/rubypants.rb +1 -0
- data/lib/nanoc/filters/sass.rb +1 -0
- data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +2 -0
- data/lib/nanoc/filters/slim.rb +3 -1
- data/lib/nanoc/filters/typogruby.rb +2 -0
- data/lib/nanoc/filters/uglify_js.rb +1 -0
- data/lib/nanoc/filters/xsl.rb +2 -0
- data/lib/nanoc/filters/yui_compressor.rb +2 -0
- data/lib/nanoc/helpers/blogging.rb +30 -30
- data/lib/nanoc/helpers/breadcrumbs.rb +2 -2
- data/lib/nanoc/helpers/capturing.rb +6 -17
- data/lib/nanoc/helpers/filtering.rb +3 -3
- data/lib/nanoc/helpers/link_to.rb +3 -3
- data/lib/nanoc/helpers/rendering.rb +11 -11
- data/lib/nanoc/helpers/xml_sitemap.rb +3 -3
- data/lib/nanoc/tasks.rb +1 -0
- data/lib/nanoc/tasks/clean.rake +1 -1
- data/lib/nanoc/version.rb +1 -1
- data/tasks/doc.rake +2 -1
- data/tasks/test.rake +7 -1
- data/test/base/checksummer_spec.rb +15 -15
- data/test/base/core_ext/array_spec.rb +10 -10
- data/test/base/core_ext/hash_spec.rb +16 -16
- data/test/base/core_ext/pathname_spec.rb +2 -2
- data/test/base/core_ext/string_spec.rb +9 -9
- data/test/base/temp_filename_factory_spec.rb +3 -7
- data/test/base/test_checksum_store.rb +5 -5
- data/test/base/test_code_snippet.rb +3 -3
- data/test/base/test_compiler.rb +29 -29
- data/test/base/test_compiler_dsl.rb +23 -23
- data/test/base/test_context.rb +4 -4
- data/test/base/test_data_source.rb +17 -7
- data/test/base/test_dependency_tracker.rb +29 -29
- data/test/base/test_directed_graph.rb +27 -27
- data/test/base/test_item.rb +23 -21
- data/test/base/test_item_array.rb +18 -18
- data/test/base/test_item_rep.rb +76 -76
- data/test/base/test_item_rep_recorder_proxy.rb +4 -4
- data/test/base/test_layout.rb +8 -16
- data/test/base/test_memoization.rb +4 -4
- data/test/base/test_notification_center.rb +6 -6
- data/test/base/test_outdatedness_checker.rb +18 -18
- data/test/base/test_plugin.rb +1 -1
- data/test/base/test_rule.rb +2 -2
- data/test/base/test_rule_context.rb +5 -5
- data/test/base/test_site.rb +62 -38
- data/test/base/test_store.rb +2 -2
- data/test/cli/commands/test_check.rb +1 -1
- data/test/cli/commands/test_compile.rb +24 -18
- data/test/cli/commands/test_create_site.rb +5 -7
- data/test/cli/commands/test_deploy.rb +1 -1
- data/test/data_sources/test_filesystem.rb +22 -67
- data/test/data_sources/test_filesystem_unified.rb +10 -23
- data/test/data_sources/test_filesystem_verbose.rb +8 -53
- data/test/data_sources/test_static.rb +9 -9
- data/test/extra/checking/checks/test_stale.rb +1 -1
- data/test/extra/core_ext/test_pathname.rb +3 -3
- data/test/extra/core_ext/test_time.rb +4 -4
- data/test/extra/test_filesystem_tools.rb +1 -1
- data/test/filters/test_handlebars.rb +3 -3
- data/test/filters/test_less.rb +6 -6
- data/test/filters/test_mustache.rb +2 -2
- data/test/filters/test_relativize_paths.rb +81 -81
- data/test/filters/test_sass.rb +7 -7
- data/test/filters/test_xsl.rb +6 -6
- data/test/helper.rb +1 -1
- data/test/helpers/test_blogging.rb +78 -99
- data/test/helpers/test_breadcrumbs.rb +12 -12
- data/test/helpers/test_capturing.rb +10 -11
- data/test/helpers/test_filtering.rb +6 -6
- data/test/helpers/test_rendering.rb +3 -3
- data/test/helpers/test_tagging.rb +7 -7
- data/test/helpers/test_xml_sitemap.rb +34 -33
- metadata +19 -43
- data/lib/nanoc/cli/commands/autocompile.rb +0 -69
- data/lib/nanoc/cli/commands/create-item.rb +0 -55
- data/lib/nanoc/cli/commands/create-layout.rb +0 -68
- data/lib/nanoc/cli/commands/sync.rb +0 -32
- data/lib/nanoc/cli/commands/update.rb +0 -63
- data/lib/nanoc/cli/commands/validate-css.rb +0 -20
- data/lib/nanoc/cli/commands/validate-html.rb +0 -20
- data/lib/nanoc/cli/commands/validate-links.rb +0 -27
- data/lib/nanoc/cli/commands/watch.rb +0 -176
- data/lib/nanoc/data_sources/deprecated/delicious.rb +0 -38
- data/lib/nanoc/data_sources/deprecated/last_fm.rb +0 -85
- data/lib/nanoc/data_sources/deprecated/twitter.rb +0 -34
- data/lib/nanoc/extra/auto_compiler.rb +0 -99
- data/lib/nanoc/extra/chick.rb +0 -117
- data/lib/nanoc/extra/file_proxy.rb +0 -36
- data/lib/nanoc/extra/validators.rb +0 -8
- data/lib/nanoc/extra/validators/links.rb +0 -18
- data/lib/nanoc/extra/validators/w3c.rb +0 -23
- data/lib/nanoc/extra/vcs.rb +0 -62
- data/lib/nanoc/extra/vcses.rb +0 -15
- data/lib/nanoc/extra/vcses/bazaar.rb +0 -21
- data/lib/nanoc/extra/vcses/dummy.rb +0 -20
- data/lib/nanoc/extra/vcses/git.rb +0 -21
- data/lib/nanoc/extra/vcses/mercurial.rb +0 -21
- data/lib/nanoc/extra/vcses/subversion.rb +0 -21
- data/lib/nanoc/filters/coderay.rb +0 -19
- data/lib/nanoc3.rb +0 -3
- data/lib/nanoc3/cli.rb +0 -3
- data/lib/nanoc3/tasks.rb +0 -3
- data/test/cli/commands/test_create_item.rb +0 -10
- data/test/cli/commands/test_create_layout.rb +0 -24
- data/test/cli/commands/test_sync.rb +0 -27
- data/test/cli/commands/test_update.rb +0 -6
- data/test/cli/commands/test_watch.rb +0 -74
- data/test/extra/test_auto_compiler.rb +0 -437
- data/test/extra/test_vcs.rb +0 -18
- data/test/extra/validators/test_links.rb +0 -4
- data/test/extra/validators/test_w3c.rb +0 -37
- data/test/filters/test_coderay.rb +0 -40
@@ -8,6 +8,8 @@ require 'uri'
|
|
8
8
|
|
9
9
|
module ::Nanoc::Extra::Checking::Checks
|
10
10
|
# A validator that verifies that all external links point to a location that exists.
|
11
|
+
#
|
12
|
+
# @api private
|
11
13
|
class ExternalLinks < ::Nanoc::Extra::Checking::Check
|
12
14
|
identifiers :external_links, :elinks
|
13
15
|
|
@@ -4,6 +4,8 @@ require 'uri'
|
|
4
4
|
|
5
5
|
module Nanoc::Extra::Checking::Checks
|
6
6
|
# A check that verifies that all internal links point to a location that exists.
|
7
|
+
#
|
8
|
+
# @api private
|
7
9
|
class InternalLinks < ::Nanoc::Extra::Checking::Check
|
8
10
|
# Starts the validator. The results will be printed to stdout.
|
9
11
|
#
|
@@ -3,6 +3,8 @@
|
|
3
3
|
module Nanoc::Extra::Checking::Checks
|
4
4
|
# A check that verifies HTML files do not reference external resources with
|
5
5
|
# URLs that would trigger "mixed content" warnings.
|
6
|
+
#
|
7
|
+
# @api private
|
6
8
|
class MixedContent < ::Nanoc::Extra::Checking::Check
|
7
9
|
PROTOCOL_PATTERN = /^(\w+):\/\//
|
8
10
|
|
@@ -7,7 +7,7 @@ module Nanoc::Extra::Checking
|
|
7
7
|
class Runner
|
8
8
|
CHECKS_FILENAMES = ['Checks', 'Checks.rb', 'checks', 'checks.rb']
|
9
9
|
|
10
|
-
# @param [Nanoc::Site] site The nanoc site this runner is for
|
10
|
+
# @param [Nanoc::Int::Site] site The nanoc site this runner is for
|
11
11
|
def initialize(site)
|
12
12
|
@site = site
|
13
13
|
end
|
@@ -81,7 +81,7 @@ module Nanoc::Extra::Checking
|
|
81
81
|
def require_dsl
|
82
82
|
load_dsl_if_available
|
83
83
|
if dsl.nil?
|
84
|
-
raise Nanoc::Errors::GenericTrivial, "No checks defined (no #{CHECKS_FILENAMES.first} file present)"
|
84
|
+
raise Nanoc::Int::Errors::GenericTrivial, "No checks defined (no #{CHECKS_FILENAMES.first} file present)"
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
@@ -102,7 +102,7 @@ module Nanoc::Extra::Checking
|
|
102
102
|
def check_classes_named(n)
|
103
103
|
n.map do |a|
|
104
104
|
klass = Nanoc::Extra::Checking::Check.named(a)
|
105
|
-
raise Nanoc::Errors::GenericTrivial, "Unknown check: #{a}" if klass.nil?
|
105
|
+
raise Nanoc::Int::Errors::GenericTrivial, "Unknown check: #{a}" if klass.nil?
|
106
106
|
klass
|
107
107
|
end
|
108
108
|
end
|
@@ -1,8 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Extra
|
4
|
+
# @api private
|
4
5
|
module PathnameExtensions
|
5
|
-
def
|
6
|
+
def __nanoc_components
|
6
7
|
components = []
|
7
8
|
tmp = self
|
8
9
|
loop do
|
@@ -14,12 +15,13 @@ module Nanoc::Extra
|
|
14
15
|
components.reverse
|
15
16
|
end
|
16
17
|
|
17
|
-
def
|
18
|
-
|
18
|
+
def __nanoc_include_component?(component)
|
19
|
+
__nanoc_components.include?(component)
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
24
|
+
# @api private
|
23
25
|
class ::Pathname
|
24
26
|
include ::Nanoc::Extra::PathnameExtensions
|
25
27
|
end
|
@@ -1,17 +1,19 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
# @api private
|
3
4
|
module Nanoc::Extra::TimeExtensions
|
4
5
|
# @return [String] The time in an ISO-8601 date format.
|
5
|
-
def
|
6
|
+
def __nanoc_to_iso8601_date
|
6
7
|
strftime('%Y-%m-%d')
|
7
8
|
end
|
8
9
|
|
9
10
|
# @return [String] The time in an ISO-8601 time format.
|
10
|
-
def
|
11
|
+
def __nanoc_to_iso8601_time
|
11
12
|
getutc.strftime('%Y-%m-%dT%H:%M:%SZ')
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
16
|
+
# @api private
|
15
17
|
class Time
|
16
18
|
include Nanoc::Extra::TimeExtensions
|
17
19
|
end
|
data/lib/nanoc/extra/deployer.rb
CHANGED
@@ -5,8 +5,10 @@ module Nanoc::Extra
|
|
5
5
|
# to a specific (remote) location.
|
6
6
|
#
|
7
7
|
# @abstract Subclass and override {#run} to implement a custom filter.
|
8
|
+
#
|
9
|
+
# @api private
|
8
10
|
class Deployer
|
9
|
-
extend Nanoc::PluginRegistry::PluginMethods
|
11
|
+
extend Nanoc::Int::PluginRegistry::PluginMethods
|
10
12
|
|
11
13
|
# @return [String] The path to the directory that contains the files to
|
12
14
|
# upload. It should not have a trailing slash.
|
@@ -6,9 +6,7 @@ module Nanoc::Extra
|
|
6
6
|
# @api private
|
7
7
|
module FilesystemTools
|
8
8
|
# Error that is raised when too many symlink indirections are encountered.
|
9
|
-
|
10
|
-
# @api private
|
11
|
-
class MaxSymlinkDepthExceededError < ::Nanoc::Errors::GenericTrivial
|
9
|
+
class MaxSymlinkDepthExceededError < ::Nanoc::Int::Errors::GenericTrivial
|
12
10
|
# @return [String] The last filename that was attempted to be
|
13
11
|
# resolved before giving up
|
14
12
|
attr_reader :filename
|
@@ -23,9 +21,7 @@ module Nanoc::Extra
|
|
23
21
|
|
24
22
|
# Error that is raised when a file of an unknown type is encountered
|
25
23
|
# (something other than file, directory or link).
|
26
|
-
|
27
|
-
# @api private
|
28
|
-
class UnsupportedFileTypeError < ::Nanoc::Errors::GenericTrivial
|
24
|
+
class UnsupportedFileTypeError < ::Nanoc::Int::Errors::GenericTrivial
|
29
25
|
# @return [String] The filename of the file whose type is not supported
|
30
26
|
attr_reader :filename
|
31
27
|
|
@@ -106,7 +102,7 @@ module Nanoc::Extra
|
|
106
102
|
when Array
|
107
103
|
patterns.concat(extra_files.map { |extra_file| "#{dir_name}/#{extra_file}" })
|
108
104
|
else
|
109
|
-
raise Nanoc::Errors::GenericTrivial,
|
105
|
+
raise Nanoc::Int::Errors::GenericTrivial,
|
110
106
|
"Do not know how to handle extra_files: #{extra_files.inspect}"
|
111
107
|
end
|
112
108
|
Dir.glob(patterns)
|
data/lib/nanoc/extra/piper.rb
CHANGED
data/lib/nanoc/extra/pruner.rb
CHANGED
@@ -3,11 +3,13 @@
|
|
3
3
|
module Nanoc::Extra
|
4
4
|
# Responsible for finding and deleting files in the site’s output directory
|
5
5
|
# that are not managed by nanoc.
|
6
|
+
#
|
7
|
+
# @api private
|
6
8
|
class Pruner
|
7
|
-
# @return [Nanoc::Site] The site this pruner belongs to
|
9
|
+
# @return [Nanoc::Int::Site] The site this pruner belongs to
|
8
10
|
attr_reader :site
|
9
11
|
|
10
|
-
# @param [Nanoc::Site] site The site for which a pruner is created
|
12
|
+
# @param [Nanoc::Int::Site] site The site for which a pruner is created
|
11
13
|
#
|
12
14
|
# @option params [Boolean] :dry_run (false) true if the files to be deleted
|
13
15
|
# should only be printed instead of actually deleted, false if the files
|
@@ -58,7 +60,7 @@ module Nanoc::Extra
|
|
58
60
|
# @return [Boolean] true if the given file is excluded, false otherwise
|
59
61
|
def filename_excluded?(filename)
|
60
62
|
pathname = Pathname.new(filename)
|
61
|
-
@exclude.any? { |e| pathname.
|
63
|
+
@exclude.any? { |e| pathname.__nanoc_include_component?(e) }
|
62
64
|
end
|
63
65
|
|
64
66
|
protected
|
data/lib/nanoc/filters.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
# @api private
|
3
4
|
module Nanoc::Filters
|
4
5
|
autoload 'AsciiDoc', 'nanoc/filters/asciidoc'
|
5
6
|
autoload 'BlueCloth', 'nanoc/filters/bluecloth'
|
6
|
-
autoload 'CodeRay', 'nanoc/filters/coderay'
|
7
7
|
autoload 'ColorizeSyntax', 'nanoc/filters/colorize_syntax'
|
8
8
|
autoload 'CoffeeScript', 'nanoc/filters/coffeescript'
|
9
9
|
autoload 'ERB', 'nanoc/filters/erb'
|
@@ -32,7 +32,6 @@ module Nanoc::Filters
|
|
32
32
|
|
33
33
|
Nanoc::Filter.register '::Nanoc::Filters::AsciiDoc', :asciidoc
|
34
34
|
Nanoc::Filter.register '::Nanoc::Filters::BlueCloth', :bluecloth
|
35
|
-
Nanoc::Filter.register '::Nanoc::Filters::CodeRay', :coderay
|
36
35
|
Nanoc::Filter.register '::Nanoc::Filters::ColorizeSyntax', :colorize_syntax
|
37
36
|
Nanoc::Filter.register '::Nanoc::Filters::CoffeeScript', :coffeescript
|
38
37
|
Nanoc::Filter.register '::Nanoc::Filters::ERB', :erb
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
|
+
# @api private
|
4
5
|
class ColorizeSyntax < Nanoc::Filter
|
5
6
|
requires 'nokogiri', 'stringio', 'open3'
|
6
7
|
|
@@ -155,8 +156,6 @@ module Nanoc::Filters
|
|
155
156
|
#
|
156
157
|
# @param [Boolean] is_fullpage true if the given content is a full page,
|
157
158
|
# false if it is a fragment
|
158
|
-
#
|
159
|
-
# @api private
|
160
159
|
def parse(content, klass, is_fullpage)
|
161
160
|
if is_fullpage
|
162
161
|
klass.parse(content, nil, 'UTF-8')
|
@@ -173,8 +172,6 @@ module Nanoc::Filters
|
|
173
172
|
|
174
173
|
# Runs the code through [CodeRay](http://coderay.rubychan.de/).
|
175
174
|
#
|
176
|
-
# @api private
|
177
|
-
#
|
178
175
|
# @param [String] code The code to colorize
|
179
176
|
#
|
180
177
|
# @param [String] language The language the code is written in
|
@@ -203,8 +200,6 @@ module Nanoc::Filters
|
|
203
200
|
# Runs the content through [pygmentize](http://pygments.org/docs/cmdline/),
|
204
201
|
# the command-line frontend for [Pygments](http://pygments.org/).
|
205
202
|
#
|
206
|
-
# @api private
|
207
|
-
#
|
208
203
|
# @param [String] code The code to colorize
|
209
204
|
#
|
210
205
|
# @param [String] language The language the code is written in
|
@@ -232,8 +227,6 @@ module Nanoc::Filters
|
|
232
227
|
# Runs the content through [Pygments](http://pygments.org/) via
|
233
228
|
# [pygments.rb](https://github.com/tmm1/pygments.rb).
|
234
229
|
#
|
235
|
-
# @api private
|
236
|
-
#
|
237
230
|
# @param [String] code The code to colorize
|
238
231
|
#
|
239
232
|
# @param [String] language The language the code is written in
|
@@ -259,8 +252,6 @@ module Nanoc::Filters
|
|
259
252
|
|
260
253
|
# Runs the content through [Highlight](http://www.andre-simon.de/doku/highlight/en/highlight.html).
|
261
254
|
#
|
262
|
-
# @api private
|
263
|
-
#
|
264
255
|
# @since 3.2.0
|
265
256
|
#
|
266
257
|
# @param [String] code The code to colorize
|
@@ -315,8 +306,6 @@ module Nanoc::Filters
|
|
315
306
|
|
316
307
|
# Runs the content through [Rouge](https://github.com/jayferd/rouge/.
|
317
308
|
#
|
318
|
-
# @api private
|
319
|
-
#
|
320
309
|
# @param [String] code The code to colorize
|
321
310
|
#
|
322
311
|
# @param [String] language The language the code is written in
|
data/lib/nanoc/filters/erb.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
|
+
# @api private
|
4
5
|
class ERB < Nanoc::Filter
|
5
6
|
requires 'erb'
|
6
7
|
|
@@ -19,7 +20,7 @@ module Nanoc::Filters
|
|
19
20
|
assigns.merge!(params[:locals] || {})
|
20
21
|
|
21
22
|
# Create context
|
22
|
-
context = ::Nanoc::Context.new(assigns)
|
23
|
+
context = ::Nanoc::Int::Context.new(assigns)
|
23
24
|
|
24
25
|
# Get binding
|
25
26
|
proc = assigns[:content] ? -> { assigns[:content] } : nil
|
data/lib/nanoc/filters/erubis.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
|
+
# @api private
|
4
5
|
class Erubis < Nanoc::Filter
|
5
6
|
requires 'erubis'
|
6
7
|
|
@@ -19,7 +20,7 @@ module Nanoc::Filters
|
|
19
20
|
# @return [String] The filtered content
|
20
21
|
def run(content, _params = {})
|
21
22
|
# Create context
|
22
|
-
context = ::Nanoc::Context.new(assigns)
|
23
|
+
context = ::Nanoc::Int::Context.new(assigns)
|
23
24
|
|
24
25
|
# Get binding
|
25
26
|
proc = assigns[:content] ? -> { assigns[:content] } : nil
|
data/lib/nanoc/filters/haml.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
|
+
# @api private
|
4
5
|
class Haml < Nanoc::Filter
|
5
6
|
requires 'haml'
|
6
7
|
|
@@ -15,7 +16,7 @@ module Nanoc::Filters
|
|
15
16
|
options = params.merge(filename: filename)
|
16
17
|
|
17
18
|
# Create context
|
18
|
-
context = ::Nanoc::Context.new(assigns)
|
19
|
+
context = ::Nanoc::Int::Context.new(assigns)
|
19
20
|
|
20
21
|
# Get result
|
21
22
|
proc = assigns[:content] ? -> { assigns[:content] } : nil
|