dskinner / damsel-python Goto Github PK
View Code? Open in Web Editor NEWMarkup Language featuring html outlining via css-selectors, embedded python, and extensibility.
License: MIT License
Markup Language featuring html outlining via css-selectors, embedded python, and extensibility.
License: MIT License
a variable on a line by itself doesn't work
Explicit for loops with complex mixed content fails though there are various workarounds depending on complexity, such as using list comprehensions
Great templating language! I just miss it in Py3k.
when all else is missing (text, string formatters), reference py_formatter.daml in tests
Should check line directive before invoking python on this bit.
since attributes follow the css attribute selector style, all attributes must follow id and class hashes, which i find to be more readable but could be setup for mixed ordering.
The following will fail
%p :str(len([1,2,3]))
as py_parse doesn't keep track of how many parenthesis were opened.
allow include path to be relative to file, so maybe like include("./this.dmsl")
:include that does basic conditional and in main template is followed by a block, fails. This might not be an issue in trunk.
When document has multiline plain text at end of document, it will get dropped. This is avoidable currently just by sticking a blank element below the multiline text
curly braces get recognized as a formatter before a dict in statements such as for. This should never happen, ever, total goof
Make the first non-whitespace character '/' at the beginning of a line indicate that the line is a comment.
Considering the rendering code dmsl.Template('index.dmsl').render(hello="World")
The following crashes in a template: %p Hello, { hello }
Where %p Hello, {hello}
does not.
The whitespace here shouldn't matter to the parser. Also, the PEP-8 states that variables enclosed in dictionaries and tuples should have a space on both ends.
PEP-8 approves: a = { 'foo' : 'bar' }
and discourages a = {'foo':'bar'}
making this restriction feel unnatural.
if i have an unordered list and the first two items are conditional, they will end up at end of list, content thats at the top will end up at the bottom, etc
daml on a whole could use much better error reporting with template problems, warnings, etc
$ python setup.py build_ext -i
running build_ext
cythoning dmsl/cdoc.pyx to dmsl/cdoc.c
building 'dmsl.cdoc' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/dmsl
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c dmsl/cdoc.c -o build/temp.linux-x86_64-2.7/dmsl/cdoc.o
dmsl/cdoc.c:8:22: error fatal: pyconfig.h: No existe el fichero o el directorio
compilación terminada.
error: command 'gcc' failed with exit status 1
Dmsl generates some nastily formatted HTML output. Sensible newlines would be nice.
From the template:
%html
%head
%title Headshots Backend API Manager
%body
%h2 Overview
%p This is the webservice to manage images stored within S3.
%h2 Submit a New Thumbnail Request
%form[action="/create"][method="post"]
%label[for="create_form_url"] Url
%input[id="create_form_url"][type="text"][name="url"]
%input[id="create_form_submit"][type="submit"][name="submit"]
DMSL generates:
<!DOCTYPE html><html><head><title>Headshots Backend API Manager</title></head><body><h2>Overview</h2><p>This is the webserive to manage images stored within S3.</p><h2>Submit a New Thumbnail Request</h2><form action="/create" method="post"><label for="create_form_url">Url</label><input id="create_form_url" type="text" name="url"></input><input id="create_form_submit" type="submit" name="submit"></input></form></body></html>
I would like for it to generate:
<!DOCTYPE html>
<html>
<head>
<title>Headshots Backend API Manager</title>
</head>
<body>
<h2>Overview</h2>
<p>This is the webserive to manage images stored within S3.</p>
<h2>Submit a New Thumbnail Request</h2>
<form action="/create" method="post">
<label for="create_form_url">Url</label>
<input id="create_form_url" type="text" name="url"></input>
<input id="create_form_submit" type="submit" name="submit"></input>
</form>
</body>
</html>
having a filter after a taghash competes with current functionality in _pre for embedded functions following a taghash
Im pretty sure anyways, and mixed tabs/spaces definitely dont. This should be easily rectifiable since python has string.expandtabs
dmsl files with only python fail
includes are currently handled in _pre.py and not in the sandbox environment, preventing dynamic use in templates
it might be helpful to be able to pass an arg to builtin include that specifies which top-level blocks to include, ignoring the rest.
This stems from noticing a need to abstract out certain reusable blocks into seperate files for reuse in many places, but the creation of so many files with little bits of information creates confusion. Typically, it seems there is a particular page that outlines the majority of these blocks for use there, and reuse elsewhere. Workflow might be simplified with this addition as well as keeping the original work contained in its more intended usage, and removing the file cruft.
Awesome job with this.
If you include the character ':' after some text in a label tag dmsl crashes.
%label[for="someid"] Url
is okay but
%label[for="someid"] Url:
causes dmsl to throw the error => IndexError('list index out of range',)
cherrypy.lib.sessions.expire()
raise cherrypy.HTTPRedirect('/')
reference py_mixed_content.daml in tests
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.