The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

HTML-Template-Pro TODO.
=======================
1. A few wrappers for languages other then perl and mono
(php, java, maybe high-level C/glib and C++ wrappers)
to prove the API is designed good enough to fit a vast majority of languages.
2. query() support.
3. Parsing of variable contents as well,
allowing truly dynamic template generation.
Example:
$t->register_function( f1 => sub {
return $filename ? "<TMPL_INCLUDE NAME=filename>" :
"some text"} );
Variants of proposed syntax:
<TMPL_INCLUDE_VAR as in HTML-Template-Compiled.
Note, that this change will not require underlying C library API changes
but an extra {malloc()+memcopying}/free() management of the memory area.
(we can't guarantee that this memory area will not be destroyed if it itself has
at least tmpl_var).
4. support of HTML::Template::SET:
<TMPL_SET NAME="name" VALUE="value">
This change will require the change of C library API.
It requires either callback for (add name/value pair to a current scope)
or built-in json-c or libjson
or both, as in case of assignments like
someVAR=someNativeLOOPorOBJECT.
something like scope
-2 for built-in json root
-1 for wrapper-dependent set root
0 for wrapper-dependent param root
note: "associate" magic requires their own roots as well, an array of roots...
5. Modify Bruni extension:
{NAME} -> ${NAME} in Expr
and add compatibility behaviour with ifdefed warning (expr only).
6. add rand and srand.
7. C htmltmplpro incompat C API change:
7.1 add tmplpro_set_expr_as_null
7.2 remove defined funcs from wrappers
7.3 remove lib option case_sensitive
add lib option tmpl_case [names_case? variables_case? variable_names_case?]
add wrapper option param_case [keys_case?]
or better
convert_case_tmpl = TO_UPPER_CASE/TO_LOWER_CASE;
convert_case_param = TO_UPPER_CASE/TO_LOWER_CASE;
and for lib
(even per scope) flags to requiest names with
TMPLPRO_ASK_VARNAME_DEFAULT (==0)
TMPLPRO_ASK_VARNAME_AS_IS (==1)
TMPLPRO_ASK_VARNAME_LOWERCASE 2
TMPLPRO_ASK_VARNAME_UPPERCASE 4
TMPLPRO_ASK_VARNAME_LCFIRST
TMPLPRO_ASK_VARNAME_UCFIRST
add compat wrapper option case_sensitive=0 => [variables_to_lowercase =>1 param_to_lowercase=> 1]
tmplpro_exec_tmpl (struct tmplpro_param *param)
7.4
add Pro::Compat (Compat::Pro??)
1) Compat inherits most of its code from Pro
1) Compat is_a HTML::Template, HTML::Template::Expr.
2) use old param_to_lowercase
3) has default case_sensitive=0
4) has option html_template_strict_mode=1 (enables use of perl _find_file);
7.5
output() in void context:
Pro: now will print to built-in stdout.
Compat: will issue a warning and print to built-in stdout.
7.6
pabstract:
/to implement native perl tainted checks/
add ABSTRACT_DATASTATE* to
get_ABSTRACT_VALUE_functype
ABSTRACT_VALUE2PSTRING_functype
is_ABSTRACT_VALUE_true_functype
ABSTRACT_VALUE2ABSTRACT_ARRAY_functype
get_ABSTRACT_ARRAY_length_functype
get_ABSTRACT_MAP_functype
and replace ABSTRACT_MAP* to ABSTRACT_DATASTATE* in
end_loop_functype
also,
split/rename end_loop_functype into 2 notifiers:
pop/exit_scope_functype (ABSTRACT_DATASTATE*, ABSTRACT_MAP*)
exit_loop_functype (ABSTRACT_DATASTATE*, ABSTRACT_ARRAY*)
or just call exit_loop if scope type=userloop
and call exit_scope_functype if scope type=usermap
7.7
also, to support associate magic,
remove root_hash_map option
and add interface call
int register_root_scope (param, ABSTRACT_DATASTATE*, ABSTRACT_MAP*, int FLAGS (int POS???));
returns the position in scope stack.
and, possibly,
int clear_root_scope (param);
ABSTRACT_MAP* get_root_scope (param, int POS);
TODO: will new interface require
how it will allow to re-register root dict ?
FLAGS can be user-provided SET scope, main root scope, case_transform flags etc.
7.8
remove
select_loop_scope_functype
(mono now uses identifiers)
7.9 remove die_on_bad_param option from lib (wrapper-only option)
7.10 change defaults of global_variables?
also, improve / rewrite walk_through_nested_loops
to explicitly state out scopes used/
add support for set, associate (GLOBAL_SCOPE? flag
that treats multiple scopes as global ones???)
see also scoping in TemplateToolkit
7.11
remove
tmplpro_get_expr_as_string
8. common json testset to be shared between all wrappers
9. Proscope:
add is_scope_writeable flag.
10. rewrite scanner using re2c
11. PSTRING should be const; add non-const MPSTRING