diff --git a/hyde/ext/plugins/css.py b/hyde/ext/plugins/css.py index 7f5db10..4913a31 100644 --- a/hyde/ext/plugins/css.py +++ b/hyde/ext/plugins/css.py @@ -10,6 +10,10 @@ import subprocess from fswrap import File +# +# Less CSS +# + class LessCSSPlugin(CLTransformer): """ The plugin class for less css @@ -113,6 +117,10 @@ class LessCSSPlugin(CLTransformer): return target.read_all() +# +# Stylus CSS +# + class StylusPlugin(CLTransformer): """ The plugin class for stylus css diff --git a/hyde/ext/plugins/images.py b/hyde/ext/plugins/images.py index 23a0443..b947b42 100644 --- a/hyde/ext/plugins/images.py +++ b/hyde/ext/plugins/images.py @@ -33,6 +33,11 @@ class PILPlugin(Plugin): self.Image = Image +# +# Image sizer +# + + class ImageSizerPlugin(PILPlugin): """ Each HTML page is modified to add width and height for images if @@ -199,6 +204,9 @@ def thumb_scale_size(orig_width, orig_height, width, height): return width, height +# +# Image Thumbnails +# class ImageThumbnailsPlugin(PILPlugin): """ @@ -353,6 +361,10 @@ class ImageThumbnailsPlugin(PILPlugin): if match_includes(resource.path): self.thumb(resource, dim1, dim2, prefix, crop_type, preserve_orientation) +# +# JPEG Optimization +# + class JPEGOptimPlugin(CLTransformer): """ The plugin class for JPEGOptim @@ -404,6 +416,10 @@ class JPEGOptimPlugin(CLTransformer): self.call_app(args) +# +# PNG Optimization +# + class OptiPNGPlugin(CLTransformer): """ The plugin class for OptiPNG diff --git a/hyde/ext/plugins/js.py b/hyde/ext/plugins/js.py index 00a6537..c23593f 100644 --- a/hyde/ext/plugins/js.py +++ b/hyde/ext/plugins/js.py @@ -7,6 +7,11 @@ from hyde.plugin import CLTransformer from fswrap import File + +# +# Uglify JavaScript +# + class UglifyPlugin(CLTransformer): """ The plugin class for Uglify JS @@ -74,3 +79,4 @@ class UglifyPlugin(CLTransformer): self.call_app(args) out = target.read_all() return out + diff --git a/hyde/ext/plugins/meta.py b/hyde/ext/plugins/meta.py index c6635d6..b99918e 100644 --- a/hyde/ext/plugins/meta.py +++ b/hyde/ext/plugins/meta.py @@ -16,6 +16,10 @@ from hyde.util import add_method, add_property, pairwalk import yaml +# +# Metadata +# + class Metadata(Expando): """ Container class for yaml meta data. @@ -151,6 +155,10 @@ class MetaPlugin(Plugin): return self.__read_resource__(resource, text) +# +# Auto Extend +# + class AutoExtendPlugin(Plugin): """ The plugin class for extending templates using metadata. @@ -200,6 +208,10 @@ class AutoExtendPlugin(Plugin): return text +# +# Tagging +# + class Tag(Expando): """ A simple object that represents a tag. @@ -398,6 +410,10 @@ extends: false self.site.content.add_resource(archive_file) +# +# Sorting +# + def filter_method(item, settings=None): """ Returns true if all the filters in the @@ -515,6 +531,10 @@ class SorterPlugin(Plugin): setattr(next, prev_att, prev) +# +# Grouping +# + Grouper = namedtuple('Grouper', 'group resources') class Group(Expando): diff --git a/hyde/ext/plugins/structure.py b/hyde/ext/plugins/structure.py index 27e0768..41a4fd6 100644 --- a/hyde/ext/plugins/structure.py +++ b/hyde/ext/plugins/structure.py @@ -14,6 +14,11 @@ import os from fnmatch import fnmatch import operator + +# +# Folder Flattening +# + class FlattenerPlugin(Plugin): """ The plugin class for flattening nested folders. @@ -51,6 +56,10 @@ class FlattenerPlugin(Plugin): child.relative_deploy_path = target.path +# +# Combine +# + class CombinePlugin(Plugin): """ To use this combine, the following configuration should be added @@ -176,6 +185,10 @@ class CombinePlugin(Plugin): return "".join([text] + [r.source.read_all() for r in resources]) +# +# Pagination +# + class Page: def __init__(self, posts, number): self.posts = posts diff --git a/hyde/ext/plugins/text.py b/hyde/ext/plugins/text.py index a61123e..8754de4 100644 --- a/hyde/ext/plugins/text.py +++ b/hyde/ext/plugins/text.py @@ -6,6 +6,10 @@ Text processing plugins from hyde.plugin import Plugin,TextyPlugin +# +# Blockdown +# + class BlockdownPlugin(TextyPlugin): """ The plugin class for block text replacement. @@ -46,6 +50,10 @@ class BlockdownPlugin(TextyPlugin): return super(BlockdownPlugin, self).text_to_tag(match, start) +# +# Mark Text +# + class MarkingsPlugin(TextyPlugin): """ The plugin class for mark text replacement. @@ -86,6 +94,10 @@ class MarkingsPlugin(TextyPlugin): return super(MarkingsPlugin, self).text_to_tag(match, start) +# +# Reference Text +# + class ReferencePlugin(TextyPlugin): """ The plugin class for reference text replacement. @@ -126,6 +138,10 @@ class ReferencePlugin(TextyPlugin): return self.template.get_open_tag(self.tag_name, params) +# +# Syntax Text +# + class SyntextPlugin(TextyPlugin): """ The plugin class for syntax text replacement. @@ -178,9 +194,13 @@ class SyntextPlugin(TextyPlugin): return super(SyntextPlugin, self).text_to_tag(match, start) +# +# Text Links +# + class TextlinksPlugin(Plugin): """ - The plugin class for syntax text replacement. + The plugin class for text link replacement. """ def __init__(self, site): super(TextlinksPlugin, self).__init__(site) diff --git a/hyde/ext/plugins/vcs.py b/hyde/ext/plugins/vcs.py index 65ec951..1a8997e 100644 --- a/hyde/ext/plugins/vcs.py +++ b/hyde/ext/plugins/vcs.py @@ -10,6 +10,11 @@ from dateutil.parser import parse import os.path import subprocess + +# +# Git Dates +# + class GitDatesPlugin(Plugin): """ Extract creation and last modification date from git and include