144 lines
2.8 KiB
Markdown
144 lines
2.8 KiB
Markdown
# Tags
|
|
|
|
- [x] autoescape
|
|
- [x] block
|
|
- [x] comment
|
|
- [x] csrf_token
|
|
- [x] cycle
|
|
- [x] debug
|
|
- [x] extends
|
|
- [x] filter
|
|
- [x] firstof
|
|
- [x] for
|
|
- [x] if
|
|
- [x] ifchanged
|
|
- [x] include
|
|
- [x] load
|
|
- [x] lorem
|
|
- [x] now
|
|
- [x] partial
|
|
- [x] partialdef
|
|
- [x] querystring
|
|
- [x] regroup
|
|
- [x] resetcycle
|
|
- [x] spaceless
|
|
- [x] templatetag
|
|
- [x] url
|
|
- [x] verbatim
|
|
- [x] widthratio
|
|
- [x] with
|
|
|
|
|
|
# Filters
|
|
|
|
- [x] add
|
|
- [x] addslashes
|
|
- [x] capfirst
|
|
- [x] center
|
|
- [x] cut
|
|
- [ ] date
|
|
- [x] default
|
|
- [x] default_if_none
|
|
- [x] dictsort
|
|
- [x] dictsortreversed
|
|
- [x] divisibleby
|
|
- [x] escape
|
|
- [x] escapejs
|
|
- [x] escapeseq
|
|
- [x] filesizeformat
|
|
- [x] first
|
|
- [x] floatformat
|
|
- [x] force_escape
|
|
- [x] get_digit
|
|
- [x] iriencode
|
|
- [x] join
|
|
- [x] json_script
|
|
- [x] last
|
|
- [x] length
|
|
- [x] linebreaks
|
|
- [x] linebreaksbr
|
|
- [x] linenumbers
|
|
- [x] ljust
|
|
- [x] lower
|
|
- [x] make_list
|
|
- [x] phone2numeric
|
|
- [x] pluralize
|
|
- [x] pprint
|
|
- [x] random
|
|
- [x] rjust
|
|
- [x] safe
|
|
- [x] safeseq
|
|
- [x] slice
|
|
- [x] slugify
|
|
- [x] stringformat
|
|
- [x] striptags
|
|
- [ ] time
|
|
- [ ] timesince
|
|
- [ ] timeuntil
|
|
- [x] title
|
|
- [x] truncatechars
|
|
- [-] truncatechars_html
|
|
- [x] truncatewords
|
|
- [-] truncatewords_html
|
|
- [x] unordered_list
|
|
- [x] upper
|
|
- [x] urlencode
|
|
- [x] urlize
|
|
- [x] urlizetrunc
|
|
- [x] wordcount
|
|
- [x] wordwrap
|
|
- [x] yesno
|
|
|
|
___
|
|
|
|
## Doing
|
|
|
|
- [x] filter — super útil (ex.: {{ var|upper }})
|
|
- [x] autoescape — segurança importante
|
|
- [x] spaceless — remove espaços em branco
|
|
- [x] verbatim — como raw
|
|
- [x] url — reverse de URLs (quando tiver routing)
|
|
- [x] cycle — alternar valores em loop
|
|
- [x] firstof — fallback de variáveis
|
|
- [x] load — para custom tags/filters (futuro)
|
|
- [x] csrf_token — quando tiver web
|
|
|
|
---
|
|
|
|
## To do
|
|
|
|
1 - Finalizar o parser — completar as tags que faltam da lista:
|
|
- [x] debug
|
|
- [x] lorem
|
|
- [x] partial / partialdef
|
|
- [x] querystring
|
|
- [x] regroup
|
|
- [x] resetcycle
|
|
- [x] templatetag
|
|
- [x] widthratio
|
|
|
|
2 - projetar o Context com calma:
|
|
- Estrutura hierárquica (escopos aninhados para with, for, etc.)
|
|
- Suporte a variáveis, listas, structs (models)
|
|
- Acesso por ponto (obj.atributo, lista.0, etc.)
|
|
- Fallback silencioso ou erro (como no Django)
|
|
|
|
3 - Renderer — com:
|
|
- Resolução de variáveis
|
|
- Aplicação de filtros
|
|
- Herança com block.super
|
|
- Loops com forloop
|
|
- Tudo testado
|
|
|
|
|
|
- Renderer básico — variáveis simples {{ nome }} (já quase pronto acima)
|
|
- Filtros em variáveis — {{ nome|upper }}, {{ idade|add:5 }}
|
|
- Escaping automático — tudo escapa por default, {{ valor|safe }} não escapa
|
|
- Tags básicas — {% if %}, {% for %}, {% block %}
|
|
- Extends / include
|
|
- Autoescape on/off
|
|
|
|
- Adicionar suporte a argumentos nos filtros (já quase pronto — parsear name:arg)
|
|
- Implementar tags básicas (if/for) usando a árvore do parser
|
|
- Autoescape completo (escape só em .string, e tratar .safe se quiser)
|
|
- Blocos e extends (usando a árvore para coletar blocos e renderizar base)
|