advtrains_doc_integration.utils.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <head>
  6. <title>Manual for advtrains_doc_integration</title>
  7. <link rel="stylesheet" href="../ldoc.css" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <!-- Menu -->
  18. <div id="navigation">
  19. <br/>
  20. <h1>Documentation System Integration for Advtrains</h1>
  21. <ul>
  22. <li><a href="../index.html">Index</a></li>
  23. </ul>
  24. <h2>Contents</h2>
  25. <ul>
  26. <li><a href="#Functions">Functions</a></li>
  27. </ul>
  28. <h2>Modules</h2>
  29. <ul class="nowrap">
  30. <li><a href="../modules/advtrains_doc_integration.bc.html">advtrains_doc_integration.bc</a></li>
  31. <li><a href="../modules/advtrains_doc_integration.describe.html">advtrains_doc_integration.describe</a></li>
  32. <li><a href="../modules/advtrains_doc_integration.hypertext.html">advtrains_doc_integration.hypertext</a></li>
  33. <li><a href="../modules/advtrains_doc_integration.html">advtrains_doc_integration</a></li>
  34. <li><a href="../modules/advtrains_doc_integration.latex.html">advtrains_doc_integration.latex</a></li>
  35. <li><a href="../modules/advtrains_doc_integration.mathutils.html">advtrains_doc_integration.mathutils</a></li>
  36. <li><strong>advtrains_doc_integration.utils</strong></li>
  37. </ul>
  38. <h2>Topics</h2>
  39. <ul class="">
  40. <li><a href="../topics/README.md.html">README</a></li>
  41. </ul>
  42. </div>
  43. <div id="content">
  44. <h1>Module <code>advtrains_doc_integration.utils</code></h1>
  45. <p>Utility functions.</p>
  46. <p>
  47. </p>
  48. <h2><a href="#Functions">Functions</a></h2>
  49. <table class="function_list">
  50. <tr>
  51. <td class="name" nowrap><a href="#map">map (tbl, func)</a></td>
  52. <td class="summary">Create a table by applying a function to each element.</td>
  53. </tr>
  54. <tr>
  55. <td class="name" nowrap><a href="#spairs">spairs (tbl[, sort])</a></td>
  56. <td class="summary">Create an iterator that iterates through the table in the order of
  57. the keys sorted in a certain order.</td>
  58. </tr>
  59. <tr>
  60. <td class="name" nowrap><a href="#get_coupler_name">get_coupler_name (str)</a></td>
  61. <td class="summary">Gets the name of the coupler</td>
  62. </tr>
  63. <tr>
  64. <td class="name" nowrap><a href="#adjust_soundspec">adjust_soundspec (spec)</a></td>
  65. <td class="summary">Adjust the soundspec to table form.</td>
  66. </tr>
  67. <tr>
  68. <td class="name" nowrap><a href="#texture_escape">texture_escape (str)</a></td>
  69. <td class="summary">Escape the texture string.</td>
  70. </tr>
  71. </table>
  72. <br/>
  73. <br/>
  74. <h2 class="section-header "><a name="Functions"></a>Functions</h2>
  75. <dl class="function">
  76. <dt>
  77. <a name = "map"></a>
  78. <strong>map (tbl, func)</strong>
  79. </dt>
  80. <dd>
  81. Create a table by applying a function to each element.
  82. <h3>Parameters:</h3>
  83. <ul>
  84. <li><span class="parameter">tbl</span>
  85. <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.6">table</a></span>
  86. The table to map from.
  87. </li>
  88. <li><span class="parameter">func</span>
  89. <span class="types"><span class="type">function</span></span>
  90. The function to apply.
  91. </li>
  92. </ul>
  93. <h3>Returns:</h3>
  94. <ol>
  95. <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.6">table</a></span>
  96. The resulting table.
  97. </ol>
  98. </dd>
  99. <dt>
  100. <a name = "spairs"></a>
  101. <strong>spairs (tbl[, sort])</strong>
  102. </dt>
  103. <dd>
  104. Create an iterator that iterates through the table in the order of
  105. the keys sorted in a certain order.
  106. Note that the behavior is undefined if a key is added during the iteration.
  107. <h3>Parameters:</h3>
  108. <ul>
  109. <li><span class="parameter">tbl</span>
  110. <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.6">table</a></span>
  111. The table to iterate
  112. </li>
  113. <li><span class="parameter">sort</span>
  114. <span class="types"><span class="type">function</span></span>
  115. The function passed to <a href="https://www.lua.org/manual/5.4/manual.html#pdf-table.sort">table.sort</a> for
  116. sorting the keys. The default sorting order is used if the function
  117. is not provided.
  118. (<em>optional</em>)
  119. </li>
  120. </ul>
  121. <h3>Returns:</h3>
  122. <ol>
  123. An iterator suitable for use with Lua's <code>for</code> loop.
  124. </ol>
  125. </dd>
  126. <dt>
  127. <a name = "get_coupler_name"></a>
  128. <strong>get_coupler_name (str)</strong>
  129. </dt>
  130. <dd>
  131. Gets the name of the coupler
  132. <h3>Parameters:</h3>
  133. <ul>
  134. <li><span class="parameter">str</span>
  135. <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
  136. The technical name of the coupler
  137. </li>
  138. </ul>
  139. <h3>Returns:</h3>
  140. <ol>
  141. <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
  142. The name of the coupler
  143. </ol>
  144. </dd>
  145. <dt>
  146. <a name = "adjust_soundspec"></a>
  147. <strong>adjust_soundspec (spec)</strong>
  148. </dt>
  149. <dd>
  150. Adjust the soundspec to table form.
  151. <h3>Parameters:</h3>
  152. <ul>
  153. <li><span class="parameter">spec</span>
  154. <span class="types"><a class="type" href="https://api.minetest.net/sounds/#simplesoundspec">SimpleSoundSpec</a></span>
  155. The soundspec to adjust.
  156. </li>
  157. </ul>
  158. <h3>Returns:</h3>
  159. <ol>
  160. <span class="types"><a class="type" href="https://api.minetest.net/sounds/#simplesoundspec">SimpleSoundSpec</a></span>
  161. The adjusted soundspec.
  162. </ol>
  163. </dd>
  164. <dt>
  165. <a name = "texture_escape"></a>
  166. <strong>texture_escape (str)</strong>
  167. </dt>
  168. <dd>
  169. Escape the texture string.
  170. <h3>Parameters:</h3>
  171. <ul>
  172. <li><span class="parameter">str</span>
  173. <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
  174. The texture string to escape.
  175. </li>
  176. </ul>
  177. <h3>Returns:</h3>
  178. <ol>
  179. <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
  180. The escaped texture string.
  181. </ol>
  182. </dd>
  183. </dl>
  184. </div> <!-- id="content" -->
  185. </div> <!-- id="main" -->
  186. <div id="about">
  187. <i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
  188. <i style="float:right;">Last updated 2024-01-29 22:34:40 </i>
  189. </div> <!-- id="about" -->
  190. </div> <!-- id="container" -->
  191. </body>
  192. </html>