This commit is contained in:
Jerome Petazzoni
2020-04-23 07:32:03 -05:00
8 changed files with 101 additions and 69 deletions

View File

@@ -3,8 +3,9 @@ title: |
&
Kubernetes
chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)"
#chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)"
#chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)"
chat: FIXME
gitrepo: github.com/jpetazzo/container.training
@@ -15,7 +16,7 @@ slides: http://container.training/
exclude:
- self-paced
chapters:
content:
- shared/title.md
- logistics.md
- containers/intro.md

View File

@@ -14,7 +14,7 @@ slides: http://container.training/
exclude:
- self-paced
chapters:
content:
- shared/title.md
- logistics.md
- containers/intro.md

View File

@@ -14,7 +14,7 @@ slides: http://container.training/
exclude:
- in-person
chapters:
content:
- shared/title.md
# - shared/logistics.md
- containers/intro.md

View File

@@ -14,7 +14,7 @@ slides: http://container.training/
exclude:
- self-paced
chapters:
content:
- shared/title.md
- logistics.md
- containers/intro.md

View File

@@ -0,0 +1,21 @@
## Intros
- Hello! We are:
- .emoji[👷🏻‍♀️] AJ ([@s0ulshake], [EphemeraSearch])
- .emoji[🐳] Jérôme ([@jpetazzo], Enix SAS)
- The training will run for 4 hours, with a 10 minutes break every hour
(the middle break will be a bit longer)
- Feel free to ask questions at any time
- *Especially when you see full screen container pictures!*
- Live feedback, questions, help: @@CHAT@@
[EphemeraSearch]: https://ephemerasearch.com/
[@s0ulshake]: https://twitter.com/s0ulshake
[@jpetazzo]: https://twitter.com/jpetazzo

View File

@@ -0,0 +1,35 @@
## Intros
- This slide should be customized by the tutorial instructor(s).
- Hello! We are:
- .emoji[👩🏻‍🏫] Ann O'Nymous ([@...](https://twitter.com/...), Megacorp Inc)
- .emoji[👨🏾‍🎓] Stu Dent ([@...](https://twitter.com/...), University of Wakanda)
<!-- .dummy[
- .emoji[👷🏻‍♀️] AJ ([@s0ulshake](https://twitter.com/s0ulshake), Travis CI)
- .emoji[🚁] Alexandre ([@alexbuisine](https://twitter.com/alexbuisine), Enix SAS)
- .emoji[🐳] Jérôme ([@jpetazzo](https://twitter.com/jpetazzo), Enix SAS)
- .emoji[⛵] Jérémy ([@jeremygarrouste](twitter.com/jeremygarrouste), Inpiwee)
- .emoji[🎧] Romain ([@rdegez](https://twitter.com/rdegez), Enix SAS)
] -->
- The workshop will run from ...
- There will be a lunch break at ...
(And coffee breaks!)
- Feel free to interrupt for questions at any time
- *Especially when you see full screen container pictures!*
- Live feedback, questions, help: @@CHAT@@

View File

@@ -1,35 +0,0 @@
## Intros
- This slide should be customized by the tutorial instructor(s).
- Hello! We are:
- .emoji[👩🏻‍🏫] Ann O'Nymous ([@...](https://twitter.com/...), Megacorp Inc)
- .emoji[👨🏾‍🎓] Stu Dent ([@...](https://twitter.com/...), University of Wakanda)
<!-- .dummy[
- .emoji[👷🏻‍♀️] AJ ([@s0ulshake](https://twitter.com/s0ulshake), Travis CI)
- .emoji[🚁] Alexandre ([@alexbuisine](https://twitter.com/alexbuisine), Enix SAS)
- .emoji[🐳] Jérôme ([@jpetazzo](https://twitter.com/jpetazzo), Enix SAS)
- .emoji[⛵] Jérémy ([@jeremygarrouste](twitter.com/jeremygarrouste), Inpiwee)
- .emoji[🎧] Romain ([@rdegez](https://twitter.com/rdegez), Enix SAS)
] -->
- The workshop will run from ...
- There will be a lunch break at ...
(And coffee breaks!)
- Feel free to interrupt for questions at any time
- *Especially when you see full screen container pictures!*
- Live feedback, questions, help: @@CHAT@@

1
slides/logistics.md Symbolic link
View File

@@ -0,0 +1 @@
logistics-template.md

View File

@@ -42,7 +42,7 @@ def insertslide(markdown, title):
before = markdown[:slide_position]
toclink = "toc-chapter-{}".format(title2path[title][0])
toclink = "toc-module-{}".format(title2path[title][0])
_titles_ = [""] + all_titles + [""]
currentindex = _titles_.index(title)
previouslink = anchor(_titles_[currentindex-1])
@@ -54,7 +54,7 @@ def insertslide(markdown, title):
class: pic
.interstitial[![Image separating from the next chapter]({interstitial})]
.interstitial[![Image separating from the next module]({interstitial})]
---
@@ -98,7 +98,7 @@ def generatefromyaml(manifest, filename):
if "html" not in manifest:
manifest["html"] = filename + ".html"
markdown, titles = processchapter(manifest["chapters"], filename)
markdown, titles = processcontent(manifest["content"], filename)
logging.debug("Found {} titles.".format(len(titles)))
toc = gentoc(titles)
markdown = markdown.replace("@@TOC@@", toc)
@@ -134,9 +134,8 @@ def generatefromyaml(manifest, filename):
# Maps a section title (the string just after "^# ") to its position
# in the table of content (as a (chapter,part,subpart,...) tuple).
# in the table of content (as a (module,part,subpart,...) tuple).
title2path = {}
path2title = {}
all_titles = []
# "tree" is a list of titles, potentially nested.
@@ -144,50 +143,60 @@ def gentoc(tree, path=()):
if not tree:
return ""
if isinstance(tree, str):
logging.debug("Path {} Title {}".format(path, tree))
title = tree
title2path[title] = path
path2title[path] = title
all_titles.append(title)
logging.debug("Path {} Title {}".format(path, title))
return "- [{}](#{})".format(title, anchor(title))
if isinstance(tree, list):
# If there is only one sub-element, give it index zero.
# Otherwise, elements will have indices 1-to-N.
offset = 0 if len(tree) == 1 else 1
logging.debug(
"Path {} Tree [...({} sub-elements)]"
.format(path, len(tree)))
if len(path) == 0:
return "\n---\n".join(gentoc(subtree, path+(i+1,)) for (i,subtree) in enumerate(tree))
return "\n---\n".join(gentoc(subtree, path+(i+offset,)) for (i,subtree) in enumerate(tree))
elif len(path) == 1:
chapterslide = "name: toc-chapter-{n}\n\n## Chapter {n}\n\n".format(n=path[0])
# If there is only one module, don't show "Module 1" but just "TOC"
if path[0] == 0:
label = "Table of contents"
else:
label = "Module {}".format(path[0])
moduleslide = "name: toc-module-{n}\n\n## {label}\n\n".format(n=path[0], label=label)
for (i,subtree) in enumerate(tree):
chapterslide += gentoc(subtree, path+(i+1,)) + "\n\n"
chapterslide += ".debug[(auto-generated TOC)]"
return chapterslide
moduleslide += gentoc(subtree, path+(i+offset,)) + "\n\n"
moduleslide += ".debug[(auto-generated TOC)]"
return moduleslide
else:
return "\n\n".join(gentoc(subtree, path+(i+1,)) for (i,subtree) in enumerate(tree))
return "\n\n".join(gentoc(subtree, path+(i+offset,)) for (i,subtree) in enumerate(tree))
# Arguments:
# - `chapter` is a string; if it has multiple lines, it will be used as
# - `content` is a string; if it has multiple lines, it will be used as
# a markdown fragment; otherwise it will be considered as a file name
# to be recursively loaded and parsed
# - `filename` is the name of the file that we're currently processing
# (to generate inline comments to facilitate edition)
# Returns: (epxandedmarkdown,[list of titles])
# The list of titles can be nested.
def processchapter(chapter, filename):
if isinstance(chapter, str):
if "\n" in chapter:
titles = re.findall("^# (.*)", chapter, re.MULTILINE)
def processcontent(content, filename):
if isinstance(content, str):
if "\n" in content:
titles = re.findall("^# (.*)", content, re.MULTILINE)
slidefooter = ".debug[{}]".format(makelink(filename))
chapter = chapter.replace("\n---\n", "\n{}\n---\n".format(slidefooter))
chapter += "\n" + slidefooter
return (chapter, titles)
if os.path.isfile(chapter):
return processchapter(open(chapter).read(), chapter)
if isinstance(chapter, list):
chapters = [processchapter(c, filename) for c in chapter]
markdown = "\n---\n".join(c[0] for c in chapters)
titles = [t for (m,t) in chapters if t]
content = content.replace("\n---\n", "\n{}\n---\n".format(slidefooter))
content += "\n" + slidefooter
return (content, titles)
if os.path.isfile(content):
return processcontent(open(content).read(), content)
if isinstance(content, list):
subparts = [processcontent(c, filename) for c in content]
markdown = "\n---\n".join(c[0] for c in subparts)
titles = [t for (m,t) in subparts if t]
return (markdown, titles)
logging.warning("Invalid chapter: {}".format(chapter))
return "```\nInvalid chapter: {}\n```\n".format(chapter), []
logging.warning("Invalid content: {}".format(content))
return "```\nInvalid content: {}\n```\n".format(content), []
# Try to figure out the URL of the repo on GitHub.
# This is used to generate "edit me on GitHub"-style links.