4 ms·
I like the general structure of what you have created but I will offer up one small thought. I grabbed the sample code from your blog page and did a rough char
by 51Cards 16y ago
I like the general structure of what you have created but I will offer up one small thought. I grabbed the sample code from your blog page and did a rough character count excluding indenting. You have 444 characters of template to generate 270 characters of output HTML. I know this generalization of course doesn't encompass all the other advantages of templating documents but I would give a thought to improving the compactness of the syntax.
- ljlolel 16y agoPlease note that the docs are completely static. Because they are static, I could have generated these docs by just writing a function that returned the whole html string, which would be a small constant overhead. The only reason I used Weby Templates is to show off the features. In a normal programmatic setting, you would have significant if/else constructs and looping. These templates would be significantly shorter than hard-coded HTML, and still shorter than the popular Jinja, Django, and ERB templates because 1. they close tags for you in a Pythonic way. 2. it is trivial to create functions and filters to do repetitive tasks for you, whereas they can be difficult, hard to locate, or a pain to do with the others.