Giter Club home page Giter Club logo

reinhardt's People

Contributors

botic avatar grob avatar oberhamsi avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

reinhardt's Issues

filters not unicode safe

  • strings.capfirst, strings.lower, strings.upper - These do not take care of locale-sensitive character capitalization rules for Turkish, Serbian, Croatian, etc.
  • strings.truncatechars - This is not sensitive to Unicode surrogate characters or combining characters, and therefore may truncate in the middle of a character. This is particularly troublesome in writing systems that rely heavily on combining characters such as Thai or most of the Indic writing systems like Devanagari, Kannada, Tamil, etc.

improve configuration

configuring a template loader is very verbose and akward (see example) and adding custom filters/tags per "project" is impossible.

investigate how jinj2 "Envinronments" solve this problem: http://jinja.pocoo.org/docs/api/#jinja2.Environment

they too are standalone and can't rely on "settings.py" and a project folder, like django does.

rename all filters lowercamelCase

currently it's a mess of lowercamelCase under_score and sometimes just words bashed together ("capfirst").

i think we should go all camelCase before 1.0

support easier creation of tags with tag helper functions

django has three functions: simpleTag, assignmentTag and inclusionTag, which take a function as an argument, which they use to create a complete Tag class. Basically those three functions relieve you subclassing the Tag class for specific but common use cases. you only need to write the render function and all the rest - parameter parsing, variable resolving with filter support as well as all interaction with the template parser - is handled automatically.

the three use cases support by django are:

I have implemented the SimpleTag and - I think - all helpers required to
implement the other Tags.

unit tests in my branch:
https://github.com/oberhamsi/reinhardt/blob/tag-filter-helpers/test/library/tags.js

A problem I noticed is that in JavaScript we can't support an indefinite number of arguments because I can't detect rest parameters in the function signature yet https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/rest_parameters This means we have to think of a different way to support an unknown number of arguments. Just parsing the function signature isn't going to get us there.

various i18n problems

  • dates and date/time formatting does not use locale-sensitive formats, although it does allow custom date format templates if you happen to know the right template for each and every locale your app needs to support.
  • arrays.sortByKey - only sorts with English rules
  • logic.yesno - defaults to English stringscapitalization rules for Turkish, Serbian, Croatian, etc.
  • strings.title - Only uses English title case rules for deciding which words to capitalize, and does it not do locale-sensitive upper-casing
  • strings.floatformat - Only formats numbers with English conventions
  • strings.ljust - Only left-justifies strings, which might not work correctly in right-to-left languages like Arabic or Hebrew
  • strings.truncatewords, strings.wordcount, strings.wordwrap - Does not work correctly in languages that are not written with whitespaces between every word, such as Chinese, Japanese, or Thai.

port from django - collection bug

this bug collects all commits we should/could port from django

as of 14/3:

improve {% include %} .. support recursion among other things
django/django@e2f0622

widthratio: Inf/Nan
django/django@07ae47f

widthratio: allow "as" param
django/django@ff41056

Fix #20745: Don't silence TypeError raised inside templates.
django/django@28a5713

simplify filterExpression.args_check
django/django@7c6f2dd

Fixed #7557 -- Added type checking to Variable initialization.
django/django@7fec5a2

cache missing templates
django/django@b785a80

date filter doesn't handle java.util.Date

Some applications (like on Google App Engine) have to use java.util.Date to store dates. At the moment the following code will not work without a prior conversion of story.created into a JavaScript Date object:

{{ story.created | date:"dd.MM.yyyy" }}

investigate need for RequestContext

a RequestContext takes the request as the first argument and automatically populates the Context with a few variables according to the TEMPLATE_CONTEXT_PROCESSORS

this is how they get things like user, permissions, mediaUrl/staticUrl, messages and csrf protection into their templates.

see:

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.