commit 74d1052127cd5f4e4053b1711f639526505c1cb1 Author: L3D Date: Sun Feb 5 01:10:09 2023 +0100 initialize git repo diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..463960b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +dist +build +*.pyc +*.pyo +*.egg-info diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6421dd4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 L3D + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d643263 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# lektor_render_template + +This is where a description of your plugin goes. +Provide usage instructions here. + +## Work in progress! diff --git a/lektor_render_template.py b/lektor_render_template.py new file mode 100644 index 0000000..a28c79d --- /dev/null +++ b/lektor_render_template.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +from lektor.pluginsystem import Plugin + + +class RenderTemplatePlugin(Plugin): + name = 'lektor_render_template' + description = u'Add your description here.' + + def on_process_template_context(self, context, **extra): + def test_function(): + return 'Value from plugin %s' % self.name + context['test_function'] = test_function diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..3c6e79c --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..95e349a --- /dev/null +++ b/setup.py @@ -0,0 +1,38 @@ +import ast +import io +import re + +from setuptools import setup, find_packages + +with io.open('README.md', 'rt', encoding="utf8") as f: + readme = f.read() + +_description_re = re.compile(r'description\s+=\s+(?P.*)') + +with open('lektor_render_template.py', 'rb') as f: + description = str(ast.literal_eval(_description_re.search( + f.read().decode('utf-8')).group(1))) + +setup( + author='l3d', + author_email='l3d@c3woc.de', + description=description, + keywords='Lektor plugin', + license='MIT', + long_description=readme, + long_description_content_type='text/markdown', + name='lektor-render-template', + packages=find_packages(), + py_modules=['lektor_render_template'], + # url='[link to your repository]', + version='0.1', + classifiers=[ + 'Framework :: Lektor', + 'Environment :: Plugins', + ], + entry_points={ + 'lektor.plugins': [ + 'render-template = lektor_render_template:RenderTemplatePlugin', + ] + } +)