reST.html 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>reST primer &#8212; Searx Documentation (Searx-1.1.0.tex)</title>
  8. <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
  9. <link rel="stylesheet" type="text/css" href="../_static/searx.css" />
  10. <link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
  11. <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
  12. <script src="../_static/jquery.js"></script>
  13. <script src="../_static/underscore.js"></script>
  14. <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
  15. <script src="../_static/doctools.js"></script>
  16. <script src="../_static/sphinx_highlight.js"></script>
  17. <link rel="index" title="Index" href="../genindex.html" />
  18. <link rel="search" title="Search" href="../search.html" />
  19. <link rel="next" title="Tooling box searx_extra for developers and users" href="../searx_extra/index.html" />
  20. <link rel="prev" title="Makefile" href="makefile.html" />
  21. </head><body>
  22. <div class="related" role="navigation" aria-label="related navigation">
  23. <h3>Navigation</h3>
  24. <ul>
  25. <li class="right" style="margin-right: 10px">
  26. <a href="../genindex.html" title="General Index"
  27. accesskey="I">index</a></li>
  28. <li class="right" >
  29. <a href="../py-modindex.html" title="Python Module Index"
  30. >modules</a> |</li>
  31. <li class="right" >
  32. <a href="../searx_extra/index.html" title="Tooling box searx_extra for developers and users"
  33. accesskey="N">next</a> |</li>
  34. <li class="right" >
  35. <a href="makefile.html" title="Makefile"
  36. accesskey="P">previous</a> |</li>
  37. <li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.1.0.tex)</a> &#187;</li>
  38. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Developer documentation</a> &#187;</li>
  39. <li class="nav-item nav-item-this"><a href="">reST primer</a></li>
  40. </ul>
  41. </div>
  42. <div class="document">
  43. <div class="documentwrapper">
  44. <div class="bodywrapper">
  45. <div class="body" role="main">
  46. <section id="rest-primer">
  47. <span id="id1"></span><h1>reST primer<a class="headerlink" href="#rest-primer" title="Permalink to this heading">¶</a></h1>
  48. <aside class="sidebar">
  49. <p class="sidebar-title"><a class="reference external" href="https://en.wikipedia.org/wiki/KISS_principle">KISS</a> and <a class="reference external" href="https://docs.python-guide.org/writing/style/">readability</a></p>
  50. <p>Instead of defining more and more roles, we at searx encourage our
  51. contributors to follow principles like <a class="reference external" href="https://en.wikipedia.org/wiki/KISS_principle">KISS</a> and <a class="reference external" href="https://docs.python-guide.org/writing/style/">readability</a>.</p>
  52. </aside>
  53. <p>We at searx are using reStructuredText (aka <a class="reference external" href="https://docutils.sourceforge.io/rst.html">reST</a>) markup for all kind of
  54. documentation, with the builders from the <a class="reference external" href="https://www.sphinx-doc.org">Sphinx</a> project a HTML output is
  55. generated and deployed at <a class="reference external" href="https://searx.github.io/searx/.">github.io</a>. For build prerequisites read
  56. <a class="reference internal" href="../admin/buildhosts.html#docs-build"><span class="std std-ref">Build docs</span></a>.</p>
  57. <p>The source files of Searx’s documentation are located at <a class="reference external" href="https://github.com/searx/searx/blob/master/docs">Origin: docs</a>. Sphinx
  58. assumes source files to be encoded in UTF-8 by default. Run <a class="reference internal" href="contribution_guide.html#make-docs-live"><span class="std std-ref">make docs.live</span></a> to build HTML while editing.</p>
  59. <aside class="sidebar">
  60. <p class="sidebar-title">Further reading</p>
  61. <ul class="simple">
  62. <li><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html">Sphinx-Primer</a></p></li>
  63. <li><p><a class="reference external" href="https://www.sphinx-doc.org/en/stable/markup/index.html">Sphinx markup constructs</a></p></li>
  64. <li><p><a class="reference external" href="https://docutils.sourceforge.io/rst.html">reST</a>, <a class="reference external" href="http://docutils.sourceforge.net/docs/index.html">docutils</a>, <a class="reference external" href="http://docutils.sourceforge.net/FAQ.html">docutils FAQ</a></p></li>
  65. <li><p><a class="reference external" href="https://www.sphinx-doc.org">Sphinx</a>, <a class="reference external" href="https://www.sphinx-doc.org/en/stable/faq.html">sphinx-doc FAQ</a></p></li>
  66. <li><p><a class="reference external" href="https://www.sphinx-doc.org/en/stable/config.html">sphinx config</a>, <a class="reference external" href="https://www.sphinx-doc.org/en/master/extdev/tutorial.html?highlight=doctree#build-phases">doctree</a></p></li>
  67. <li><p><a class="reference external" href="https://www.sphinx-doc.org/en/stable/markup/inline.html#cross-referencing-arbitrary-locations">sphinx cross references</a></p></li>
  68. <li><p><a class="reference external" href="https://return42.github.io/linuxdoc">linuxdoc</a></p></li>
  69. <li><p><a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">intersphinx</a></p></li>
  70. <li><p><a class="reference external" href="https://github.com/tardyp/sphinx-jinja">sphinx-jinja</a></p></li>
  71. <li><p><a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/autodoc.html">Sphinx’s autodoc</a></p></li>
  72. <li><p><a class="reference external" href="https://www.sphinx-doc.org/en/stable/domains.html#the-python-domain">Sphinx’s Python domain</a>, <a class="reference external" href="https://www.sphinx-doc.org/en/stable/domains.html#cross-referencing-c-constructs">Sphinx’s C domain</a></p></li>
  73. <li><p><a class="reference external" href="https://www.w3.org/TR/SVG11/expanded-toc.html">SVG</a>, <a class="reference external" href="https://www.imagemagick.org">ImageMagick</a></p></li>
  74. <li><p><a class="reference external" href="https://graphviz.gitlab.io/_pages/doc/info/lang.html">DOT</a>, <a class="reference external" href="https://graphviz.gitlab.io/_pages/pdf/dotguide.pdf">Graphviz’s dot</a>, <a class="reference external" href="https://graphviz.gitlab.io">Graphviz</a></p></li>
  75. </ul>
  76. </aside>
  77. <nav class="contents local" id="contents">
  78. <p class="topic-title">Contents</p>
  79. <ul class="simple">
  80. <li><p><a class="reference internal" href="#soft-skills" id="id15">Soft skills</a></p></li>
  81. <li><p><a class="reference internal" href="#basic-inline-markup" id="id16">Basic inline markup</a></p></li>
  82. <li><p><a class="reference internal" href="#basic-article-structure" id="id17">Basic article structure</a></p>
  83. <ul>
  84. <li><p><a class="reference internal" href="#rest-template" id="id18">reST template</a></p></li>
  85. <li><p><a class="reference internal" href="#headings" id="id19">Headings</a></p></li>
  86. </ul>
  87. </li>
  88. <li><p><a class="reference internal" href="#anchors-links" id="id20">Anchors &amp; Links</a></p>
  89. <ul>
  90. <li><p><a class="reference internal" href="#anchors" id="id21">Anchors</a></p></li>
  91. <li><p><a class="reference internal" href="#link-ordinary-url" id="id22">Link ordinary URL</a></p></li>
  92. <li><p><a class="reference internal" href="#smart-refs" id="id23">Smart refs</a></p></li>
  93. </ul>
  94. </li>
  95. <li><p><a class="reference internal" href="#literal-blocks" id="id24">Literal blocks</a></p>
  96. <ul>
  97. <li><p><a class="reference internal" href="#rest-literal" id="id25"><code class="docutils literal notranslate"><span class="pre">::</span></code></a></p></li>
  98. <li><p><a class="reference internal" href="#code-block" id="id26"><code class="docutils literal notranslate"><span class="pre">code-block</span></code></a></p></li>
  99. </ul>
  100. </li>
  101. <li><p><a class="reference internal" href="#unicode-substitution" id="id27">Unicode substitution</a></p></li>
  102. <li><p><a class="reference internal" href="#roles" id="id28">Roles</a></p></li>
  103. <li><p><a class="reference internal" href="#figures-images" id="id29">Figures &amp; Images</a></p>
  104. <ul>
  105. <li><p><a class="reference internal" href="#dot-files-aka-graphviz" id="id30">DOT files (aka Graphviz)</a></p></li>
  106. <li><p><a class="reference internal" href="#kernel-render-dot" id="id31"><code class="docutils literal notranslate"><span class="pre">kernel-render</span></code> DOT</a></p></li>
  107. <li><p><a class="reference internal" href="#kernel-render-svg" id="id32"><code class="docutils literal notranslate"><span class="pre">kernel-render</span></code> SVG</a></p></li>
  108. </ul>
  109. </li>
  110. <li><p><a class="reference internal" href="#list-markups" id="id33">List markups</a></p>
  111. <ul>
  112. <li><p><a class="reference internal" href="#bullet-list" id="id34">Bullet list</a></p></li>
  113. <li><p><a class="reference internal" href="#horizontal-list" id="id35">Horizontal list</a></p></li>
  114. <li><p><a class="reference internal" href="#definition-list" id="id36">Definition list</a></p></li>
  115. <li><p><a class="reference internal" href="#quoted-paragraphs" id="id37">Quoted paragraphs</a></p></li>
  116. <li><p><a class="reference internal" href="#field-lists" id="id38">Field Lists</a></p></li>
  117. <li><p><a class="reference internal" href="#further-list-blocks" id="id39">Further list blocks</a></p></li>
  118. </ul>
  119. </li>
  120. <li><p><a class="reference internal" href="#admonitions" id="id40">Admonitions</a></p>
  121. <ul>
  122. <li><p><a class="reference internal" href="#sidebar" id="id41">Sidebar</a></p></li>
  123. <li><p><a class="reference internal" href="#generic-admonition" id="id42">Generic admonition</a></p></li>
  124. <li><p><a class="reference internal" href="#specific-admonitions" id="id43">Specific admonitions</a></p></li>
  125. </ul>
  126. </li>
  127. <li><p><a class="reference internal" href="#tables" id="id44">Tables</a></p>
  128. <ul>
  129. <li><p><a class="reference internal" href="#simple-tables" id="id45">Simple tables</a></p></li>
  130. <li><p><a class="reference internal" href="#grid-tables" id="id46">Grid tables</a></p></li>
  131. <li><p><a class="reference internal" href="#flat-table" id="id47">flat-table</a></p></li>
  132. <li><p><a class="reference internal" href="#csv-table" id="id48">CSV table</a></p></li>
  133. </ul>
  134. </li>
  135. <li><p><a class="reference internal" href="#templating" id="id49">Templating</a></p></li>
  136. <li><p><a class="reference internal" href="#tabbed-views" id="id50">Tabbed views</a></p></li>
  137. <li><p><a class="reference internal" href="#math-equations" id="id51">Math equations</a></p></li>
  138. </ul>
  139. </nav>
  140. <p><a class="reference external" href="https://www.sphinx-doc.org">Sphinx</a> and <a class="reference external" href="https://docutils.sourceforge.io/rst.html">reST</a> have their place in the python ecosystem. Over that reST is
  141. used in popular projects, e.g the Linux kernel documentation <a class="reference external" href="https://www.kernel.org/doc/html/latest/doc-guide/sphinx.html">[kernel doc]</a>.</p>
  142. <aside class="sidebar">
  143. <p class="sidebar-title">Content matters</p>
  144. <p>The <a class="reference external" href="https://docs.python-guide.org/writing/style/">readability</a> of the reST sources has its value, therefore we recommend to
  145. make sparse usage of reST markup / .. content matters!</p>
  146. </aside>
  147. <p><strong>reST</strong> is a plaintext markup language, its markup is <em>mostly</em> intuitive and
  148. you will not need to learn much to produce well formed articles with. I use the
  149. word <em>mostly</em>: like everything in live, reST has its advantages and
  150. disadvantages, some markups feel a bit grumpy (especially if you are used to
  151. other plaintext markups).</p>
  152. <section id="soft-skills">
  153. <h2><a class="toc-backref" href="#id15" role="doc-backlink">Soft skills</a><a class="headerlink" href="#soft-skills" title="Permalink to this heading">¶</a></h2>
  154. <p>Before going any deeper into the markup let’s face on some <strong>soft skills</strong> a
  155. trained author brings with, to reach a well feedback from readers:</p>
  156. <ul class="simple">
  157. <li><p>Documentation is dedicated to an audience and answers questions from the
  158. audience point of view.</p></li>
  159. <li><p>Don’t detail things which are general knowledge from the audience point of
  160. view.</p></li>
  161. <li><p>Limit the subject, use cross links for any further reading.</p></li>
  162. </ul>
  163. <p>To be more concrete what a <em>point of view</em> means. In the (<a class="reference external" href="https://github.com/searx/searx/blob/master/docs">Origin: docs</a>)
  164. folder we have three sections (and the <em>blog</em> folder), each dedicate to a
  165. different group of audience.</p>
  166. <dl class="simple">
  167. <dt>User’s POV: <a class="reference external" href="https://github.com/searx/searx/blob/master/docs/user">Origin: docs/user</a></dt><dd><p>A typical user knows about search engines and might have heard about
  168. meta crawlers and privacy.</p>
  169. </dd>
  170. <dt>Admin’s POV: <a class="reference external" href="https://github.com/searx/searx/blob/master/docs/admin">Origin: docs/admin</a></dt><dd><p>A typical Admin knows about setting up services on a linux system, but he does
  171. not know all the pros and cons of a searx setup.</p>
  172. </dd>
  173. <dt>Developer’s POV: <a class="reference external" href="https://github.com/searx/searx/blob/master/docs/dev">Origin: docs/dev</a></dt><dd><p>Depending on the <a class="reference external" href="https://docs.python-guide.org/writing/style/">readability</a> of code, a typical developer is able to read and
  174. understand source code. Describe what a item aims to do (e.g. a function).
  175. If the chronological order matters, describe it. Name the <em>out-of-limits
  176. conditions</em> and all the side effects a external developer will not know.</p>
  177. </dd>
  178. </dl>
  179. </section>
  180. <section id="basic-inline-markup">
  181. <span id="rest-inline-markup"></span><h2><a class="toc-backref" href="#id16" role="doc-backlink">Basic inline markup</a><a class="headerlink" href="#basic-inline-markup" title="Permalink to this heading">¶</a></h2>
  182. <aside class="sidebar">
  183. <p class="sidebar-title">Inline markup</p>
  184. <ul class="simple">
  185. <li><p><a class="reference internal" href="#rest-roles"><span class="std std-ref">Roles</span></a></p></li>
  186. <li><p><a class="reference internal" href="#rest-smart-ref"><span class="std std-ref">Smart refs</span></a></p></li>
  187. </ul>
  188. </aside>
  189. <p>Basic inline markup is done with asterisks and backquotes. If asterisks or
  190. backquotes appear in running text and could be confused with inline markup
  191. delimiters, they have to be escaped with a backslash (<code class="docutils literal notranslate"><span class="pre">\*pointer</span></code>).</p>
  192. <table class="docutils align-default" id="id4">
  193. <caption><span class="caption-number">Table 4 </span><span class="caption-text">basic inline markup</span><a class="headerlink" href="#id4" title="Permalink to this table">¶</a></caption>
  194. <colgroup>
  195. <col style="width: 29%" />
  196. <col style="width: 21%" />
  197. <col style="width: 50%" />
  198. </colgroup>
  199. <thead>
  200. <tr class="row-odd"><th class="head"><p>description</p></th>
  201. <th class="head"><p>rendered</p></th>
  202. <th class="head"><p>markup</p></th>
  203. </tr>
  204. </thead>
  205. <tbody>
  206. <tr class="row-even"><td><p>one asterisk for emphasis</p></td>
  207. <td><p><em>italics</em></p></td>
  208. <td><p><code class="docutils literal notranslate"><span class="pre">*italics*</span></code></p></td>
  209. </tr>
  210. <tr class="row-odd"><td><p>two asterisks for strong emphasis</p></td>
  211. <td><p><strong>boldface</strong></p></td>
  212. <td><p><code class="docutils literal notranslate"><span class="pre">**boldface**</span></code></p></td>
  213. </tr>
  214. <tr class="row-even"><td><p>backquotes for code samples and literals</p></td>
  215. <td><p><code class="docutils literal notranslate"><span class="pre">foo()</span></code></p></td>
  216. <td><p><code class="docutils literal notranslate"><span class="pre">``foo()``</span></code></p></td>
  217. </tr>
  218. <tr class="row-odd"><td><p>quote asterisks or backquotes</p></td>
  219. <td><p>*foo is a pointer</p></td>
  220. <td><p><code class="docutils literal notranslate"><span class="pre">\*foo</span> <span class="pre">is</span> <span class="pre">a</span> <span class="pre">pointer</span></code></p></td>
  221. </tr>
  222. </tbody>
  223. </table>
  224. </section>
  225. <section id="basic-article-structure">
  226. <span id="rest-basic-structure"></span><h2><a class="toc-backref" href="#id17" role="doc-backlink">Basic article structure</a><a class="headerlink" href="#basic-article-structure" title="Permalink to this heading">¶</a></h2>
  227. <p>The basic structure of an article makes use of heading adornments to markup
  228. chapter, sections and subsections.</p>
  229. <section id="rest-template">
  230. <span id="id2"></span><h3><a class="toc-backref" href="#id18" role="doc-backlink">reST template</a><a class="headerlink" href="#rest-template" title="Permalink to this heading">¶</a></h3>
  231. <p>reST template for an simple article:</p>
  232. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="nt">_doc refname:</span>
  233. <span class="gh">==============</span>
  234. <span class="gh">Document title</span>
  235. <span class="gh">==============</span>
  236. Lorem ipsum dolor sit amet, consectetur adipisici elit .. Further read
  237. <span class="na">:ref:</span><span class="nv">`chapter refname`</span>.
  238. <span class="p">..</span> <span class="nt">_chapter refname:</span>
  239. <span class="gh">Chapter</span>
  240. <span class="gh">=======</span>
  241. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
  242. aliquid ex ea commodi consequat ...
  243. <span class="p">..</span> <span class="nt">_section refname:</span>
  244. <span class="gh">Section</span>
  245. <span class="gh">-------</span>
  246. lorem ..
  247. <span class="p">..</span> <span class="nt">_subsection refname:</span>
  248. <span class="gh">Subsection</span>
  249. <span class="gh">~~~~~~~~~~</span>
  250. lorem ..
  251. </pre></div>
  252. </div>
  253. </section>
  254. <section id="headings">
  255. <h3><a class="toc-backref" href="#id19" role="doc-backlink">Headings</a><a class="headerlink" href="#headings" title="Permalink to this heading">¶</a></h3>
  256. <ol class="arabic simple">
  257. <li><p>title - with overline for document title:</p></li>
  258. </ol>
  259. <blockquote>
  260. <div><div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="gh">==============</span>
  261. <span class="gh">Document title</span>
  262. <span class="gh">==============</span>
  263. </pre></div>
  264. </div>
  265. </div></blockquote>
  266. <ol class="arabic">
  267. <li><p>chapter - with anchor named <code class="docutils literal notranslate"><span class="pre">anchor</span> <span class="pre">name</span></code>:</p>
  268. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="nt">_anchor name:</span>
  269. <span class="gh">Chapter</span>
  270. <span class="gh">=======</span>
  271. </pre></div>
  272. </div>
  273. </li>
  274. <li><p>section</p>
  275. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="gh">Section</span>
  276. <span class="gh">-------</span>
  277. </pre></div>
  278. </div>
  279. </li>
  280. <li><p>subsection</p>
  281. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="gh">Subsection</span>
  282. <span class="gh">~~~~~~~~~~</span>
  283. </pre></div>
  284. </div>
  285. </li>
  286. </ol>
  287. </section>
  288. </section>
  289. <section id="anchors-links">
  290. <h2><a class="toc-backref" href="#id20" role="doc-backlink">Anchors &amp; Links</a><a class="headerlink" href="#anchors-links" title="Permalink to this heading">¶</a></h2>
  291. <section id="anchors">
  292. <span id="rest-anchor"></span><h3><a class="toc-backref" href="#id21" role="doc-backlink">Anchors</a><a class="headerlink" href="#anchors" title="Permalink to this heading">¶</a></h3>
  293. <p>To refer a point in the documentation a anchor is needed. The <a class="reference internal" href="#rest-template"><span class="std std-ref">reST
  294. template</span></a> shows an example where a chapter titled <em>“Chapters”</em>
  295. gets an anchor named <code class="docutils literal notranslate"><span class="pre">chapter</span> <span class="pre">title</span></code>. Another example from <em>this</em> document,
  296. where the anchor named <code class="docutils literal notranslate"><span class="pre">reST</span> <span class="pre">anchor</span></code>:</p>
  297. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="nt">_reST anchor:</span>
  298. <span class="gh">Anchors</span>
  299. <span class="gh">-------</span>
  300. To refer a point in the documentation a anchor is needed ...
  301. </pre></div>
  302. </div>
  303. <p>To refer anchors use the <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref">ref role</a> markup:</p>
  304. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span>Visit chapter <span class="na">:ref:</span><span class="nv">`reST anchor`</span>. Or set hyperlink text manually :ref:`foo
  305. bar &lt;reST anchor&gt;`.
  306. </pre></div>
  307. </div>
  308. <div class="rst-example admonition">
  309. <p class="admonition-title"><code class="docutils literal notranslate"><span class="pre">:ref:</span></code> role</p>
  310. <p>Visist chapter <a class="reference internal" href="#rest-anchor"><span class="std std-ref">Anchors</span></a>. Or set hyperlink text manually <a class="reference internal" href="#rest-anchor"><span class="std std-ref">foo
  311. bar</span></a>.</p>
  312. </div>
  313. </section>
  314. <section id="link-ordinary-url">
  315. <span id="rest-ordinary-ref"></span><h3><a class="toc-backref" href="#id22" role="doc-backlink">Link ordinary URL</a><a class="headerlink" href="#link-ordinary-url" title="Permalink to this heading">¶</a></h3>
  316. <p>If you need to reference external URLs use <em>named</em> hyperlinks to maintain
  317. readability of reST sources. Here is a example taken from <em>this</em> article:</p>
  318. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="nt">_Sphinx Field Lists:</span>
  319. https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html
  320. With the <span class="ge">*named*</span> hyperlink <span class="s">`Sphinx Field Lists`_</span>, the raw text is much more
  321. readable.
  322. And this shows the alternative (less readable) hyperlink markup `Sphinx Field
  323. Lists
  324. <span class="nt">&lt;https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html&gt;</span>`__.
  325. </pre></div>
  326. </div>
  327. <div class="rst-example admonition">
  328. <p class="admonition-title">Named hyperlink</p>
  329. <p>With the <em>named</em> hyperlink <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html">Sphinx Field Lists</a>, the raw text is much more
  330. readable.</p>
  331. <p>And this shows the alternative (less readable) hyperlink markup <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html">Sphinx Field
  332. Lists</a>.</p>
  333. </div>
  334. </section>
  335. <section id="smart-refs">
  336. <span id="rest-smart-ref"></span><h3><a class="toc-backref" href="#id23" role="doc-backlink">Smart refs</a><a class="headerlink" href="#smart-refs" title="Permalink to this heading">¶</a></h3>
  337. <p>With the power of <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html">sphinx.ext.extlinks</a> and <a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">intersphinx</a> referencing external
  338. content becomes smart.</p>
  339. <table class="docutils align-default" id="id5">
  340. <caption><span class="caption-number">Table 5 </span><span class="caption-text">smart refs with <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html">sphinx.ext.extlinks</a> and <a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">intersphinx</a></span><a class="headerlink" href="#id5" title="Permalink to this table">¶</a></caption>
  341. <colgroup>
  342. <col style="width: 29%" />
  343. <col style="width: 21%" />
  344. <col style="width: 50%" />
  345. </colgroup>
  346. <thead>
  347. <tr class="row-odd"><th class="head"><p>refer …</p></th>
  348. <th class="head"><p>rendered example</p></th>
  349. <th class="head"><p>markup</p></th>
  350. </tr>
  351. </thead>
  352. <tbody>
  353. <tr class="row-even"><td><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-rfc" title="(in Sphinx v6.2.0)"><code class="xref rst rst-role docutils literal notranslate"><span class="pre">rfc</span></code></a></p></td>
  354. <td><p><span class="target" id="index-0"></span><a class="rfc reference external" href="https://datatracker.ietf.org/doc/html/rfc822.html"><strong>RFC 822</strong></a></p></td>
  355. <td><p><code class="docutils literal notranslate"><span class="pre">:rfc:`822`</span></code></p></td>
  356. </tr>
  357. <tr class="row-odd"><td><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-pep" title="(in Sphinx v6.2.0)"><code class="xref rst rst-role docutils literal notranslate"><span class="pre">pep</span></code></a></p></td>
  358. <td><p><span class="target" id="index-1"></span><a class="pep reference external" href="https://peps.python.org/pep-0008/"><strong>PEP 8</strong></a></p></td>
  359. <td><p><code class="docutils literal notranslate"><span class="pre">:pep:`8`</span></code></p></td>
  360. </tr>
  361. <tr class="row-even"><td colspan="3"><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html">sphinx.ext.extlinks</a></p></td>
  362. </tr>
  363. <tr class="row-odd"><td><p>project’s wiki article</p></td>
  364. <td><p><a class="reference external" href="https://github.com/searx/searx/wiki/Offline-engines">Offline-engines</a></p></td>
  365. <td><p><code class="docutils literal notranslate"><span class="pre">:wiki:`Offline-engines`</span></code></p></td>
  366. </tr>
  367. <tr class="row-even"><td><p>to docs public URL</p></td>
  368. <td><p><a class="reference external" href="https://searx.github.io/searx/dev/reST.html">docs: dev/reST.html</a></p></td>
  369. <td><p><code class="docutils literal notranslate"><span class="pre">:docs:`dev/reST.html`</span></code></p></td>
  370. </tr>
  371. <tr class="row-odd"><td><p>files &amp; folders origin</p></td>
  372. <td><p><a class="reference external" href="https://github.com/searx/searx/blob/master/docs/dev/reST.rst">Origin: docs/dev/reST.rst</a></p></td>
  373. <td><p><code class="docutils literal notranslate"><span class="pre">:origin:`docs/dev/reST.rst`</span></code></p></td>
  374. </tr>
  375. <tr class="row-even"><td><p>pull request</p></td>
  376. <td><p><a class="reference external" href="https://github.com/searx/searx/pull/1756">PR 1756</a></p></td>
  377. <td><p><code class="docutils literal notranslate"><span class="pre">:pull:`1756`</span></code></p></td>
  378. </tr>
  379. <tr class="row-odd"><td><p>patch</p></td>
  380. <td><p><a class="reference external" href="https://github.com/searx/searx/commit/af2cae6">path af2cae6</a></p></td>
  381. <td><p><code class="docutils literal notranslate"><span class="pre">:patch:`af2cae6`</span></code></p></td>
  382. </tr>
  383. <tr class="row-even"><td><p>PyPi package</p></td>
  384. <td><p><a class="reference external" href="https://pypi.org/project/searx">PyPi: searx</a></p></td>
  385. <td><p><code class="docutils literal notranslate"><span class="pre">:pypi:`searx`</span></code></p></td>
  386. </tr>
  387. <tr class="row-odd"><td><p>manual page man</p></td>
  388. <td><p><a class="reference external" href="https://manpages.debian.org/jump?q=bash">man: bash</a></p></td>
  389. <td><p><code class="docutils literal notranslate"><span class="pre">:man:`bash`</span></code></p></td>
  390. </tr>
  391. <tr class="row-even"><td colspan="3"><p><a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">intersphinx</a></p></td>
  392. </tr>
  393. <tr class="row-odd"><td><p>external anchor</p></td>
  394. <td><p><a class="reference external" href="https://docs.python.org/3/reference/expressions.html#and" title="(in Python v3.11)"><span>Boolean operations</span></a></p></td>
  395. <td><p><code class="docutils literal notranslate"><span class="pre">:ref:`python:and`</span></code></p></td>
  396. </tr>
  397. <tr class="row-even"><td><p>external doc anchor</p></td>
  398. <td><p><a class="reference external" href="https://jinja.palletsprojects.com/en/3.1.x/templates/" title="(in Jinja v3.1.x)"><span>Template Designer Documentation</span></a></p></td>
  399. <td><p><code class="docutils literal notranslate"><span class="pre">:doc:`jinja:templates`</span></code></p></td>
  400. </tr>
  401. <tr class="row-odd"><td><p>python code object</p></td>
  402. <td><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.11)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">datetime.datetime</span></code></a></p></td>
  403. <td><p><code class="docutils literal notranslate"><span class="pre">:py:obj:`datetime.datetime`</span></code></p></td>
  404. </tr>
  405. <tr class="row-even"><td><p>flask code object</p></td>
  406. <td><p><a class="reference external" href="https://flask.palletsprojects.com/en/2.2.x/api/#flask.Flask" title="(in Flask v2.2.x)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">flask.Flask</span></code></a></p></td>
  407. <td><p><code class="docutils literal notranslate"><span class="pre">:py:obj:`flask.Flask`</span></code></p></td>
  408. </tr>
  409. </tbody>
  410. </table>
  411. <p>Intersphinx is configured in <a class="reference external" href="https://github.com/searx/searx/blob/master/docs/conf.py">Origin: docs/conf.py</a>:</p>
  412. <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">intersphinx_mapping</span> <span class="o">=</span> <span class="p">{</span>
  413. <span class="s2">&quot;python&quot;</span><span class="p">:</span> <span class="p">(</span><span class="s2">&quot;https://docs.python.org/3/&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
  414. <span class="s2">&quot;flask&quot;</span><span class="p">:</span> <span class="p">(</span><span class="s2">&quot;https://flask.palletsprojects.com/&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
  415. <span class="s2">&quot;jinja&quot;</span><span class="p">:</span> <span class="p">(</span><span class="s2">&quot;https://jinja.palletsprojects.com/&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
  416. <span class="s2">&quot;linuxdoc&quot;</span> <span class="p">:</span> <span class="p">(</span><span class="s2">&quot;https://return42.github.io/linuxdoc/&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
  417. <span class="s2">&quot;sphinx&quot;</span> <span class="p">:</span> <span class="p">(</span><span class="s2">&quot;https://www.sphinx-doc.org/en/master/&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
  418. <span class="p">}</span>
  419. </pre></div>
  420. </div>
  421. <p>To list all anchors of the inventory (e.g. <code class="docutils literal notranslate"><span class="pre">python</span></code>) use:</p>
  422. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ python -m sphinx.ext.intersphinx https://docs.python.org/3/objects.inv
  423. ...
  424. $ python -m sphinx.ext.intersphinx https://searx.github.io/searx/objects.inv
  425. ...
  426. </pre></div>
  427. </div>
  428. </section>
  429. </section>
  430. <section id="literal-blocks">
  431. <h2><a class="toc-backref" href="#id24" role="doc-backlink">Literal blocks</a><a class="headerlink" href="#literal-blocks" title="Permalink to this heading">¶</a></h2>
  432. <p>The simplest form of <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#literal-blocks">literal-blocks</a> is a indented block introduced by
  433. two colons (<code class="docutils literal notranslate"><span class="pre">::</span></code>). For highlighting use <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#highlight">highlight</a> or <a class="reference internal" href="#rest-code"><span class="std std-ref">code-block</span></a> directive. To include literals from external files use
  434. <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-literalinclude" title="(in Sphinx v6.2.0)"><code class="xref rst rst-dir docutils literal notranslate"><span class="pre">literalinclude</span></code></a> or <a class="reference external" href="https://return42.github.io/linuxdoc/linuxdoc-howto/kernel-include-directive.html#kernel-include-directive" title="(in LinuxDoc v20230321)"><span class="xref std std-ref">kernel-include</span></a>
  435. directive (latter one expands environment variables in the path name).</p>
  436. <section id="rest-literal">
  437. <span id="id3"></span><h3><a class="toc-backref" href="#id25" role="doc-backlink"><code class="docutils literal notranslate"><span class="pre">::</span></code></a><a class="headerlink" href="#rest-literal" title="Permalink to this heading">¶</a></h3>
  438. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="se">::</span>
  439. <span class="s"> Literal block</span>
  440. Lorem ipsum dolor<span class="se">::</span>
  441. <span class="s"> Literal block</span>
  442. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
  443. eirmod tempor invidunt ut labore ::
  444. Literal block
  445. </pre></div>
  446. </div>
  447. <div class="rst-example admonition">
  448. <p class="admonition-title">Literal block</p>
  449. <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Literal block
  450. </pre></div>
  451. </div>
  452. <p>Lorem ipsum dolor:</p>
  453. <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Literal block
  454. </pre></div>
  455. </div>
  456. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
  457. eirmod tempor invidunt ut labore</p>
  458. <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Literal block
  459. </pre></div>
  460. </div>
  461. </div>
  462. </section>
  463. <section id="code-block">
  464. <span id="rest-code"></span><h3><a class="toc-backref" href="#id26" role="doc-backlink"><code class="docutils literal notranslate"><span class="pre">code-block</span></code></a><a class="headerlink" href="#code-block" title="Permalink to this heading">¶</a></h3>
  465. <aside class="sidebar">
  466. <p class="sidebar-title">Syntax highlighting</p>
  467. <p>is handled by <a class="reference external" href="https://pygments.org/languages/">pygments</a>.</p>
  468. </aside>
  469. <p>The <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block" title="(in Sphinx v6.2.0)"><code class="xref rst rst-dir docutils literal notranslate"><span class="pre">code-block</span></code></a> directive is a variant of the <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#code">code</a> directive
  470. with additional options. To learn more about code literals visit
  471. <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#code-examples" title="(in Sphinx v6.2.0)"><span>Showing code examples</span></a>.</p>
  472. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span>The URL <span class="s">``/stats``</span> handle is shown in <span class="na">:ref:</span><span class="nv">`stats-handle`</span>
  473. <span class="p">..</span> <span class="ow">code-block</span><span class="p">::</span> Python
  474. <span class="nc">:caption:</span> python code block
  475. <span class="nc">:name:</span> stats-handle
  476. @app.route(&#39;/stats&#39;, methods=[&#39;GET&#39;])
  477. def stats():
  478. &quot;&quot;&quot;Render engine statistics page.&quot;&quot;&quot;
  479. stats = get_engines_stats()
  480. return render(
  481. &#39;stats.html&#39;
  482. , stats = stats )
  483. </pre></div>
  484. </div>
  485. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span>
  486. </pre></div>
  487. </div>
  488. <div class="rst-example admonition">
  489. <p class="admonition-title">Code block</p>
  490. <p>The URL <code class="docutils literal notranslate"><span class="pre">/stats</span></code> handle is shown in <a class="reference internal" href="#stats-handle"><span class="std std-ref">python code block</span></a></p>
  491. <div class="literal-block-wrapper docutils container" id="stats-handle">
  492. <div class="code-block-caption"><span class="caption-number">Listing 1 </span><span class="caption-text">python code block</span><a class="headerlink" href="#stats-handle" title="Permalink to this code">¶</a></div>
  493. <div class="highlight-Python notranslate"><div class="highlight"><pre><span></span><span class="nd">@app</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s1">&#39;/stats&#39;</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;GET&#39;</span><span class="p">])</span>
  494. <span class="k">def</span> <span class="nf">stats</span><span class="p">():</span>
  495. <span class="sd">&quot;&quot;&quot;Render engine statistics page.&quot;&quot;&quot;</span>
  496. <span class="n">stats</span> <span class="o">=</span> <span class="n">get_engines_stats</span><span class="p">()</span>
  497. <span class="k">return</span> <span class="n">render</span><span class="p">(</span>
  498. <span class="s1">&#39;stats.html&#39;</span>
  499. <span class="p">,</span> <span class="n">stats</span> <span class="o">=</span> <span class="n">stats</span> <span class="p">)</span>
  500. </pre></div>
  501. </div>
  502. </div>
  503. </div>
  504. </section>
  505. </section>
  506. <section id="unicode-substitution">
  507. <h2><a class="toc-backref" href="#id27" role="doc-backlink">Unicode substitution</a><a class="headerlink" href="#unicode-substitution" title="Permalink to this heading">¶</a></h2>
  508. <p>The <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#unicode-character-codes">unicode directive</a> converts Unicode
  509. character codes (numerical values) to characters. This directive can only be
  510. used within a substitution definition.</p>
  511. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="nt">|copy|</span> <span class="ow">unicode</span><span class="p">::</span> 0xA9 .. copyright sign
  512. <span class="p">..</span> <span class="nt">|(TM)|</span> <span class="ow">unicode</span><span class="p">::</span> U+2122
  513. Trademark |(TM)| and copyright |copy| glyphs.
  514. </pre></div>
  515. </div>
  516. <div class="rst-example admonition">
  517. <p class="admonition-title">Unicode</p>
  518. <p>Trademark ™ and copyright © glyphs.</p>
  519. </div>
  520. </section>
  521. <section id="roles">
  522. <span id="rest-roles"></span><h2><a class="toc-backref" href="#id28" role="doc-backlink">Roles</a><a class="headerlink" href="#roles" title="Permalink to this heading">¶</a></h2>
  523. <aside class="sidebar">
  524. <p class="sidebar-title">Further reading</p>
  525. <ul class="simple">
  526. <li><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html">Sphinx Roles</a></p></li>
  527. <li><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html" title="(in Sphinx v6.2.0)"><span>Domains</span></a></p></li>
  528. </ul>
  529. </aside>
  530. <p>A <em>custom interpreted text role</em> (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#roles">ref</a>) is an inline piece of
  531. explicit markup. It signifies that that the enclosed text should be interpreted
  532. in a specific way.</p>
  533. <p>The general markup is one of:</p>
  534. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="na">:rolename:</span><span class="nv">`ref-name`</span>
  535. <span class="na">:rolename:</span><span class="nv">`ref text &lt;ref-name&gt;`</span>
  536. </pre></div>
  537. </div>
  538. <table class="docutils align-default" id="id6">
  539. <caption><span class="caption-number">Table 6 </span><span class="caption-text">smart refs with <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html">sphinx.ext.extlinks</a> and <a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">intersphinx</a></span><a class="headerlink" href="#id6" title="Permalink to this table">¶</a></caption>
  540. <colgroup>
  541. <col style="width: 29%" />
  542. <col style="width: 21%" />
  543. <col style="width: 50%" />
  544. </colgroup>
  545. <thead>
  546. <tr class="row-odd"><th class="head"><p>role</p></th>
  547. <th class="head"><p>rendered example</p></th>
  548. <th class="head"><p>markup</p></th>
  549. </tr>
  550. </thead>
  551. <tbody>
  552. <tr class="row-even"><td><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-guilabel" title="(in Sphinx v6.2.0)"><code class="xref rst rst-role docutils literal notranslate"><span class="pre">guilabel</span></code></a></p></td>
  553. <td><p><span class="guilabel"><span class="accelerator">C</span>ancel</span></p></td>
  554. <td><p><code class="docutils literal notranslate"><span class="pre">:guilabel:`&amp;Cancel`</span></code></p></td>
  555. </tr>
  556. <tr class="row-odd"><td><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-kbd" title="(in Sphinx v6.2.0)"><code class="xref rst rst-role docutils literal notranslate"><span class="pre">kbd</span></code></a></p></td>
  557. <td><p><kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">x</kbd> <kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">f</kbd></kbd></p></td>
  558. <td><p><code class="docutils literal notranslate"><span class="pre">:kbd:`C-x</span> <span class="pre">C-f`</span></code></p></td>
  559. </tr>
  560. <tr class="row-even"><td><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-menuselection" title="(in Sphinx v6.2.0)"><code class="xref rst rst-role docutils literal notranslate"><span class="pre">menuselection</span></code></a></p></td>
  561. <td><p><span class="menuselection">Open ‣ File</span></p></td>
  562. <td><p><code class="docutils literal notranslate"><span class="pre">:menuselection:`Open</span> <span class="pre">--&gt;</span> <span class="pre">File`</span></code></p></td>
  563. </tr>
  564. <tr class="row-odd"><td><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-download" title="(in Sphinx v6.2.0)"><code class="xref rst rst-role docutils literal notranslate"><span class="pre">download</span></code></a></p></td>
  565. <td><p><a class="reference download internal" download="" href="../_downloads/ad0ebe55d6b53b1559e0ca8dee6f30b9/reST.rst"><code class="xref download docutils literal notranslate"><span class="pre">this</span> <span class="pre">file</span></code></a></p></td>
  566. <td><p><code class="docutils literal notranslate"><span class="pre">:download:`this</span> <span class="pre">file</span> <span class="pre">&lt;reST.rst&gt;`</span></code></p></td>
  567. </tr>
  568. <tr class="row-even"><td><p><a class="reference internal" href="#math">math</a></p></td>
  569. <td><p><img class="math" src="_images/math/6673b43f9fe29455c1fcd1164e5844698cc64d38.svg" alt="a^2 + b^2 = c^2"/></p></td>
  570. <td><p><code class="docutils literal notranslate"><span class="pre">:math:`a^2</span> <span class="pre">+</span> <span class="pre">b^2</span> <span class="pre">=</span> <span class="pre">c^2`</span></code></p></td>
  571. </tr>
  572. <tr class="row-odd"><td><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref" title="(in Sphinx v6.2.0)"><code class="xref rst rst-role docutils literal notranslate"><span class="pre">ref</span></code></a></p></td>
  573. <td><p><a class="reference internal" href="#svg-image-example"><span class="std std-ref">Simple SVG image.</span></a></p></td>
  574. <td><p><code class="docutils literal notranslate"><span class="pre">:ref:`svg</span> <span class="pre">image</span> <span class="pre">example`</span></code></p></td>
  575. </tr>
  576. <tr class="row-even"><td><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-command" title="(in Sphinx v6.2.0)"><code class="xref rst rst-role docutils literal notranslate"><span class="pre">command</span></code></a></p></td>
  577. <td><p><strong class="command">ls -la</strong></p></td>
  578. <td><p><code class="docutils literal notranslate"><span class="pre">:command:`ls</span> <span class="pre">-la`</span></code></p></td>
  579. </tr>
  580. <tr class="row-odd"><td><p><a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/roles.html#emphasis">emphasis</a></p></td>
  581. <td><p><em>italic</em></p></td>
  582. <td><p><code class="docutils literal notranslate"><span class="pre">:emphasis:`italic`</span></code></p></td>
  583. </tr>
  584. <tr class="row-even"><td><p><a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/roles.html#strong">strong</a></p></td>
  585. <td><p><strong>bold</strong></p></td>
  586. <td><p><code class="docutils literal notranslate"><span class="pre">:strong:`bold`</span></code></p></td>
  587. </tr>
  588. <tr class="row-odd"><td><p><a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/roles.html#literal">literal</a></p></td>
  589. <td><p><code class="docutils literal notranslate"><span class="pre">foo()</span></code></p></td>
  590. <td><p><code class="docutils literal notranslate"><span class="pre">:literal:`foo()`</span></code></p></td>
  591. </tr>
  592. <tr class="row-even"><td><p><a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/roles.html#subscript">subscript</a></p></td>
  593. <td><p>H<sub>2</sub>O</p></td>
  594. <td><p><code class="docutils literal notranslate"><span class="pre">H\</span> <span class="pre">:sub:`2`\</span> <span class="pre">O</span></code></p></td>
  595. </tr>
  596. <tr class="row-odd"><td><p><a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/roles.html#superscript">superscript</a></p></td>
  597. <td><p>E = mc<sup>2</sup></p></td>
  598. <td><p><code class="docutils literal notranslate"><span class="pre">E</span> <span class="pre">=</span> <span class="pre">mc\</span> <span class="pre">:sup:`2`</span></code></p></td>
  599. </tr>
  600. <tr class="row-even"><td><p><a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/roles.html#title-reference">title-reference</a></p></td>
  601. <td><p><cite>Time</cite></p></td>
  602. <td><p><code class="docutils literal notranslate"><span class="pre">:title:`Time`</span></code></p></td>
  603. </tr>
  604. </tbody>
  605. </table>
  606. </section>
  607. <section id="figures-images">
  608. <h2><a class="toc-backref" href="#id29" role="doc-backlink">Figures &amp; Images</a><a class="headerlink" href="#figures-images" title="Permalink to this heading">¶</a></h2>
  609. <aside class="sidebar">
  610. <p class="sidebar-title">Image processing</p>
  611. <p>With the directives from <a class="reference external" href="https://return42.github.io/linuxdoc/linuxdoc-howto/kfigure.html#kfigure" title="(in LinuxDoc v20230321)"><span class="xref std std-ref">linuxdoc</span></a> the build process
  612. is flexible. To get best results in the generated output format, install
  613. <a class="reference external" href="https://www.imagemagick.org">ImageMagick</a> and <a class="reference external" href="https://graphviz.gitlab.io">Graphviz</a>.</p>
  614. </aside>
  615. <p>Searx’s sphinx setup includes: <a class="reference external" href="https://return42.github.io/linuxdoc/linuxdoc-howto/kfigure.html#kfigure" title="(in LinuxDoc v20230321)"><span>Scalable figure and image handling</span></a>. Scalable here means;
  616. scalable in sense of the build process. Normally in absence of a converter
  617. tool, the build process will break. From the authors POV it’s annoying to care
  618. about the build process when handling with images, especially since he has no
  619. access to the build process. With <a class="reference external" href="https://return42.github.io/linuxdoc/linuxdoc-howto/kfigure.html#kfigure" title="(in LinuxDoc v20230321)"><span>Scalable figure and image handling</span></a> the build process
  620. continues and scales output quality in dependence of installed image processors.</p>
  621. <p>If you want to add an image, you should use the <code class="docutils literal notranslate"><span class="pre">kernel-figure</span></code> (inheritance
  622. of <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#figure">figure</a>) and <code class="docutils literal notranslate"><span class="pre">kernel-image</span></code> (inheritance of <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#image">image</a>)
  623. directives. E.g. to insert a figure with a scalable image format use SVG
  624. (<a class="reference internal" href="#svg-image-example"><span class="std std-ref">Simple SVG image.</span></a>):</p>
  625. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="nt">_svg image example:</span>
  626. <span class="p">..</span> <span class="ow">kernel-figure</span><span class="p">::</span> svg_image.svg
  627. <span class="nc">:alt:</span> SVG image example
  628. Simple SVG image
  629. To refer the figure, a caption block is needed: <span class="na">:ref:</span><span class="nv">`svg image example`</span>.
  630. </pre></div>
  631. </div>
  632. <figure class="align-default" id="id7">
  633. <img alt="SVG image example" src="../_images/svg_image.svg" /><figcaption>
  634. <p><span class="caption-number">Fig. 2 </span><span class="caption-text">Simple SVG image.</span><a class="headerlink" href="#id7" title="Permalink to this image">¶</a></p>
  635. </figcaption>
  636. </figure>
  637. <p>To refer the figure, a caption block is needed: <a class="reference internal" href="#svg-image-example"><span class="std std-ref">Simple SVG image.</span></a>.</p>
  638. <section id="dot-files-aka-graphviz">
  639. <h3><a class="toc-backref" href="#id30" role="doc-backlink">DOT files (aka Graphviz)</a><a class="headerlink" href="#dot-files-aka-graphviz" title="Permalink to this heading">¶</a></h3>
  640. <p>With <a class="reference external" href="https://return42.github.io/linuxdoc/linuxdoc-howto/kfigure.html#kernel-figure" title="(in LinuxDoc v20230321)"><span>kernel-figure &amp; kernel-image</span></a> reST support for <strong>DOT</strong> formatted files is
  641. given.</p>
  642. <ul class="simple">
  643. <li><p><a class="reference external" href="https://graphviz.gitlab.io/_pages/pdf/dotguide.pdf">Graphviz’s dot</a></p></li>
  644. <li><p><a class="reference external" href="https://graphviz.gitlab.io/_pages/doc/info/lang.html">DOT</a></p></li>
  645. <li><p><a class="reference external" href="https://graphviz.gitlab.io">Graphviz</a></p></li>
  646. </ul>
  647. <p>A simple example is shown in <a class="reference internal" href="#dot-file-example"><span class="std std-ref">DOT’s hello world example</span></a>:</p>
  648. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="nt">_dot file example:</span>
  649. <span class="p">..</span> <span class="ow">kernel-figure</span><span class="p">::</span> hello.dot
  650. <span class="nc">:alt:</span> hello world
  651. DOT&#39;s hello world example
  652. </pre></div>
  653. </div>
  654. <div class="rst-example admonition">
  655. <p class="admonition-title">hello.dot</p>
  656. <figure class="align-default" id="id8">
  657. <img alt="hello world" src="../_images/hello.svg" /><figcaption>
  658. <p><span class="caption-number">Fig. 3 </span><span class="caption-text">DOT’s hello world example</span><a class="headerlink" href="#id8" title="Permalink to this image">¶</a></p>
  659. </figcaption>
  660. </figure>
  661. </div>
  662. </section>
  663. <section id="kernel-render-dot">
  664. <h3><a class="toc-backref" href="#id31" role="doc-backlink"><code class="docutils literal notranslate"><span class="pre">kernel-render</span></code> DOT</a><a class="headerlink" href="#kernel-render-dot" title="Permalink to this heading">¶</a></h3>
  665. <p>Embed <em>render</em> markups (or languages) like Graphviz’s <strong>DOT</strong> is provided by the
  666. <a class="reference external" href="https://return42.github.io/linuxdoc/linuxdoc-howto/kfigure.html#kernel-render" title="(in LinuxDoc v20230321)"><span>kernel-render</span></a> directive. A simple example of embedded <a class="reference external" href="https://graphviz.gitlab.io/_pages/doc/info/lang.html">DOT</a> is
  667. shown in figure <a class="reference internal" href="#dot-render-example"><span class="std std-ref">Embedded DOT (Graphviz) code</span></a>:</p>
  668. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="nt">_dot render example:</span>
  669. <span class="p">..</span> <span class="ow">kernel-render</span><span class="p">::</span> DOT
  670. <span class="nc">:alt:</span> digraph
  671. <span class="nc">:caption:</span> Embedded DOT (Graphviz) code
  672. digraph foo {
  673. &quot;bar&quot; -&gt; &quot;baz&quot;;
  674. }
  675. Attribute <span class="s">``caption``</span> is needed, if you want to refer the figure: :ref:`dot
  676. render example`.
  677. </pre></div>
  678. </div>
  679. <p>Please note <a class="reference external" href="https://return42.github.io/linuxdoc/linuxdoc-howto/kfigure.html#kfigure-build-tools" title="(in LinuxDoc v20230321)"><span class="xref std std-ref">build tools</span></a>. If <a class="reference external" href="https://graphviz.gitlab.io">Graphviz</a> is
  680. installed, you will see an vector image. If not, the raw markup is inserted as
  681. <em>literal-block</em>.</p>
  682. <div class="rst-example admonition">
  683. <p class="admonition-title">kernel-render DOT</p>
  684. <figure class="align-default" id="id9">
  685. <span id="dot-render-example"></span><img alt="digraph" src="../_images/DOT-57a4a7f78690d0b6b884bc59f36e84cfb0b61f76.svg" /><figcaption>
  686. <p><span class="caption-number">Fig. 4 </span><span class="caption-text">Embedded DOT (Graphviz) code</span><a class="headerlink" href="#id9" title="Permalink to this image">¶</a></p>
  687. </figcaption>
  688. </figure>
  689. <p>Attribute <code class="docutils literal notranslate"><span class="pre">caption</span></code> is needed, if you want to refer the figure: <a class="reference internal" href="#dot-render-example"><span class="std std-ref">Embedded DOT (Graphviz) code</span></a>.</p>
  690. </div>
  691. </section>
  692. <section id="kernel-render-svg">
  693. <h3><a class="toc-backref" href="#id32" role="doc-backlink"><code class="docutils literal notranslate"><span class="pre">kernel-render</span></code> SVG</a><a class="headerlink" href="#kernel-render-svg" title="Permalink to this heading">¶</a></h3>
  694. <p>A simple example of embedded <a class="reference external" href="https://www.w3.org/TR/SVG11/expanded-toc.html">SVG</a> is shown in figure <a class="reference internal" href="#svg-render-example"><span class="std std-ref">Embedded SVG markup</span></a>:</p>
  695. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="nt">_svg render example:</span>
  696. <span class="p">..</span> <span class="ow">kernel-render</span><span class="p">::</span> SVG
  697. <span class="nc">:caption:</span> Embedded <span class="gs">**SVG**</span> markup
  698. <span class="nc">:alt:</span> so-nw-arrow
  699. </pre></div>
  700. </div>
  701. <blockquote>
  702. <div><div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
  703. <span class="nt">&lt;svg</span> <span class="na">xmlns=</span><span class="s">&quot;http://www.w3.org/2000/svg&quot;</span> <span class="na">version=</span><span class="s">&quot;1.1&quot;</span>
  704. <span class="na">baseProfile=</span><span class="s">&quot;full&quot;</span> <span class="na">width=</span><span class="s">&quot;70px&quot;</span> <span class="na">height=</span><span class="s">&quot;40px&quot;</span>
  705. <span class="na">viewBox=</span><span class="s">&quot;0 0 700 400&quot;</span>
  706. <span class="nt">&gt;</span>
  707. <span class="nt">&lt;line</span> <span class="na">x1=</span><span class="s">&quot;180&quot;</span> <span class="na">y1=</span><span class="s">&quot;370&quot;</span>
  708. <span class="na">x2=</span><span class="s">&quot;500&quot;</span> <span class="na">y2=</span><span class="s">&quot;50&quot;</span>
  709. <span class="na">stroke=</span><span class="s">&quot;black&quot;</span> <span class="na">stroke-width=</span><span class="s">&quot;15px&quot;</span>
  710. <span class="nt">/&gt;</span>
  711. <span class="nt">&lt;polygon</span> <span class="na">points=</span><span class="s">&quot;585 0 525 25 585 50&quot;</span>
  712. <span class="na">transform=</span><span class="s">&quot;rotate(135 525 25)&quot;</span>
  713. <span class="nt">/&gt;</span>
  714. <span class="nt">&lt;/svg&gt;</span>
  715. </pre></div>
  716. </div>
  717. </div></blockquote>
  718. <div class="rst-example admonition">
  719. <p class="admonition-title">kernel-render SVG</p>
  720. <figure class="align-default" id="id10">
  721. <span id="svg-render-example"></span><img alt="so-nw-arrow" src="../_images/SVG-1fb7029fa2cc454a267bae271cccb2c591387416.svg" /><figcaption>
  722. <p><span class="caption-number">Fig. 5 </span><span class="caption-text">Embedded <strong>SVG</strong> markup</span><a class="headerlink" href="#id10" title="Permalink to this image">¶</a></p>
  723. </figcaption>
  724. </figure>
  725. </div>
  726. </section>
  727. </section>
  728. <section id="list-markups">
  729. <span id="rest-lists"></span><h2><a class="toc-backref" href="#id33" role="doc-backlink">List markups</a><a class="headerlink" href="#list-markups" title="Permalink to this heading">¶</a></h2>
  730. <section id="bullet-list">
  731. <h3><a class="toc-backref" href="#id34" role="doc-backlink">Bullet list</a><a class="headerlink" href="#bullet-list" title="Permalink to this heading">¶</a></h3>
  732. <p>List markup (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#bullet-lists">ref</a>) is simple:</p>
  733. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="m">-</span> This is a bulleted list.
  734. <span class="m">1.</span> Nested lists are possible, but be aware that they must be separated from
  735. the parent list items by blank line
  736. <span class="m">2.</span> Second item of nested list
  737. <span class="m">-</span> It has two items, the second
  738. item uses two lines.
  739. <span class="m">#.</span> This is a numbered list.
  740. <span class="m">#.</span> It has two items too.
  741. </pre></div>
  742. </div>
  743. <div class="rst-example admonition">
  744. <p class="admonition-title">bullet list</p>
  745. <ul class="simple">
  746. <li><p>This is a bulleted list.</p>
  747. <ol class="arabic simple">
  748. <li><p>Nested lists are possible, but be aware that they must be separated from
  749. the parent list items by blank line</p></li>
  750. <li><p>Second item of nested list</p></li>
  751. </ol>
  752. </li>
  753. <li><p>It has two items, the second
  754. item uses two lines.</p></li>
  755. </ul>
  756. <ol class="arabic simple">
  757. <li><p>This is a numbered list.</p></li>
  758. <li><p>It has two items too.</p></li>
  759. </ol>
  760. </div>
  761. </section>
  762. <section id="horizontal-list">
  763. <h3><a class="toc-backref" href="#id35" role="doc-backlink">Horizontal list</a><a class="headerlink" href="#horizontal-list" title="Permalink to this heading">¶</a></h3>
  764. <p>The <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-hlist" title="(in Sphinx v6.2.0)"><code class="xref rst rst-dir docutils literal notranslate"><span class="pre">..</span> <span class="pre">hlist::</span></code></a> transforms a bullet list into a more compact
  765. list.</p>
  766. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">hlist</span><span class="p">::</span>
  767. <span class="m">-</span> first list item
  768. <span class="m">-</span> second list item
  769. <span class="m">-</span> third list item
  770. <span class="cp"> ...</span>
  771. </pre></div>
  772. </div>
  773. <div class="rst-example admonition">
  774. <p class="admonition-title">hlist</p>
  775. <table class="hlist"><tr><td><ul class="simple">
  776. <li><p>first list item</p></li>
  777. <li><p>second list item</p></li>
  778. <li><p>third list item</p></li>
  779. <li><p>next list item</p></li>
  780. </ul>
  781. </td><td><ul class="simple">
  782. <li><p>next list item xxxx</p></li>
  783. <li><p>next list item yyyy</p></li>
  784. <li><p>next list item zzzz</p></li>
  785. </ul>
  786. </td></tr></table>
  787. </div>
  788. </section>
  789. <section id="definition-list">
  790. <h3><a class="toc-backref" href="#id36" role="doc-backlink">Definition list</a><a class="headerlink" href="#definition-list" title="Permalink to this heading">¶</a></h3>
  791. <aside class="sidebar">
  792. <p class="sidebar-title">Note ..</p>
  793. <ul class="simple">
  794. <li><p>the term cannot have more than one line of text</p></li>
  795. <li><p>there is <strong>no blank line between term and definition block</strong> // this
  796. distinguishes definition lists (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#definition-lists">ref</a>) from block
  797. quotes (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#block-quotes">ref</a>).</p></li>
  798. </ul>
  799. </aside>
  800. <p>Each definition list (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#definition-lists">ref</a>) item contains a term,
  801. optional classifiers and a definition. A term is a simple one-line word or
  802. phrase. Optional classifiers may follow the term on the same line, each after
  803. an inline ‘ : ‘ (<strong>space, colon, space</strong>). A definition is a block indented
  804. relative to the term, and may contain multiple paragraphs and other body
  805. elements. There may be no blank line between a term line and a definition block
  806. (<em>this distinguishes definition lists from block quotes</em>). Blank lines are
  807. required before the first and after the last definition list item, but are
  808. optional in-between.</p>
  809. <p>Definition lists are created as follows:</p>
  810. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span>term 1 (up to a line of text)
  811. Definition 1.
  812. See the typo : this line is not a term!
  813. And this is not term&#39;s definition. <span class="gs">**There is a blank line**</span> in between
  814. the line above and this paragraph. That&#39;s why this paragraph is taken as
  815. <span class="gs">**block quote**</span> (<span class="na">:duref:</span><span class="nv">`ref &lt;block-quotes&gt;`</span>) and not as term&#39;s definition!
  816. term 2
  817. Definition 2, paragraph 1.
  818. Definition 2, paragraph 2.
  819. term 3 : classifier
  820. Definition 3.
  821. term 4 : classifier one : classifier two
  822. Definition 4.
  823. </pre></div>
  824. </div>
  825. <div class="rst-example admonition">
  826. <p class="admonition-title">definition list</p>
  827. <dl class="simple">
  828. <dt>term 1 (up to a line of text)</dt><dd><p>Definition 1.</p>
  829. </dd>
  830. </dl>
  831. <p>See the typo : this line is not a term!</p>
  832. <blockquote>
  833. <div><p>And this is not term’s definition. <strong>There is a blank line</strong> in between
  834. the line above and this paragraph. That’s why this paragraph is taken as
  835. <strong>block quote</strong> (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#block-quotes">ref</a>) and not as term’s definition!</p>
  836. </div></blockquote>
  837. <dl>
  838. <dt>term 2</dt><dd><p>Definition 2, paragraph 1.</p>
  839. <p>Definition 2, paragraph 2.</p>
  840. </dd>
  841. <dt>term 3<span class="classifier">classifier</span></dt><dd><p>Definition 3.</p>
  842. </dd>
  843. </dl>
  844. <p>term 4 : classifier one : classifier two</p>
  845. </div>
  846. </section>
  847. <section id="quoted-paragraphs">
  848. <h3><a class="toc-backref" href="#id37" role="doc-backlink">Quoted paragraphs</a><a class="headerlink" href="#quoted-paragraphs" title="Permalink to this heading">¶</a></h3>
  849. <p>Quoted paragraphs (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#block-quotes">ref</a>) are created by just indenting
  850. them more than the surrounding paragraphs. Line blocks (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#line-blocks">ref</a>) are a way of preserving line breaks:</p>
  851. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span>normal paragraph ...
  852. lorem ipsum.
  853. Quoted paragraph ...
  854. lorem ipsum.
  855. <span class="o">|</span> These lines are
  856. <span class="o">|</span> broken exactly like in
  857. <span class="o">|</span> the source file.
  858. </pre></div>
  859. </div>
  860. <div class="rst-example admonition">
  861. <p class="admonition-title">Quoted paragraph and line block</p>
  862. <p>normal paragraph …
  863. lorem ipsum.</p>
  864. <blockquote>
  865. <div><p>Quoted paragraph …
  866. lorem ipsum.</p>
  867. </div></blockquote>
  868. <div class="line-block">
  869. <div class="line">These lines are</div>
  870. <div class="line">broken exactly like in</div>
  871. <div class="line">the source file.</div>
  872. </div>
  873. </div>
  874. </section>
  875. <section id="field-lists">
  876. <span id="rest-field-list"></span><h3><a class="toc-backref" href="#id38" role="doc-backlink">Field Lists</a><a class="headerlink" href="#field-lists" title="Permalink to this heading">¶</a></h3>
  877. <aside class="sidebar">
  878. <p class="sidebar-title">bibliographic fields</p>
  879. <p>First lines fields are bibliographic fields, see <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html">Sphinx Field Lists</a>.</p>
  880. </aside>
  881. <p>Field lists are used as part of an extension syntax, such as options for
  882. directives, or database-like records meant for further processing. Field lists
  883. are mappings from field names to field bodies. They marked up like this:</p>
  884. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="nc">:fieldname:</span> Field content
  885. <span class="nc">:foo:</span> first paragraph in field foo
  886. second paragraph in field foo
  887. <span class="nc">:bar:</span> Field content
  888. </pre></div>
  889. </div>
  890. <div class="rst-example admonition">
  891. <p class="admonition-title">Field List</p>
  892. <dl class="field-list">
  893. <dt class="field-odd">fieldname<span class="colon">:</span></dt>
  894. <dd class="field-odd"><p>Field content</p>
  895. </dd>
  896. <dt class="field-even">foo<span class="colon">:</span></dt>
  897. <dd class="field-even"><p>first paragraph in field foo</p>
  898. <p>second paragraph in field foo</p>
  899. </dd>
  900. <dt class="field-odd">bar<span class="colon">:</span></dt>
  901. <dd class="field-odd"><p>Field content</p>
  902. </dd>
  903. </dl>
  904. </div>
  905. <p>They are commonly used in Python documentation:</p>
  906. <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">my_function</span><span class="p">(</span><span class="n">my_arg</span><span class="p">,</span> <span class="n">my_other_arg</span><span class="p">):</span>
  907. <span class="sd">&quot;&quot;&quot;A function just for me.</span>
  908. <span class="sd"> :param my_arg: The first of my arguments.</span>
  909. <span class="sd"> :param my_other_arg: The second of my arguments.</span>
  910. <span class="sd"> :returns: A message (just for me, of course).</span>
  911. <span class="sd"> &quot;&quot;&quot;</span>
  912. </pre></div>
  913. </div>
  914. </section>
  915. <section id="further-list-blocks">
  916. <h3><a class="toc-backref" href="#id39" role="doc-backlink">Further list blocks</a><a class="headerlink" href="#further-list-blocks" title="Permalink to this heading">¶</a></h3>
  917. <ul class="simple">
  918. <li><p>field lists (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#field-lists">ref</a>, with caveats noted in
  919. <a class="reference internal" href="#rest-field-list"><span class="std std-ref">Field Lists</span></a>)</p></li>
  920. <li><p>option lists (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#option-lists">ref</a>)</p></li>
  921. <li><p>quoted literal blocks (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#quoted-literal-blocks">ref</a>)</p></li>
  922. <li><p>doctest blocks (<a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#doctest-blocks">ref</a>)</p></li>
  923. </ul>
  924. </section>
  925. </section>
  926. <section id="admonitions">
  927. <h2><a class="toc-backref" href="#id40" role="doc-backlink">Admonitions</a><a class="headerlink" href="#admonitions" title="Permalink to this heading">¶</a></h2>
  928. <section id="sidebar">
  929. <h3><a class="toc-backref" href="#id41" role="doc-backlink">Sidebar</a><a class="headerlink" href="#sidebar" title="Permalink to this heading">¶</a></h3>
  930. <p>Sidebar is an eye catcher, often used for admonitions pointing further stuff or
  931. site effects. Here is the source of the sidebar <a class="reference internal" href="#rest-primer"><span class="std std-ref">on top of this page</span></a>.</p>
  932. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">sidebar</span><span class="p">::</span> KISS_ and readability_
  933. Instead of defining more and more roles, we at searx encourage our
  934. contributors to follow principles like KISS_ and readability_.
  935. </pre></div>
  936. </div>
  937. </section>
  938. <section id="generic-admonition">
  939. <h3><a class="toc-backref" href="#id42" role="doc-backlink">Generic admonition</a><a class="headerlink" href="#generic-admonition" title="Permalink to this heading">¶</a></h3>
  940. <p>The generic <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#admonitions">admonition</a> needs a title:</p>
  941. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">admonition</span><span class="p">::</span> generic admonition title
  942. lorem ipsum ..
  943. </pre></div>
  944. </div>
  945. <div class="admonition-generic-admonition-title admonition">
  946. <p class="admonition-title">generic admonition title</p>
  947. <p>lorem ipsum ..</p>
  948. </div>
  949. </section>
  950. <section id="specific-admonitions">
  951. <h3><a class="toc-backref" href="#id43" role="doc-backlink">Specific admonitions</a><a class="headerlink" href="#specific-admonitions" title="Permalink to this heading">¶</a></h3>
  952. <p>Specific admonitions: <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#hint">hint</a>, <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#note">note</a>, <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#tip">tip</a> <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#attention">attention</a>,
  953. <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#caution">caution</a>, <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#danger">danger</a>, <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#error">error</a>, , <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#important">important</a>, and
  954. <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#warning">warning</a> .</p>
  955. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">hint</span><span class="p">::</span>
  956. lorem ipsum ..
  957. <span class="p">..</span> <span class="ow">note</span><span class="p">::</span>
  958. lorem ipsum ..
  959. <span class="p">..</span> <span class="ow">warning</span><span class="p">::</span>
  960. lorem ipsum ..
  961. </pre></div>
  962. </div>
  963. <div class="admonition hint">
  964. <p class="admonition-title">Hint</p>
  965. <p>lorem ipsum ..</p>
  966. </div>
  967. <div class="admonition note">
  968. <p class="admonition-title">Note</p>
  969. <p>lorem ipsum ..</p>
  970. </div>
  971. <div class="admonition tip">
  972. <p class="admonition-title">Tip</p>
  973. <p>lorem ipsum ..</p>
  974. </div>
  975. <div class="admonition attention">
  976. <p class="admonition-title">Attention</p>
  977. <p>lorem ipsum ..</p>
  978. </div>
  979. <div class="admonition caution">
  980. <p class="admonition-title">Caution</p>
  981. <p>lorem ipsum ..</p>
  982. </div>
  983. <div class="admonition danger">
  984. <p class="admonition-title">Danger</p>
  985. <p>lorem ipsum ..</p>
  986. </div>
  987. <div class="admonition important">
  988. <p class="admonition-title">Important</p>
  989. <p>lorem ipsum ..</p>
  990. </div>
  991. <div class="admonition error">
  992. <p class="admonition-title">Error</p>
  993. <p>lorem ipsum ..</p>
  994. </div>
  995. <div class="admonition warning">
  996. <p class="admonition-title">Warning</p>
  997. <p>lorem ipsum ..</p>
  998. </div>
  999. </section>
  1000. </section>
  1001. <section id="tables">
  1002. <h2><a class="toc-backref" href="#id44" role="doc-backlink">Tables</a><a class="headerlink" href="#tables" title="Permalink to this heading">¶</a></h2>
  1003. <aside class="sidebar">
  1004. <p class="sidebar-title">Nested tables</p>
  1005. <p>Nested tables are ugly! Not all builder support nested tables, don’t use
  1006. them!</p>
  1007. </aside>
  1008. <p>ASCII-art tables like <a class="reference internal" href="#rest-simple-table"><span class="std std-ref">Simple tables</span></a> and <a class="reference internal" href="#rest-grid-table"><span class="std std-ref">Grid tables</span></a> might
  1009. be comfortable for readers of the text-files, but they have huge disadvantages
  1010. in the creation and modifying. First, they are hard to edit. Think about
  1011. adding a row or a column to a ASCII-art table or adding a paragraph in a cell,
  1012. it is a nightmare on big tables.</p>
  1013. <aside class="sidebar">
  1014. <p class="sidebar-title">List tables</p>
  1015. <p>For meaningful patch and diff use <a class="reference internal" href="#rest-flat-table"><span class="std std-ref">flat-table</span></a>.</p>
  1016. </aside>
  1017. <p>Second the diff of modifying ASCII-art tables is not meaningful, e.g. widening a
  1018. cell generates a diff in which also changes are included, which are only
  1019. ascribable to the ASCII-art. Anyway, if you prefer ASCII-art for any reason,
  1020. here are some helpers:</p>
  1021. <ul class="simple">
  1022. <li><p><a class="reference external" href="https://www.emacswiki.org/emacs/TableMode">Emacs Table Mode</a></p></li>
  1023. <li><p><a class="reference external" href="https://www.tablesgenerator.com/text_tables">Online Tables Generator</a></p></li>
  1024. </ul>
  1025. <section id="simple-tables">
  1026. <span id="rest-simple-table"></span><h3><a class="toc-backref" href="#id45" role="doc-backlink">Simple tables</a><a class="headerlink" href="#simple-tables" title="Permalink to this heading">¶</a></h3>
  1027. <p><a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#simple-tables">Simple tables</a> allow <em>colspan</em> but not <em>rowspan</em>. If
  1028. your table need some metadata (e.g. a title) you need to add the <code class="docutils literal notranslate"><span class="pre">..</span> <span class="pre">table::</span>
  1029. <span class="pre">directive</span></code> <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#table">(ref)</a> in front and place the table in its body:</p>
  1030. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">table</span><span class="p">::</span> foo gate truth table
  1031. <span class="nc">:widths:</span> grid
  1032. <span class="nc">:align:</span> left
  1033. ====== ====== ======
  1034. Inputs Output
  1035. ------------- ------
  1036. A B A or B
  1037. ====== ====== ======
  1038. False
  1039. --------------------
  1040. True
  1041. --------------------
  1042. True False True
  1043. (foo)
  1044. ------ ------ ------
  1045. False True
  1046. (foo)
  1047. ====== =============
  1048. </pre></div>
  1049. </div>
  1050. <div class="rst-example admonition">
  1051. <p class="admonition-title">Simple ASCII table</p>
  1052. <table class="docutils align-left" id="id11">
  1053. <caption><span class="caption-number">Table 7 </span><span class="caption-text">foo gate truth table</span><a class="headerlink" href="#id11" title="Permalink to this table">¶</a></caption>
  1054. <colgroup>
  1055. <col style="width: 33%" />
  1056. <col style="width: 33%" />
  1057. <col style="width: 33%" />
  1058. </colgroup>
  1059. <thead>
  1060. <tr class="row-odd"><th class="head" colspan="2"><p>Inputs</p></th>
  1061. <th class="head"><p>Output</p></th>
  1062. </tr>
  1063. <tr class="row-even"><th class="head"><p>A</p></th>
  1064. <th class="head"><p>B</p></th>
  1065. <th class="head"><p>A or B</p></th>
  1066. </tr>
  1067. </thead>
  1068. <tbody>
  1069. <tr class="row-odd"><td colspan="3"><p>False</p></td>
  1070. </tr>
  1071. <tr class="row-even"><td colspan="3"><p>True</p></td>
  1072. </tr>
  1073. <tr class="row-odd"><td><p>True</p></td>
  1074. <td><p>False
  1075. (foo)</p></td>
  1076. <td><p>True</p></td>
  1077. </tr>
  1078. <tr class="row-even"><td><p>False</p></td>
  1079. <td colspan="2"><p>True
  1080. (foo)</p></td>
  1081. </tr>
  1082. </tbody>
  1083. </table>
  1084. </div>
  1085. </section>
  1086. <section id="grid-tables">
  1087. <span id="rest-grid-table"></span><h3><a class="toc-backref" href="#id46" role="doc-backlink">Grid tables</a><a class="headerlink" href="#grid-tables" title="Permalink to this heading">¶</a></h3>
  1088. <p><a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#grid-tables">Grid tables</a> allow colspan <em>colspan</em> and <em>rowspan</em>:</p>
  1089. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">table</span><span class="p">::</span> grid table example
  1090. <span class="nc">:widths:</span> 1 1 5
  1091. +------------+------------+-----------+
  1092. <span class="o">|</span> Header 1 | Header 2 | Header 3 |
  1093. +============+============+===========+
  1094. <span class="o">|</span> body row 1 | column 2 | column 3 |
  1095. +------------+------------+-----------+
  1096. <span class="o">|</span> body row 2 | Cells may span columns.|
  1097. +------------+------------+-----------+
  1098. <span class="o">|</span> body row 3 | Cells may | - Cells |
  1099. +------------+ span rows. | - contain |
  1100. <span class="o">|</span> body row 4 | | - blocks. |
  1101. +------------+------------+-----------+
  1102. </pre></div>
  1103. </div>
  1104. <div class="rst-example admonition">
  1105. <p class="admonition-title">ASCII grid table</p>
  1106. <table class="docutils align-default" id="id12">
  1107. <caption><span class="caption-number">Table 8 </span><span class="caption-text">grid table example</span><a class="headerlink" href="#id12" title="Permalink to this table">¶</a></caption>
  1108. <colgroup>
  1109. <col style="width: 14%" />
  1110. <col style="width: 14%" />
  1111. <col style="width: 71%" />
  1112. </colgroup>
  1113. <thead>
  1114. <tr class="row-odd"><th class="head"><p>Header 1</p></th>
  1115. <th class="head"><p>Header 2</p></th>
  1116. <th class="head"><p>Header 3</p></th>
  1117. </tr>
  1118. </thead>
  1119. <tbody>
  1120. <tr class="row-even"><td><p>body row 1</p></td>
  1121. <td><p>column 2</p></td>
  1122. <td><p>column 3</p></td>
  1123. </tr>
  1124. <tr class="row-odd"><td><p>body row 2</p></td>
  1125. <td colspan="2"><p>Cells may span columns.</p></td>
  1126. </tr>
  1127. <tr class="row-even"><td><p>body row 3</p></td>
  1128. <td rowspan="2"><p>Cells may
  1129. span rows.</p></td>
  1130. <td rowspan="2"><ul class="simple">
  1131. <li><p>Cells</p></li>
  1132. <li><p>contain</p></li>
  1133. <li><p>blocks.</p></li>
  1134. </ul>
  1135. </td>
  1136. </tr>
  1137. <tr class="row-odd"><td><p>body row 4</p></td>
  1138. </tr>
  1139. </tbody>
  1140. </table>
  1141. </div>
  1142. </section>
  1143. <section id="flat-table">
  1144. <span id="rest-flat-table"></span><h3><a class="toc-backref" href="#id47" role="doc-backlink">flat-table</a><a class="headerlink" href="#flat-table" title="Permalink to this heading">¶</a></h3>
  1145. <p>The <code class="docutils literal notranslate"><span class="pre">flat-table</span></code> is a further developed variant of the <a class="reference external" href="https://return42.github.io/linuxdoc/linuxdoc-howto/table-markup.html#list-table-directives" title="(in LinuxDoc v20230321)"><span class="xref std std-ref">list tables</span></a>. It is a double-stage list similar to the
  1146. <a class="reference external" href="https://docutils.sourceforge.net/docs/ref/rst/directives.html#list-table">list-table</a> with some additional features:</p>
  1147. <dl class="simple">
  1148. <dt>column-span: <code class="docutils literal notranslate"><span class="pre">cspan</span></code></dt><dd><p>with the role <code class="docutils literal notranslate"><span class="pre">cspan</span></code> a cell can be extended through additional columns</p>
  1149. </dd>
  1150. <dt>row-span: <code class="docutils literal notranslate"><span class="pre">rspan</span></code></dt><dd><p>with the role <code class="docutils literal notranslate"><span class="pre">rspan</span></code> a cell can be extended through additional rows</p>
  1151. </dd>
  1152. <dt>auto-span:</dt><dd><p>spans rightmost cell of a table row over the missing cells on the right side
  1153. of that table-row. With Option <code class="docutils literal notranslate"><span class="pre">:fill-cells:</span></code> this behavior can changed
  1154. from <em>auto span</em> to <em>auto fill</em>, which automatically inserts (empty) cells
  1155. instead of spanning the last cell.</p>
  1156. </dd>
  1157. <dt>options:</dt><dd><dl class="field-list simple">
  1158. <dt class="field-odd">header-rows<span class="colon">:</span></dt>
  1159. <dd class="field-odd"><p>[int] count of header rows</p>
  1160. </dd>
  1161. <dt class="field-even">stub-columns<span class="colon">:</span></dt>
  1162. <dd class="field-even"><p>[int] count of stub columns</p>
  1163. </dd>
  1164. <dt class="field-odd">widths<span class="colon">:</span></dt>
  1165. <dd class="field-odd"><p>[[int] [int] … ] widths of columns</p>
  1166. </dd>
  1167. <dt class="field-even">fill-cells<span class="colon">:</span></dt>
  1168. <dd class="field-even"><p>instead of auto-span missing cells, insert missing cells</p>
  1169. </dd>
  1170. </dl>
  1171. </dd>
  1172. <dt>roles:</dt><dd><dl class="field-list simple">
  1173. <dt class="field-odd">cspan<span class="colon">:</span></dt>
  1174. <dd class="field-odd"><p>[int] additional columns (<em>morecols</em>)</p>
  1175. </dd>
  1176. <dt class="field-even">rspan<span class="colon">:</span></dt>
  1177. <dd class="field-even"><p>[int] additional rows (<em>morerows</em>)</p>
  1178. </dd>
  1179. </dl>
  1180. </dd>
  1181. </dl>
  1182. <p>The example below shows how to use this markup. The first level of the staged
  1183. list is the <em>table-row</em>. In the <em>table-row</em> there is only one markup allowed,
  1184. the list of the cells in this <em>table-row</em>. Exception are <em>comments</em> ( <code class="docutils literal notranslate"><span class="pre">..</span></code> )
  1185. and <em>targets</em> (e.g. a ref to <a class="reference internal" href="#row-body-2"><span class="std std-ref">row 2 of table’s body</span></a>).</p>
  1186. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">flat-table</span><span class="p">::</span> <span class="s">``flat-table``</span> example
  1187. <span class="nc">:header-rows:</span> 2
  1188. <span class="nc">:stub-columns:</span> 1
  1189. <span class="nc">:widths:</span> 1 1 1 1 2
  1190. <span class="m">*</span> - <span class="na">:rspan:</span><span class="nv">`1`</span> head / stub
  1191. <span class="m">-</span> <span class="na">:cspan:</span><span class="nv">`3`</span> head 1.1-4
  1192. <span class="m">*</span> - head 2.1
  1193. <span class="m">-</span> head 2.2
  1194. <span class="m">-</span> head 2.3
  1195. <span class="m">-</span> head 2.4
  1196. <span class="m">*</span> .. row body 1 / this is a comment
  1197. <span class="m">-</span> row 1
  1198. <span class="m">-</span> <span class="na">:rspan:</span><span class="nv">`2`</span> cell 1-3.1
  1199. <span class="m">-</span> cell 1.2
  1200. <span class="m">-</span> cell 1.3
  1201. <span class="m">-</span> cell 1.4
  1202. <span class="m">*</span> .. Comments and targets are allowed on <span class="ge">*table-row*</span> stage.
  1203. <span class="p"> ..</span> <span class="nt">_`row body 2`:</span>
  1204. <span class="m">-</span> row 2
  1205. <span class="m">-</span> cell 2.2
  1206. <span class="m">-</span> <span class="na">:rspan:</span><span class="nv">`1`</span> <span class="na">:cspan:</span><span class="nv">`1`</span>
  1207. cell 2.3 with a span over
  1208. <span class="m">*</span> col 3-4 &amp;
  1209. <span class="m">*</span> row 2-3
  1210. <span class="m">*</span> - row 3
  1211. <span class="m">-</span> cell 3.2
  1212. <span class="m">*</span> - row 4
  1213. <span class="m">-</span> cell 4.1
  1214. <span class="m">-</span> cell 4.2
  1215. <span class="m">-</span> cell 4.3
  1216. <span class="m">-</span> cell 4.4
  1217. <span class="m">*</span> - row 5
  1218. <span class="m">-</span> cell 5.1 with automatic span to right end
  1219. <span class="m">*</span> - row 6
  1220. <span class="m">-</span> cell 6.1
  1221. <span class="m">-</span> ..
  1222. </pre></div>
  1223. </div>
  1224. <div class="rst-example admonition">
  1225. <p class="admonition-title">List table</p>
  1226. <table class="docutils align-default" id="id13">
  1227. <caption><span class="caption-number">Table 9 </span><span class="caption-text"><code class="docutils literal notranslate"><span class="pre">flat-table</span></code> example</span><a class="headerlink" href="#id13" title="Permalink to this table">¶</a></caption>
  1228. <colgroup>
  1229. <col style="width: 17%" />
  1230. <col style="width: 17%" />
  1231. <col style="width: 17%" />
  1232. <col style="width: 17%" />
  1233. <col style="width: 33%" />
  1234. </colgroup>
  1235. <thead>
  1236. <tr class="row-odd"><th class="head stub" rowspan="2"><p> head / stub</p></th>
  1237. <th class="head" colspan="4"><p> head 1.1-4</p></th>
  1238. </tr>
  1239. <tr class="row-even"><th class="head stub"><p>head 2.1</p></th>
  1240. <th class="head"><p>head 2.2</p></th>
  1241. <th class="head"><p>head 2.3</p></th>
  1242. <th class="head"><p>head 2.4</p></th>
  1243. </tr>
  1244. </thead>
  1245. <tbody>
  1246. <tr class="row-odd"><th class="stub"><p>row 1</p></th>
  1247. <td rowspan="3"><p> cell 1-3.1</p></td>
  1248. <td><p>cell 1.2</p></td>
  1249. <td><p>cell 1.3</p></td>
  1250. <td><p>cell 1.4</p></td>
  1251. </tr>
  1252. <tr class="row-even"><th class="stub"><p>row 2</p>
  1253. </th>
  1254. <td><p>cell 2.2</p>
  1255. </td>
  1256. <td colspan="2" rowspan="2"><p id="row-body-2">
  1257. cell 2.3 with a span over</p>
  1258. <ul class="simple">
  1259. <li><p>col 3-4 &amp;</p></li>
  1260. <li><p>row 2-3</p></li>
  1261. </ul>
  1262. </td>
  1263. </tr>
  1264. <tr class="row-odd"><th class="stub"><p>row 3</p></th>
  1265. <td><p>cell 3.2</p></td>
  1266. </tr>
  1267. <tr class="row-even"><th class="stub"><p>row 4</p></th>
  1268. <td><p>cell 4.1</p></td>
  1269. <td><p>cell 4.2</p></td>
  1270. <td><p>cell 4.3</p></td>
  1271. <td><p>cell 4.4</p></td>
  1272. </tr>
  1273. <tr class="row-odd"><th class="stub"><p>row 5</p></th>
  1274. <td colspan="4"><p>cell 5.1 with automatic span to right end</p></td>
  1275. </tr>
  1276. <tr class="row-even"><th class="stub"><p>row 6</p></th>
  1277. <td><p>cell 6.1</p></td>
  1278. <td colspan="3"></td>
  1279. </tr>
  1280. </tbody>
  1281. </table>
  1282. </div>
  1283. </section>
  1284. <section id="csv-table">
  1285. <h3><a class="toc-backref" href="#id48" role="doc-backlink">CSV table</a><a class="headerlink" href="#csv-table" title="Permalink to this heading">¶</a></h3>
  1286. <p>CSV table might be the choice if you want to include CSV-data from a outstanding
  1287. (build) process into your documentation.</p>
  1288. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">csv-table</span><span class="p">::</span> CSV table example
  1289. <span class="nc">:header:</span> .. , Column 1, Column 2
  1290. <span class="nc">:widths:</span> 2 5 5
  1291. <span class="nc">:stub-columns:</span> 1
  1292. <span class="nc">:file:</span> csv_table.txt
  1293. </pre></div>
  1294. </div>
  1295. <p>Content of file <code class="docutils literal notranslate"><span class="pre">csv_table.txt</span></code>:</p>
  1296. <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>stub col row 1, column, &quot;loremLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
  1297. eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
  1298. voluptua.&quot;
  1299. stub col row 1, &quot;At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
  1300. kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.&quot;, column
  1301. stub col row 1, column, column
  1302. </pre></div>
  1303. </div>
  1304. <div class="rst-example admonition">
  1305. <p class="admonition-title">CSV table</p>
  1306. <table class="docutils align-default" id="id14">
  1307. <caption><span class="caption-number">Table 10 </span><span class="caption-text">CSV table example</span><a class="headerlink" href="#id14" title="Permalink to this table">¶</a></caption>
  1308. <colgroup>
  1309. <col style="width: 23%" />
  1310. <col style="width: 38%" />
  1311. <col style="width: 38%" />
  1312. </colgroup>
  1313. <thead>
  1314. <tr class="row-odd"><th class="head stub"></th>
  1315. <th class="head"><p>Column 1</p></th>
  1316. <th class="head"><p>Column 2</p></th>
  1317. </tr>
  1318. </thead>
  1319. <tbody>
  1320. <tr class="row-even"><th class="stub"><p>stub col row 1</p></th>
  1321. <td><p>column</p></td>
  1322. <td><p>loremLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
  1323. eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
  1324. voluptua.</p></td>
  1325. </tr>
  1326. <tr class="row-odd"><th class="stub"><p>stub col row 1</p></th>
  1327. <td><p>At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
  1328. kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p></td>
  1329. <td><p>column</p></td>
  1330. </tr>
  1331. <tr class="row-even"><th class="stub"><p>stub col row 1</p></th>
  1332. <td><p>column</p></td>
  1333. <td><p>column</p></td>
  1334. </tr>
  1335. </tbody>
  1336. </table>
  1337. </div>
  1338. </section>
  1339. </section>
  1340. <section id="templating">
  1341. <h2><a class="toc-backref" href="#id49" role="doc-backlink">Templating</a><a class="headerlink" href="#templating" title="Permalink to this heading">¶</a></h2>
  1342. <aside class="sidebar">
  1343. <p class="sidebar-title">Build environment</p>
  1344. <p>All <em>generic-doc</em> tasks are running in the <a class="reference internal" href="makefile.html#make-install"><span class="std std-ref">Python environment</span></a>.</p>
  1345. </aside>
  1346. <p>Templating is suitable for documentation which is created generic at the build
  1347. time. The <a class="reference external" href="https://github.com/tardyp/sphinx-jinja">sphinx-jinja</a> extension evaluates <a class="reference external" href="https://jinja.palletsprojects.com/">jinja</a> templates in the <a class="reference internal" href="makefile.html#make-install"><span class="std std-ref">Python environment</span></a> (with searx modules installed). We use this e.g. to build chapter:
  1348. <a class="reference internal" href="../admin/engines.html#engines-generic"><span class="std std-ref">General Engine Settings</span></a>. Below the jinja directive from the
  1349. <a class="reference external" href="https://github.com/searx/searx/blob/master/docs/admin/engines.rst">Origin: docs/admin/engines.rst</a> is shown:</p>
  1350. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">jinja</span><span class="p">::</span> searx
  1351. <span class="p"> ..</span> <span class="ow">flat-table</span><span class="p">::</span> Engines configured at built time (defaults)
  1352. <span class="nc">:header-rows:</span> 1
  1353. <span class="nc">:stub-columns:</span> 2
  1354. <span class="m">*</span> - Name (cfg)
  1355. <span class="m">-</span> S
  1356. <span class="m">-</span> Engine
  1357. <span class="m">-</span> TO
  1358. <span class="m">-</span> Categories
  1359. <span class="m">-</span> P
  1360. <span class="m">-</span> L
  1361. <span class="m">-</span> SS
  1362. <span class="m">-</span> D
  1363. <span class="m">-</span> TR
  1364. <span class="m">-</span> ET
  1365. <span class="m">-</span> W
  1366. <span class="m">-</span> D
  1367. <span class="m">-</span> DE
  1368. {% for name, mod in engines.items() %}
  1369. <span class="m">*</span> - {{name}}
  1370. <span class="m">-</span> !{{mod.shortcut}}
  1371. <span class="m">-</span> {{mod.__name__}}
  1372. <span class="m">-</span> {{mod.timeout}}
  1373. <span class="m">-</span> {{&quot;, &quot;.join(mod.categories)}}
  1374. <span class="m">-</span> {{(mod.paging and &quot;y&quot;) or &quot;&quot;}}
  1375. <span class="m">-</span> {{(mod.language_support and &quot;y&quot;) or &quot;&quot;}}
  1376. <span class="m">-</span> {{(mod.safesearch and &quot;y&quot;) or &quot;&quot;}}
  1377. <span class="m">-</span> {{(mod.disabled and &quot;y&quot;) or &quot;&quot;}}
  1378. <span class="m">-</span> {{(mod.time_range_support and &quot;y&quot;) or &quot;&quot;}}
  1379. <span class="m">-</span> {{mod.engine_type or &quot;&quot;}}
  1380. <span class="m">-</span> {{mod.weight or 1 }}
  1381. <span class="m">-</span> {{(mod.disabled and &quot;y&quot;) or &quot;&quot;}}
  1382. <span class="m">-</span> {{(mod.display_error_messages and &quot;y&quot;) or &quot;&quot;}}
  1383. {% endfor %}
  1384. <span class="p"> ..</span> <span class="ow">flat-table</span><span class="p">::</span> Additional engines (commented out in settings.yml)
  1385. <span class="nc">:header-rows:</span> 1
  1386. <span class="nc">:stub-columns:</span> 2
  1387. <span class="m">*</span> - Name
  1388. <span class="m">-</span> Base URL
  1389. <span class="m">-</span> Host
  1390. <span class="m">-</span> Port
  1391. <span class="m">-</span> Paging
  1392. <span class="m">*</span> - elasticsearch
  1393. <span class="m">-</span> localhost:9200
  1394. -
  1395. -
  1396. <span class="m">-</span> False
  1397. <span class="m">*</span> - meilicsearch
  1398. <span class="m">-</span> localhost:7700
  1399. -
  1400. -
  1401. <span class="m">-</span> True
  1402. <span class="m">*</span> - mongodb
  1403. -
  1404. <span class="m">-</span> 127.0.0.1
  1405. <span class="m">-</span> 21017
  1406. <span class="m">-</span> True
  1407. <span class="m">*</span> - mysql_server
  1408. -
  1409. <span class="m">-</span> 127.0.0.1
  1410. <span class="m">-</span> 3306
  1411. <span class="m">-</span> True
  1412. <span class="m">*</span> - postgresql
  1413. -
  1414. <span class="m">-</span> 127.0.0.1
  1415. <span class="m">-</span> 5432
  1416. <span class="m">-</span> True
  1417. <span class="m">*</span> - redis_server
  1418. -
  1419. <span class="m">-</span> 127.0.0.1
  1420. <span class="m">-</span> 6379
  1421. <span class="m">-</span> False
  1422. <span class="m">*</span> - solr
  1423. <span class="m">-</span> localhost:8983
  1424. -
  1425. -
  1426. <span class="m">-</span> True
  1427. <span class="m">*</span> - sqlite
  1428. -
  1429. -
  1430. -
  1431. <span class="m">-</span> True
  1432. </pre></div>
  1433. </div>
  1434. <p>The context for the template is selected in the line <code class="docutils literal notranslate"><span class="pre">..</span> <span class="pre">jinja::</span> <span class="pre">searx</span></code>. In
  1435. sphinx’s build configuration (<a class="reference external" href="https://github.com/searx/searx/blob/master/docs/conf.py">Origin: docs/conf.py</a>) the <code class="docutils literal notranslate"><span class="pre">searx</span></code> context
  1436. contains the <code class="docutils literal notranslate"><span class="pre">engines</span></code> and <code class="docutils literal notranslate"><span class="pre">plugins</span></code>.</p>
  1437. <div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">searx.search</span>
  1438. <span class="kn">import</span> <span class="nn">searx.engines</span>
  1439. <span class="kn">import</span> <span class="nn">searx.plugins</span>
  1440. <span class="n">searx</span><span class="o">.</span><span class="n">search</span><span class="o">.</span><span class="n">initialize</span><span class="p">()</span>
  1441. <span class="n">jinja_contexts</span> <span class="o">=</span> <span class="p">{</span>
  1442. <span class="s1">&#39;searx&#39;</span><span class="p">:</span> <span class="p">{</span>
  1443. <span class="s1">&#39;engines&#39;</span><span class="p">:</span> <span class="n">searx</span><span class="o">.</span><span class="n">engines</span><span class="o">.</span><span class="n">engines</span><span class="p">,</span>
  1444. <span class="s1">&#39;plugins&#39;</span><span class="p">:</span> <span class="n">searx</span><span class="o">.</span><span class="n">plugins</span><span class="o">.</span><span class="n">plugins</span>
  1445. <span class="p">},</span>
  1446. <span class="p">}</span>
  1447. </pre></div>
  1448. </div>
  1449. </section>
  1450. <section id="tabbed-views">
  1451. <h2><a class="toc-backref" href="#id50" role="doc-backlink">Tabbed views</a><a class="headerlink" href="#tabbed-views" title="Permalink to this heading">¶</a></h2>
  1452. <p>With <a class="reference external" href="https://github.com/djungelorm/sphinx-tabs">sphinx-tabs</a> extension we have <em>tabbed views</em>. To provide installation
  1453. instructions with one tab per distribution we use the <a class="reference external" href="https://github.com/djungelorm/sphinx-tabs#group-tabs">group-tabs</a> directive,
  1454. others are <a class="reference external" href="https://github.com/djungelorm/sphinx-tabs#basic-tabs">basic-tabs</a> and <a class="reference external" href="https://github.com/djungelorm/sphinx-tabs#code-tabs">code-tabs</a>. Below a <em>group-tab</em> example from
  1455. <a class="reference internal" href="../admin/buildhosts.html#docs-build"><span class="std std-ref">Build docs</span></a> is shown:</p>
  1456. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">tabs</span><span class="p">::</span>
  1457. <span class="p"> ..</span> <span class="ow">group-tab</span><span class="p">::</span> Ubuntu / debian
  1458. <span class="p"> ..</span> <span class="ow">code-block</span><span class="p">::</span> <span class="k">sh</span>
  1459. $ sudo apt install shellcheck
  1460. <span class="p"> ..</span> <span class="ow">group-tab</span><span class="p">::</span> Arch Linux
  1461. <span class="p"> ..</span> <span class="ow">code-block</span><span class="p">::</span> <span class="k">sh</span>
  1462. $ sudo pacman -S shellcheck
  1463. <span class="p"> ..</span> <span class="ow">group-tab</span><span class="p">::</span> Fedora / RHEL
  1464. <span class="p"> ..</span> <span class="ow">code-block</span><span class="p">::</span> sh
  1465. $ sudo dnf install ShellCheck
  1466. </pre></div>
  1467. </div>
  1468. </section>
  1469. <section id="math-equations">
  1470. <span id="math"></span><h2><a class="toc-backref" href="#id51" role="doc-backlink">Math equations</a><a class="headerlink" href="#math-equations" title="Permalink to this heading">¶</a></h2>
  1471. <aside class="sidebar">
  1472. <p class="sidebar-title">About LaTeX</p>
  1473. <ul class="simple">
  1474. <li><p><a class="reference external" href="http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/macros/latex/required/amsmath/amsldoc.pdf">amsmath user guide</a></p></li>
  1475. <li><p><a class="reference external" href="https://en.wikibooks.org/wiki/LaTeX/Mathematics">Mathematics</a></p></li>
  1476. <li><p><a class="reference internal" href="../admin/buildhosts.html#docs-build"><span class="std std-ref">Build docs</span></a></p></li>
  1477. </ul>
  1478. </aside>
  1479. <p>The input language for mathematics is LaTeX markup using the <a class="reference external" href="https://ctan.org/pkg/amsmath">CTAN: amsmath</a>
  1480. package.</p>
  1481. <p>To embed LaTeX markup in reST documents, use role <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-math" title="(in Sphinx v6.2.0)"><code class="xref rst rst-role docutils literal notranslate"><span class="pre">:math:</span></code></a> for
  1482. inline and directive <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-math" title="(in Sphinx v6.2.0)"><code class="xref rst rst-dir docutils literal notranslate"><span class="pre">..</span> <span class="pre">math::</span></code></a> for block markup.</p>
  1483. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span>In <span class="na">:math:numref:</span><span class="nv">`schroedinger general`</span> the time-dependent Schrödinger equation
  1484. is shown.
  1485. <span class="p">..</span> <span class="ow">math</span><span class="p">::</span>
  1486. <span class="nc">:label:</span> schroedinger general
  1487. \mathrm{i}\hbar\dfrac{\partial}{\partial t} |\,\psi (t) \rangle =
  1488. \hat{H} |\,\psi (t) \rangle.
  1489. </pre></div>
  1490. </div>
  1491. <div class="rst-example admonition">
  1492. <p class="admonition-title">LaTeX math equation</p>
  1493. <p>In <a class="reference internal" href="#equation-schroedinger-general">(1)</a> the time-dependent Schrödinger equation
  1494. is shown.</p>
  1495. <div class="math" id="equation-schroedinger-general">
  1496. <p><span class="eqno">(1)<a class="headerlink" href="#equation-schroedinger-general" title="Permalink to this equation">¶</a></span><img src="_images/math/a6a994cb6e7278ec30eaebe7e636046d3deccb5b.svg" alt="\mathrm{i}\hbar\dfrac{\partial}{\partial t} |\,\psi (t) \rangle =
  1497. \hat{H} |\,\psi (t) \rangle."/></p>
  1498. </div></div>
  1499. <p>The next example shows the difference of <code class="docutils literal notranslate"><span class="pre">\tfrac</span></code> (<em>textstyle</em>) and <code class="docutils literal notranslate"><span class="pre">\dfrac</span></code>
  1500. (<em>displaystyle</em>) used in a inline markup or another fraction.</p>
  1501. <div class="highlight-reST notranslate"><div class="highlight"><pre><span></span><span class="s">``\tfrac``</span> <span class="gs">**inline example**</span> <span class="na">:math:</span><span class="nv">`\tfrac{\tfrac{1}{x}+\tfrac{1}{y}}{y-z}`</span>
  1502. <span class="s">``\dfrac``</span> <span class="gs">**inline example**</span> <span class="na">:math:</span><span class="nv">`\dfrac{\dfrac{1}{x}+\dfrac{1}{y}}{y-z}`</span>
  1503. </pre></div>
  1504. </div>
  1505. <div class="rst-example admonition">
  1506. <p class="admonition-title">Line spacing</p>
  1507. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
  1508. eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
  1509. voluptua. …
  1510. <code class="docutils literal notranslate"><span class="pre">\tfrac</span></code> <strong>inline example</strong> <img class="math" src="_images/math/3b8127a8eed95247f9249ea6c85e8e86df1baa82.svg" alt="\tfrac{\tfrac{1}{x}+\tfrac{1}{y}}{y-z}"/>
  1511. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
  1512. gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
  1513. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
  1514. eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
  1515. voluptua. …
  1516. <code class="docutils literal notranslate"><span class="pre">\tfrac</span></code> <strong>inline example</strong> <img class="math" src="_images/math/07c9ff4251510b06013159f4e45ec9ab97044096.svg" alt="\dfrac{\dfrac{1}{x}+\dfrac{1}{y}}{y-z}"/>
  1517. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
  1518. gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
  1519. </div>
  1520. </section>
  1521. </section>
  1522. <div class="clearer"></div>
  1523. </div>
  1524. </div>
  1525. </div>
  1526. <span id="sidebar-top"></span>
  1527. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  1528. <div class="sphinxsidebarwrapper">
  1529. <p class="logo"><a href="../index.html">
  1530. <img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
  1531. </a></p>
  1532. <h3>Project Links</h3>
  1533. <ul>
  1534. <li><a href="https://searx.github.io/searx/blog/index.html">Blog</a>
  1535. <li><a href="https://github.com/searx/searx">Source</a>
  1536. <li><a href="https://github.com/searx/searx/wiki">Wiki</a>
  1537. <li><a href="https://twitter.com/Searx_engine">Twitter</a>
  1538. <li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
  1539. </ul><h3>Navigation</h3>
  1540. <ul>
  1541. <li><a href="../index.html">Overview</a>
  1542. <ul>
  1543. <li><a href="index.html">Developer documentation</a>
  1544. <ul>
  1545. <li>Previous: <a href="makefile.html" title="previous chapter">Makefile</a>
  1546. <li>Next: <a href="../searx_extra/index.html" title="next chapter">Tooling box <code class="docutils literal notranslate"><span class="pre">searx_extra</span></code> for developers and users</a></ul>
  1547. </li>
  1548. </ul>
  1549. </li>
  1550. </ul>
  1551. <div id="searchbox" style="display: none" role="search">
  1552. <h3 id="searchlabel">Quick search</h3>
  1553. <div class="searchformwrapper">
  1554. <form class="search" action="../search.html" method="get">
  1555. <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  1556. <input type="submit" value="Go" />
  1557. </form>
  1558. </div>
  1559. </div>
  1560. <script>document.getElementById('searchbox').style.display = "block"</script>
  1561. </div>
  1562. </div>
  1563. <div class="clearer"></div>
  1564. </div>
  1565. <div class="footer" role="contentinfo">
  1566. &#169; Copyright 2015-2022, Adam Tauber, Noémi Ványi.
  1567. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
  1568. </div>
  1569. <script src="../_static/version_warning_offset.js"></script>
  1570. </body>
  1571. </html>