Browse Source

Increased line height of ToC

pull/187/head
Jure Šorn 7 months ago
parent
commit
27d19f92bb
3 changed files with 6 additions and 5 deletions
  1. 6
      index.html
  2. 2
      parse.js
  3. 3
      web/script_2.js

6
index.html

@ -54,7 +54,7 @@
<body>
<header>
<aside>April 18, 2024</aside>
<aside>April 19, 2024</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</header>
@ -79,7 +79,7 @@
}
document.getElementsByClassName("banner")[1].firstChild.replaceWith(img_dark);
}
</script><br><div><h2 id="toc"><a href="#toc" name="toc">#</a>Contents</h2><pre><code class="hljs bash" style="line-height: 1.3em;"><strong>ToC</strong> = {
</script><br><div><h2 id="toc"><a href="#toc" name="toc">#</a>Contents</h2><pre><code class="hljs bash" style="line-height: 1.327em;"><strong>ToC</strong> = {
<strong><span class="hljs-string"><span class="hljs-string">'1. Collections'</span></span></strong>: [<a href="#list">List</a>, <a href="#dictionary">Dictionary</a>, <a href="#set">Set</a>, <a href="#tuple">Tuple</a>, <a href="#range">Range</a>, <a href="#enumerate">Enumerate</a>, <a href="#iterator">Iterator</a>, <a href="#generator">Generator</a>],
<strong><span class="hljs-string"><span class="hljs-string">'2. Types'</span></span></strong>: [<a href="#type">Type</a>, <a href="#string">String</a>, <a href="#regex">Regular_Exp</a>, <a href="#format">Format</a>, <a href="#numbers">Numbers</a>, <a href="#combinatorics">Combinatorics</a>, <a href="#datetime">Datetime</a>],
<strong><span class="hljs-string"><span class="hljs-string">'3. Syntax'</span></span></strong>: [<a href="#arguments">Args</a>, <a href="#inline">Inline</a>, <a href="#imports">Import</a>, <a href="#decorator">Decorator</a>, <a href="#class">Class</a>, <a href="#ducktypes">Duck_Types</a>, <a href="#enum">Enum</a>, <a href="#exceptions">Exception</a>],
@ -2932,7 +2932,7 @@ $ deactivate <span class="hljs-comment"># Deactivates the activ
<footer>
<aside>April 18, 2024</aside>
<aside>April 19, 2024</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</footer>

2
parse.js

@ -32,7 +32,7 @@ const hljs = require('highlightjs');
const TOC =
'<br>' +
'<h2 id="toc">Contents</h2>\n' +
'<pre><code class="hljs bash" style="line-height: 1.3em;"><strong>ToC</strong> = {\n' +
'<pre><code class="hljs bash" style="line-height: 1.327em;"><strong>ToC</strong> = {\n' +
' <strong><span class="hljs-string">\'1. Collections\'</span></strong>: [<a href="#list">List</a>, <a href="#dictionary">Dictionary</a>, <a href="#set">Set</a>, <a href="#tuple">Tuple</a>, <a href="#range">Range</a>, <a href="#enumerate">Enumerate</a>, <a href="#iterator">Iterator</a>, <a href="#generator">Generator</a>],\n' +
' <strong><span class="hljs-string">\'2. Types\'</span></strong>: [<a href="#type">Type</a>, <a href="#string">String</a>, <a href="#regex">Regular_Exp</a>, <a href="#format">Format</a>, <a href="#numbers">Numbers</a>, <a href="#combinatorics">Combinatorics</a>, <a href="#datetime">Datetime</a>],\n' +
' <strong><span class="hljs-string">\'3. Syntax\'</span></strong>: [<a href="#arguments">Args</a>, <a href="#inline">Inline</a>, <a href="#imports">Import</a>, <a href="#decorator">Decorator</a>, <a href="#class">Class</a>, <a href="#ducktypes">Duck_Types</a>, <a href="#enum">Enum</a>, <a href="#exceptions">Exception</a>],\n' +

3
web/script_2.js

@ -55,6 +55,7 @@ if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine
var TOC_SCREEN_WIDTH_CUTOFF = 667
var TOC_EM = '2em'
var TOC_EM_DESKTOP = '1.327em'
if (isMobile && window.screen.width < TOC_SCREEN_WIDTH_CUTOFF) {
$(`code:contains(ToC)`).html(TOC_MOBILE).css("line-height", TOC_EM);
@ -64,7 +65,7 @@ function updateToc() {
if (isMobile && window.screen.width < TOC_SCREEN_WIDTH_CUTOFF) {
$(`code:contains(ToC)`).html(TOC_MOBILE).css("line-height", TOC_EM);
} else {
$(`code:contains(ToC)`).html(TOC).css("line-height", TOC_EM);
$(`code:contains(ToC)`).html(TOC).css("line-height", TOC_EM_DESKTOP);
}
}
window.addEventListener("orientationchange", updateToc, false);

Loading…
Cancel
Save