Section "browser"

The Dogelog player version that targets JavaScript can be run inside a browser and from with-in nodeJS. When run inside the browser the Dogelog player keeps track of a cursor that points to a DOM element. This is for example currently used in the markup library but can be also directly accessed through the native API.

Our original idea was to replicate Knuth’s idea of literate programming for the web. Diverting slightly from the batch processing approach, we view HTML pages with a simple Prolog code embedding as pre-elements as the primary source. We provide plain and colorized notebook instrumentation via calling notebook() respectively notebook_async().

The following browser specific calls are provided:

set_caret(C): (host language)
Sets the input data field to the DOM element C.
set_cursor(C): (host language)
Sets the output and error data field to the DOM element C.
notebook(): (host language)
Setup the Prolog interpreter and run the notebook plain.
notebook_async(): (host language)
Setup the Prolog interpreter and run the notebook colorized.

Kommentare