# HTML rendered for doc.item's seeSrc variable. Note that this will render to
# the empty string if you don't pass anything through --git.url. Available
# substitutaion variables here are:
# * $commit: branch/commit to use in source link.
# * $devel: branch to use in edit link.
# * $path: relative path to the file being processed.
# * $line: line of the item in the original source file.
# * $url: whatever you did pass through the --git.url switch (which also
#   gets variables path/line replaced!)
doc.item.seesrc = """&nbsp;&nbsp;<a
href="${url}/src/${commit}/${path}#L${line}"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="${url}/_edit/${devel}/${path}#L${line}" class="link-seesrc" target="_blank" >Edit</a>
"""

# HACK: we're using "$theindexhref/FIXME/" to mean documentation root
# and we're making a substitution in gendocs.sh

doc.body_toc_group = """
<style>
  .simple { overflow-wrap: break-word; }
</style>
<div class="row">
  <div class="three columns">
  <div class="theme-switch-wrapper">
    <label class="theme-switch" for="checkbox">
      <input type="checkbox" id="checkbox" />
      <div class="slider round"></div>
    </label>
    &nbsp;&nbsp;&nbsp; <em>Dark Mode</em>
  </div>
  <div id="global-links">
    <ul class="simple">
    <li><a href="$theindexhref/FIXME/manual.html">Manual</a></li>
    <li><a href="$theindexhref/FIXME/modules.html">API reference</a></li>
    <li><a href="$theindexhref">Index</a></li>
    </ul>
  </div>
  <div id="searchInputDiv">
    Search: <input type="text" id="searchInput"
      onkeyup="search()" />
  </div>
  <div>
    Group by:
    <select onchange="groupBy(this.value)">
      <option value="section">Section</option>
      <option value="type">Type</option>
    </select>
  </div>
  $tableofcontents
  </div>
  $seeSrc
  <div class="nine columns" id="content">
  <div id="tocRoot"></div>
  $deprecationMsg
  <p class="module-desc">$moduledesc</p>
  $content
  </div>
</div>
"""

doc.body_toc %= "${doc.body_toc_group}" # should only be used for boot