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