1. A method comprising operating a computer system to perform steps of: receiving a document having: markup language constructs comprising a plurality of tags in a first section of the document comprising a first plurality of lines of code; and a plurality of function declarations in a second section of the document separate from the first section of the document and comprising a second plurality of lines of code, the plurality of function declarations comprising the second plurality of lines of code, which define a plurality of corresponding functions, wherein one or more of the function declarations correspond to tags in the first section and have function names the same as tag names of the corresponding tags; and performing a step of tag processing on a first tag among the plurality of tags in the markup language constructs, including: executing a body of the first tag and producing tag output; and subsequent to executing the body of the first tag, invoking a first function, declared among the plurality of function declarations, having a function name that is the same as a tag name of the first tag, and during invocation of the first function accessing the tag output produced as a result of executing the body of the first tag.