Interpretive mode

limitations

Interpretive mode is not intended primarily as a distribution platform!

(Rather: development on a single machine)

Nevertheless, Triv's Web Workshop is distributed as an application entirely implemented with interpretive mode, and including support for reconciled mode.

Browser support for interpretive mode varies!

Interpretive mode is an operating mode of the Javascript implementation of Triv.

A more limited, reconciled mode, is engaged when a browser has no support.
The correctness of a document not verified for reconciled mode is not guaranteed.

Browser policy

Firefox

  • Interpretive mode
    • Nearly always
  • Reconciled mode
    • (Rare scenario)  The document is opened from a web server not abiding by the REST protocol pattern

Chrome

* and other WebKit-based browsers

  • Interpretive mode
    • Always if the document is opened from a web server
  • Reconciled mode
    • Always if the document is opened by double-clicking and includes any of the:
      <, >, or & characters

      (Including as text content, the toggle for single-line comment syntax, etc.)

Limitations

Interpretive mode

The only major limitation of interpretive mode is:

  • Any text formatted like a native script element to the browser should be avoided.

    (Even in a literal or comment!)

    Any script intended to run should only be included with element statement syntax.

    (i.e. Not <script>, but script:)

Reconciled mode

During loading of interpretive mode, a re-request of the document is performed to retrieve the source code unmodified by browser rendering. The re-request is expected to complete.

Otherwise, the program attempts reconciled mode.

The major limitation of reconciled mode is that the browser's version of the HTML is difficult to predict.

Spacing around angle brackets seems to determine whether the character is transformed into a character reference or is retained as a portion of an element.

Reconciled mode attempts to reconcile common changes made on-the-fly by the browser, by transforming every &amp; / &lt; / &gt; to & / < / > before compiling.

Specific limitations to keep in mind:

  • Native convenience elements are not possible

    (The browser seems to always remove </>)

  • The text: </script> interrupts any inline scripts

    (Even in a script literal or script comment!)

Options...

Rendering mode

The browser's standards compliance rendering mode is possible with interpretive mode.

Format of file

A document intended for interpretive mode:

<script>"interpretive"</script>
<script src="https://triv.co/3v.js"></script>

api-version=0.50.0
===

p: The rest of the document...

Doctype

Include a doctype, i.e. <!doctype html>, with the browser instruction for standards compliance.

More: Documentation for standards compliance

Styling during processing

Include a styling element after declaring but before invoking interpretive mode.

<script>"interpretive"</script>
<style>body {display: none}</style>
<script src="https://triv.co/3v.js"></script>

Versions

The latest release is always available at:

https://triv.co/3v.js

If the implementation reaches 1.0 without support for previous API versions,
the current version series (0.x.x) will stay available at:

https://triv.co/3v-0.js

Minified versions are available: https://triv.co/3v.min.js