Debugging bar (this is super cool)

This commit is contained in:
Jérôme Petazzoni
2017-10-21 14:18:09 +02:00
parent 1ea7141d95
commit 9a5e9c9ea0
2 changed files with 14 additions and 2 deletions

View File

@@ -76,7 +76,7 @@ def gentoc(titles, depth=0, chapter=0):
return " "*(depth-2) + "- [{}](#{})\n".format(titles, anchor(titles))
if isinstance(titles, list):
if depth==0:
sep = "\n\n<!-- auto-generated TOC -->\n---\n\n"
sep = "\n\n.debug[auto-generated TOC]\n---\n\n"
head = ""
tail = ""
elif depth==1:
@@ -104,7 +104,7 @@ def processchapter(chapter, filename):
if isinstance(chapter, str):
if "\n" in chapter:
titles = re.findall("^# (.*)", chapter, re.MULTILINE)
slidefooter = "<!-- {} -->".format(filename)
slidefooter = ".debug[{}]".format(filename)
chapter = chapter.replace("\n---\n", "\n{}\n---\n".format(slidefooter))
chapter += "\n" + slidefooter
return (chapter, titles)

View File

@@ -26,6 +26,18 @@ div.remark-slide-number {
right: 6px;
}
.debug {
position: absolute;
left: 0px;
right: 0px;
bottom: 0px;
font-family: monospace;
color: white;
}
.debug:hover {
background-color: black;
}
body { font-family: 'Droid Serif'; }
h1, h2, h3 {