Built-in Scopes

HTML-tag Scopes:

  • Most of the standard HTML tags have pre-defined scope definitions in HFL.
  • Each HTML tag of the form <xx> is referenced by a scope of the form xx { ... }
  • For example:
    • <body> ... </body>
  • would be referenced in HFL code by:
    • body { ... }

Built-in Scopes:

  • In addition to the standard HTML tags, HFL also has the following pre-defined scope types as a convenience to help identify common and useful structure elements.
  • The HTML scopes below match HTML elements of the same name. For example:
    • body_content { ... }
  • would match:
    • <body_content> ... </body_content>
  • Those scopes below that are either separator-based or pattern-based are found by matching text patterns within the HFL source, and do not have corresponding HTML tags.
  • Unless otherwise marked, all of the other scopes below refer to HTML tags.
  • this_scope
    Refers to the current scope range. This is useful when
    it is necessary to apply an operation to the scope itself,
    such as a cut in:
     
    cut { this_scope }
     
    NOTE: This scope is not an HTML tag
     
    align_content
    A standardized tag for content being aligned.
     
    'Standardized' tags are normal HTML tags that are
    provided to encourage standarization of tag names.
     
    body_content
    A standardized tag for main content in <body> section
     
    cell
    Matches any cell within parent scope
     
    col
    A <div> that represents a column in a tabular format
     
    col-ws
    A separator-based scope that parses the parent scope
    into <col> cells using tabs and spaces as separators
     
    comment
    Creates an HTML comment that will be output to page.
     
    NOTE: This scope is not an HTML tag
     
    div-nl
    A separator-based scope that parses the parent scope
    into <div> cells using '\n' as the separator
     
    div-nlnl
    A separator-based scope that parses the parent scope
    into <div> cells using '\n\n' as the separator
     
    div-nl-d
    A separator-based scope that parses the parent scope
    into <div> cells using '\n---\n' as the separator
     
    div_txt
    Marks a scope that behaves like a <div> but generates no HTML
    tag on output
     
    div_txt-nl
    A separator-based scope that parses the parent scope
    into <div_txt> cells using '\n' as the separator
     
    div_txt-nlnl
    A separator-based scope that parses the parent scope
    into <div_txt> cells using '\n\n' as the separator
     
    div_txt-nl-d
    A separator-based scope that parses the parent scope
    into <div_txt> cells using '\n---\n' as a separator
     
    e
    A standardized span tag, used to mark text for emphasis.
     
    img_link
    An unpaired tag that expands to <link>..</link>
    to place links to images in the <head> section
     
    js_link
    An unpaired tag that expands to <script>..</script>
    to place links to javascript scripts in the <head> section
     
    js_post_link
    An unpaired tag that expands to <script>..</script>
    to place links to javascript scripts at end of <body> section
     
    js_syntax
    Creates a code block, parsing text inside of braces as javascript,
    not HFL. Undeclared identifiers are seen as object properties.
     
    lead_in_emphasis
    A pattern-based scope that parses the parent scope for
    lead-in-emphasis characters, e.g. 'Important:'
     
    leading_ws
    A pattern-based scope that parses the parent scope for
    leading whitespace characters, e.g. '
    '
     
    line
    A separator-based scope that parses the parent scope for
    a single line of text between '\n' characters.
     
    line_contents
    A pattern-based scope that parses the parent scope for
    a single line of text excluding '\n'
     
    li-nl
    A separator-based scope that parses the parent scope
    into <li> cells using '\n' as the separator
     
    li-nlnl
    A separator-based scope that parses the parent scope
    into <li> cells using '\n\n' as the separator
     
    list
    A standardized alias name for <ul>, so scope won't match
    random <ul>s
     
    nav_link
    A standardized alias name for <div> for use in nav bars
     
    nav_link-nlnl
    A separator-based scope that parses the parent scope
    into <nav_link> cells using '\n\n' as the separator
     
    nlnl
    A separator-based scope that splits text in the parent
    scope at '\n\n' separators without assigning tags
     
    p-nl
    A separator-based scope that parses the parent scope
    into <p> cells using '\n' as the separator
     
    p-nlnl
    A separator-based scope that parses the parent scope
    into <p> cells using '\n\n' as the separator
     
    php
    Matches any <?php ... ?> tags including the enclosing tag
    characters. Also unfortunately matches <php> ... </php>.
     
    post_script
    Becomes a <script>..</script> tag that places javascript
    scripts at end of <body> section. Often used to speed up
    loading times of pages.
     
    sentence
    A pattern-based scope that parses the parent scope for
    a single sentence up to '.'
     
    td-nl
    A separator-based scope that parses the parent scope
    into <td> cells using '\n' as the separator
     
    td-nlnl
    A separator-based scope that parses the parent scope
    into <td> cells using '\n\n' as the separator
     
    td-tab
    A separator-based scope that parses the parent scope
    into <td> cells using '\t' as the separator
     
    text
    Locates the first child text cell of the current scope, or
    creates one if none present.
     
    text_raw
    Marks scope as 'raw' text: cell is not parsed and internal
    tags are ignored. Everything within tag is loaded as one cell
     
    txt
    Marks cells as just text: generates no HTML tag on output
     
    th-nlnl
    A separator-based scope that parses the parent scope
    into <th> cells using '\n\n' as the separator
     
    tr-nl-d
    A separator-based scope that parses the parent scope
    into <tr> cells using '\n---\n' as the separator
     
    tr-nlnl
    A separator-based scope that parses the parent scope
    into <tr> cells using '\n\n' as the separator
     
    u
    Converts old <U> HTML tag to HTML5 'text-decoration:underline'
     
    word
    A pattern-based scope that parses the parent scope for
    characters valid for a single word or property name

Previous: Advanced Scopes Next: Objects