Git Product home page Git Product logo

pygreen's Introduction

PyGreen

Build Status PyPI

A micro web framework/static web site generator.

PyGreen is a simple tool to generate small web sites. The concept is to put all files to serve in a folder and invoke the Mako template engine on all .html files. The result is quite similar to a classic PHP application, but with the good features of the Mako templates (like inheritance) and the cool syntax of Python.

See the documentation here.

License

See the license file.

Contribution

See the contribution guide.

pygreen's People

Contributors

aidanhs avatar fvdsn avatar jollyra avatar nicolas-van avatar timgates42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pygreen's Issues

markdown formatting error

pygreen renders

<%block filter="markdown">
Look at my title
================
</%block>

as

<pre>
    <code>
        Look at my title
        ================
    </code>
</pre>

A few suggestions: adding more context to rendering

First of all thanks for this amazing tool. It is simple and elegant, I love it.

Not really an issue but a suggestion, I am exploring the following small extensions to pass more context into the templates. For example the list of all files as pygreen.files attribute will be available in the template, this helps with designing navigation bars and table of contents.

The other is to allow optional importing of a settings module that may be placed in the folder. This is optional and again is to expose whatever more complex functionality one might want inside a template via the pygreen.settings.

Finally I am adding a series of demo sites, mostly as helper/cookbook, to remind myself how things are supposed to work.

The full change is here: https://github.com/ialbert/pygreen/commit/ba6c69e8b055dd933999730f9c13b4d6541755ea

below are just the relevant changes, and thanks again for this superfun mini blog generator:

@property
def settings(self):
    m = __import__('settings', globals(), locals(), [], -1)
    reload(m)
    return m

@property
def files(self):
    """
    Collects all files that will be parsed. Will also be available in main context.
    """
    files = []
    for l in self.file_listers:
        files += l()
    return files

Missing waitress module

Hi,

Am trying out pygreen. Trying to run pygreen with any option results in the following error message:

Traceback (most recent call last):
  File "/Users/lemon/.virtualenvs/pygreen/bin/pygreen", line 5, in <module>
    pkg_resources.run_script('pygreen==2.0.0-beta.2', 'pygreen')
  File "/Users/lemon/.virtualenvs/pygreen/lib/python2.7/site-packages/pkg_resources.py", line 540, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/lemon/.virtualenvs/pygreen/lib/python2.7/site-packages/pkg_resources.py", line 1462, in run_script
    exec_(script_code, namespace, namespace)
  File "/Users/lemon/.virtualenvs/pygreen/lib/python2.7/site-packages/pkg_resources.py", line 41, in exec_
    exec("""exec code in globs, locs""")
  File "<string>", line 1, in <module>
  File "/Users/lemon/.virtualenvs/pygreen/lib/python2.7/site-packages/pygreen-2.0.0_beta.2-py2.7.egg/EGG-INFO/scripts/pygreen", line 3, in <module>
    __requires__ = 'pygreen==2.0.0-beta.2'
  File "build/bdist.macosx-10.9-x86_64/egg/pygreen.py", line 39, in <module>
ImportError: No module named waitress

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.