@@ -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 | |||
@@ -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 | |||
@@ -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 | |||
@@ -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): | |||
@@ -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 | |||
@@ -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) | |||
@@ -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 | |||