主权项 |
1. A computer-implemented method for displaying an HTML document in a server-less environment, comprising:
accessing templates included in template files stored in a disk directory of a client, the templates including custom attributes associated with the templates, wherein the custom attributes indicate template processing instructions specific to each of the custom attributes that generate the HTML document and process input data; generating a DOM structure having a plurality of nodes, the DOM structure including content in the template files; for each node in the plurality of nodes:
identifying the node in the plurality of nodes that includes a custom attribute associated with a template from one of the template files;evaluating the custom attribute using the template processing instructions specific to the custom attribute, including retrieving the input data from a location in the server-less environment separate from the template file, and generating a custom attribute result using the retrieved input data and the template processing instructions;generating an expression, the expression containing the custom attribute result; andinserting the expression into the DOM structure in place of the custom attribute; and rendering the HTML document from the expressions in the plurality of nodes in the DOM structure on a display screen of the client. |