Source

poole / poole.py

Author Commit Message Labels Comments Date
Oben Sonne
Undo [e529749635df] (Py3 hack)
Oben Sonne
More compact abort messages
Grahack
Use shutil.copyfile only if needed.
Oben Sonne
Update copyright notice
Oben Sonne
Merge pull request #7 from Grahack/typos One letter typos in poole.py and README.md.
Grahack
oiptions -> options
Grahack
One letter typos in poole.py and README.md.
Grahack
Typo 201010 -> 2010.
Oben Sonne
Allow creation of virtual pages Now pre-convert-hooks may create virtual pages which have no markdown source file but will end up as HTML files. Hooks in the macros module may create them like: vp = Page('foo.md', virtual="""... page source content ...""") pages.append(vp) If the file name contains path elements which are not shared with real pages, make sure you also create them in the output folder -- Poole only crea…
Oben Sonne
Python 2/3 hack for the exec statement/function See http://docs.python.org/release/3.0.1/whatsnew/3.0.html for changes with regard to `exec`. The problem here is that we cannot use the function syntax in Poole already for Python 2.x since we need a qualified exec, and thus we need the `in` syntax which causes a syntax error in Py3. This workaround uses `execfile` in Py2 (which, as a function, does not cause syntax errors in Py3) and the `exec`…
Oben Sonne
Minor import cleanup
Oben Sonne
Support custom converters in the macros module It is now possible to define custom converters in the macros module (e.g. for SCSS or LESS files). Converters must be defined using a dictionary named 'converter' with file name patterns as keys and a converter funcion as well as a target file name extension as values. Example: converter = { r'\.less': (less_to_css, 'css'), ... } The converter function `less_to_css` must …
Oben Sonne
Use more sane __getattr__ instead of __getattribute__ in Page class
Oben Sonne
More compact code (minor) Anyone sees a problem on readability here?
Comments 2
matthijs
Use htmlspecialchars in the default template
matthijs
Add 'htmlspecialchars' as a "builtin" macro This allows templates and other code to perform html escaping of strings where needed. This implements the escaping from scratch, since there is no useful function for it built into python (there are some modules, but they either require newer python version or don't escape "). The name 'htmlspecialchars' was borrowed from PHP, since this function implements the same behaviour.
matthijs
Restructure macros.py handling This makes the code a bit simpler and allows poole to preset functions in the macros module (unlike the previous "class nomod" approach, which caused a function to be treated as an unbound method).
Paolo Dina
Improved the script's shebang
Oben Sonne
Introduce pre- and post-convert hooks A project's `macros.py` may define several pre- and post-convert hooks using function starting with `hook_{pre|post}convert_`. Pre-convert hooks are run before any page is processed and converted. Post-convert hooks are run after page sources has been converted from markdwon to HTML. This deprecates `once_`-functions in a projects `macros.py`. These functions should be renamed to start with `hook…
Oben Sonne
Whitespace cleanup
Oben Sonne
Simplify regular expressions
Oben Sonne
Minor DRY changes
Oben Sonne
Fix line-break detection to work on Windows For details see issue 1, which is fixed by this commit.
Oben Sonne
Better handling of page variable with non-ASCII characters This fixes some problems related to the reference of page variables with non-ASCII characters. Any page variable defined within a page or derived from a page's file name is now handled as unicode. See the updated README for details.
Oben Sonne
Fix ignore pattern handling Ignore patterns containing directory separators did not work until now. This patch fixes this.
Oben Sonne
Sort pages before processing If a page has the 'sval' attribute set, it is used to sort the list of pages before replacing inlined Python code in page source files. The default value for 'sval' is 0. The sorting is useful when a page should get processed before or after antother one, e.g. when inline Python code updates the attributes of a page one usually reuses them in another page and that page should get processed later.
Oben Sonne
Run once-functions ordered
Oben Sonne
Add support for markdown extensions
Oben Sonne
Only convert to unicode on demand
Oben Sonne
Accept \r\n as line breaks in embedded Python code
  1. Prev
  2. 1
  3. 2
  4. 3
  5. 4
  6. 5
  7. Next