mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-05-06 00:46:56 +00:00
Add edition links
This commit is contained in:
@@ -104,7 +104,7 @@ def processchapter(chapter, filename):
|
||||
if isinstance(chapter, str):
|
||||
if "\n" in chapter:
|
||||
titles = re.findall("^# (.*)", chapter, re.MULTILINE)
|
||||
slidefooter = ".debug[{}]".format(filename)
|
||||
slidefooter = ".debug[{}]".format(makelink(filename))
|
||||
chapter = chapter.replace("\n---\n", "\n{}\n---\n".format(slidefooter))
|
||||
chapter += "\n" + slidefooter
|
||||
return (chapter, titles)
|
||||
@@ -118,4 +118,15 @@ def processchapter(chapter, filename):
|
||||
raise InvalidChapter(chapter)
|
||||
|
||||
|
||||
def makelink(filename):
|
||||
if os.path.isfile(filename):
|
||||
repo = "https://github.com/jpetazzo/orchestration-workshop"
|
||||
branch = "the-big-2017-refactor"
|
||||
base = "docs"
|
||||
url = "{}/tree/{}/{}/{}".format(repo, branch, base, filename)
|
||||
return "[{}]({})".format(filename, url)
|
||||
else:
|
||||
return filename
|
||||
|
||||
|
||||
sys.stdout.write(generatefromyaml(sys.stdin))
|
||||
|
||||
@@ -34,6 +34,9 @@ div.remark-slide-number {
|
||||
font-family: monospace;
|
||||
color: white;
|
||||
}
|
||||
.debug a {
|
||||
color: white;
|
||||
}
|
||||
.debug:hover {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user