From bf2959ac6915bce5bdb2d017f12dab2a4b9e5811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 21 Jul 2019 01:26:11 +0200 Subject: [PATCH] Made libraries title unbreakable --- index.html | 20 ++++++++++---------- parse.js | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 429be43..a33cefb 100644 --- a/index.html +++ b/index.html @@ -206,12 +206,7 @@ pre.prettyprint {

Comprehensive Python Cheatsheet


- - - - -

#Contents

ToC = {
+


#Contents

ToC = {
     '1. Collections': [List, Dictionary, Set, Tuple, Range, Enumerate, Iterator, Generator],
     '2. Types':       [Type, String, Regular_Exp, Format, Numbers, Combinatorics, Datetime],
     '3. Syntax':      [Args, Inline, Closure, Decorator, Class, Duck_Types, Enum, Exceptions],
@@ -221,7 +216,12 @@ pre.prettyprint {
     '7. Libraries':   [Progress_Bar, Plot, Table, Curses, Logging, Scraping, Web, Profile,
                        NumPy, Image, Audio]
 }
-
+
+ + + + +

#Main

if __name__ == '__main__':     # Runs main() if file wasn't imported.
     main()
@@ -1873,15 +1873,15 @@ reader(adder(printer()))  # 100, 101, ..., 109
 



-

Libraries

-

#Progress Bar

# $ pip3 install tqdm
+

Libraries

#Progress Bar

# $ pip3 install tqdm
 from tqdm import tqdm
 from time import sleep
 for i in tqdm([1, 2, 3]):
     sleep(0.2)
 for i in tqdm(range(100)):
     sleep(0.02)
-
+
+

#Plot

# $ pip3 install matplotlib
 from matplotlib import pyplot
diff --git a/parse.js b/parse.js
index f92d354..2752693 100755
--- a/parse.js
+++ b/parse.js
@@ -302,7 +302,7 @@ function preventPageBreaks() {
     var el = $(this)
     var untilPre = el.nextUntil('pre')
     var untilH2 = el.nextUntil('h2')
-    if (untilPre.length < untilH2.length) {
+    if ((untilPre.length < untilH2.length) || el.prop('tagName') === 'H1') {
       untilPre.add(el).next().add(el).wrapAll("
"); } else { untilH2.add(el).wrapAll("
");