Skip to content

Markers

E. F. Haghish edited this page Jun 7, 2019 · 3 revisions

markdoc also introduces a few handy markers for annotating the document, regardless of the markup language you use to write the document (Markdown, Tex, HTML). These markers can be used to specify what parts of the code should or should not appear in the dynamic document. The table below provides a brief summary of these annotating markers. in general, comments - unless they appear after a command - will be ignored in the dynamic document. However, the markers mentioned below are "special comments" that will influence the markdoc process.

Marker Description
/*** on a separate line; start a documentation block
***/ on a separate line; ends a documentation block
/**/ only include the output in the dynamic document and hide the comment
/***/ only include the command in the dynamic document and hide the output
//OFF Exclude everything that follows from the document
//ON Include everything that follows in the document
//IMPORT filename Appending external text file (Markdown, HTML, LaTeX) to the dynamic document

Examples

Example of writing a documentation block

   /***
   Text heading
   ============
 
   subheading
   ---------- 
 
   When you write a dynamic document in markdoc, place text between
   the "/***" and "***/" signs. But they should be placed on separate lines,
   as shown in this example.
   ***/

Using the //OFF and //ON, you can exclude anything in between. In the example below, none of the commands and outputs will appear in the document, although it will be executed by Stata.

. //OFF
. clear
. sysuse auto
. summarize price
. //ON