size: 2 KiB
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 | <html> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 6 | <title>Reference</title> |
| 7 | <link rel="stylesheet" href="../ldoc.css" type="text/css" /> |
| 8 | </head> |
| 9 | <body> |
| 10 | |
| 11 | <div id="container"> |
| 12 | |
| 13 | <div id="product"> |
| 14 | <div id="product_logo"></div> |
| 15 | <div id="product_name"><big><b></b></big></div> |
| 16 | <div id="product_description"></div> |
| 17 | </div> <!-- id="product" --> |
| 18 | |
| 19 | <div id="main"> |
| 20 | |
| 21 | |
| 22 | <!-- Menu --> |
| 23 | |
| 24 | |
| 25 | |
| 26 | <div id="navigation"> |
| 27 | <h1>djot</h1> |
| 28 | <ul> |
| 29 | <li><a href="../index.html">Index</a></li> |
| 30 | </ul> |
| 31 | |
| 32 | <hr/> |
| 33 | <ul> |
| 34 | <li><a href="#new_node">new_node (tag)</a></li> |
| 35 | <li><a href="#add_child">add_child (node, child)</a></li> |
| 36 | <li><a href="#has_children">has_children (node)</a></li> |
| 37 | <li><a href="#new_attributes">new_attributes (tbl)</a></li> |
| 38 | <li><a href="#insert_attribute">insert_attribute (attr, key, val)</a></li> |
| 39 | <li><a href="#copy_attributes">copy_attributes (target, source)</a></li> |
| 40 | <li><a href="#to_ast">to_ast (parser, sourcepos)</a></li> |
| 41 | <li><a href="#render">render (doc, handle)</a></li> |
| 42 | </ul> |
| 43 | |
| 44 | </div> |
| 45 | |
| 46 | <div id="content"> |
| 47 | |
| 48 | |
| 49 | <h1>Module <code>djot.ast</code></h1> |
| 50 | |
| 51 | <p> |
| 52 | |
| 53 | </p> |
| 54 | <p> Construct an AST for a djot document.</p> |
| 55 | |
| 56 | <br/> |
| 57 | <br/> |
| 58 | |
| 59 | <dl class="function"> |
| 60 | <dt> |
| 61 | <a name = "new_node"></a> |
| 62 | <strong>new_node (tag)</strong> |
| 63 | </dt> |
| 64 | <dd> |
| 65 | Create a new AST node. |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | </dd> |
| 72 | <dt> |
| 73 | <a name = "add_child"></a> |
| 74 | <strong>add_child (node, child)</strong> |
| 75 | </dt> |
| 76 | <dd> |
| 77 | Add <code>child</code> as a child of <code>node</code>. |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | </dd> |
| 84 | <dt> |
| 85 | <a name = "has_children"></a> |
| 86 | <strong>has_children (node)</strong> |
| 87 | </dt> |
| 88 | <dd> |
| 89 | Returns true if <code>node</code> has children. |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | </dd> |
| 96 | <dt> |
| 97 | <a name = "new_attributes"></a> |
| 98 | <strong>new_attributes (tbl)</strong> |
| 99 | </dt> |
| 100 | <dd> |
| 101 | Returns an attributes object. |
| 102 | deterministic order of iteration) |
| 103 | |
| 104 | |
| 105 | </dd> |
| 106 | <dt> |
| 107 | <a name = "insert_attribute"></a> |
| 108 | <strong>insert_attribute (attr, key, val)</strong> |
| 109 | </dt> |
| 110 | <dd> |
| 111 | Insert an attribute into an attributes object. |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | </dd> |
| 118 | <dt> |
| 119 | <a name = "copy_attributes"></a> |
| 120 | <strong>copy_attributes (target, source)</strong> |
| 121 | </dt> |
| 122 | <dd> |
| 123 | Copy attributes from <code>source</code> to <code>target</code>. |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | </dd> |
| 130 | <dt> |
| 131 | <a name = "to_ast"></a> |
| 132 | <strong>to_ast (parser, sourcepos)</strong> |
| 133 | </dt> |
| 134 | <dd> |
| 135 | Create an abstract syntax tree based on an event |
| 136 | stream and references. |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | </dd> |
| 143 | <dt> |
| 144 | <a name = "render"></a> |
| 145 | <strong>render (doc, handle)</strong> |
| 146 | </dt> |
| 147 | <dd> |
| 148 | Render an AST in human-readable form, with indentation |
| 149 | showing the hierarchy. |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | </dd> |
| 156 | </dl> |
| 157 | |
| 158 | |
| 159 | </div> <!-- id="content" --> |
| 160 | </div> <!-- id="main" --> |
| 161 | <div id="about"> |
| 162 | </div> <!-- id="about" --> |
| 163 | </div> <!-- id="container" --> |
| 164 | </body> |
| 165 | </html> |
| 166 |