You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/guide/author/topics.xml
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3538,7 +3538,7 @@ displayed line, and there are no <c>\\</c>s. Use <c>\amp</c> to mark the alignm
3538
3538
<subsectionxml:id="interactive-program-codelens">
3539
3539
<title>Interactive Programs, CodeLens</title>
3540
3540
3541
-
<p><term>CodeLens</term> is an interactive version of a computer program, which can be visualized by stepping through the code one statement at a time, watching output, variables, and other data structures change. So it is similar to a debugger, except the reader does not set breakpoints or modify program data on-the-fly. This is possible automatically for several different languages when your <init>HTML</init> is hosted on a Runestone server (<xref ref="runestone"/>). This may also be accomplished <q>in browser</q> when hosted on any old generic web server. The catch is that for a generic server a publisher must generate <term>trace data</term> in advance, typically with the PreTeXt-CLI (<xref ref="processing-CLI"/>). Place the <tag>interactive</tag> attribute on a <tag>program</tag> element with the value <c>codelens</c> to elect this behavior (<c>no</c> is the default value). Also, be sure to specify a language from the supported languages: Python, Java, C, and C++. Consult <xref ref="table-program-interactive"/> below for a summary of various combinations. When an output format does not support an interactive CodeLens instance, the fallback is a static program listing. The <tag>program</tag> should have an <attr>xml:id</attr> that will be used as a unique identifier for the generated trace file needed by the codelens.</p>
3541
+
<p><term>CodeLens</term> is an interactive version of a computer program, which can be visualized by stepping through the code one statement at a time, watching output, variables, and other data structures change. So it is similar to a debugger, except the reader does not set breakpoints or modify program data on-the-fly. This is possible automatically for several different languages when your <init>HTML</init> is hosted on a Runestone server (<xref ref="runestone"/>). This may also be accomplished <q>in browser</q> when hosted on any old generic web server. The catch is that for a generic server a publisher must generate <term>trace data</term> in advance, typically with the PreTeXt-CLI (<xref ref="processing-CLI"/>). Place the <tag>interactive</tag> attribute on a <tag>program</tag> element with the value <c>codelens</c> to elect this behavior (<c>no</c> is the default value). Also, be sure to specify a language from the supported languages: Python, Java, C, and C++. Consult <xref ref="table-program-interactive"/> below for a summary of various combinations. When an output format does not support an interactive CodeLens instance, the fallback is a static program listing, possibly with a link to the interactive version (see <xref ref="interactive-program-activecode"/> for how to configure the links). The <tag>program</tag> should have an <attr>xml:id</attr> that will be used as a unique identifier for the generated trace file needed by the codelens.</p>
3542
3542
3543
3543
<p>Sometimes, there is uninteresting setup to get through before the portion of the program the author wants to illustrate. The author can use <attr>starting-step</attr> to specify the instruction number that the interactive should start at. Code before that will be fast-forwarded through and execution will begin at the indicted step. Note that <attr>starting-step</attr> is a <q>Step</q> number in the execution sequence, not a line number in the source code. You may have to run the Codelens once to find the right step to start at.</p>
3544
3544
@@ -3554,7 +3554,9 @@ displayed line, and there are no <c>\\</c>s. Use <c>\amp</c> to mark the alignm
3554
3554
3555
3555
<p><term>ActiveCode</term> is an interactive environment where a reader may work on code through repeated edit-compile-test cycles. Code can be provided by an author as a complete program to be modified, a partial program to be completed, or nothing at all. One good example is that maybe header files, import statement, and similar are provided, and a skeleton of a main entry-point procedure is also provided. Then a reader can concentrate on the more conceptual parts of the programming. Some languages will be executable <q>in browser</q> on any old generic web server, while others must be on a Runestone server (<xrefref="runestone"/>) where a <urlhref="https://github.com/trampgeek/jobe"visual="github.com/trampgeek/jobe">Jobe Server</url> is running to support the execution.</p>
3556
3556
3557
-
<p>Place the <attr>interactive</attr> attribute on a <tag>program</tag> element with the value <c>activecode</c> to elect this behavior (<c>no</c> is the default value). Also, be sure to specify a language from the supported languages. Consult <xrefref="table-program-interactive"/> below for a summary of various combinations. When an output format does not support an interactive ActiveCode instance, the fallback is a static program listing.</p>
3557
+
<p>Place the <attr>interactive</attr> attribute on a <tag>program</tag> element with the value <c>activecode</c> to elect this behavior (<c>no</c> is the default value). Also, be sure to specify a language from the supported languages. Consult <xrefref="table-program-interactive"/> below for a summary of various combinations.</p>
3558
+
3559
+
<p>When an output format does not support an interactive ActiveCode instance, the fallback is a static program listing. The static listing is possibly supplemented with a link and QR code to access an HTML version. To get these links, you must specify a base <init>URL</init> (see <xrefref="online-baseurl"/>). If you have a base <init>URL</init> and want to disable the QR codes, you can set the <attr>static-qrcodes</attr> attribute to no <c>"no"</c> in the publisher variable <c>common/program</c>.</p>
0 commit comments