Skip to content

Commit

Permalink
Merge pull request #581 from amazonlinux/v0.2.0-docs-changes
Browse files Browse the repository at this point in the history
v0.2.0 docs changes
  • Loading branch information
iliana committed Dec 10, 2019
2 parents 48f53ac + c01b8f5 commit d111cda
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
10 changes: 10 additions & 0 deletions START.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Thar, the Operating System

Welcome to the Thar private preview! Thar is a free and open-source Linux-based operating system meant for hosting containers.

Documentation available on this microsite:

- [README.md](README.md) — Read this first!
- [INSTALL.md](INSTALL.md#using-a-thar-ami) — Set up a Thar cluster
- [dogswatch README.md](extras/dogswatch/README.md) — Set up and use the Kubernetes operator for Thar updates
- [CHANGELOG.md](CHANGELOG.md) — Changes between published versions
18 changes: 16 additions & 2 deletions tools/gen-docs.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/bin/bash
DOCS=(START.md README.md INSTALL.md CHANGELOG.md extras/dogswatch/README.md)
EXTRAS=(extras/dogswatch/{dogswatch,dev/deployment}.yaml)

if ! hash grip; then
>&2 echo "grip is not installed, run 'pip3 install --user grip'"
exit 1
fi

top=$(git rev-parse --show-toplevel)
mkdir -p "${top}/html"
for doc in README.md INSTALL.md CHANGELOG.md; do
for doc in "${DOCS[@]}"; do
out="${top}/html/${doc%.md}.html"
mkdir -p "$(dirname "$out")"
grip --title="${doc}" --export \
<(
cat <<'EOF'
Expand All @@ -16,6 +20,8 @@ for doc in README.md INSTALL.md CHANGELOG.md; do
is via [[email protected]](mailto:[email protected])
or #thar-preview on the [awsdevelopers Slack workspace](https://awsdevelopers.slack.com) (email us for an invite).
We'd love to talk with you and hear your feedback on Thar!
<br><br>
[&larr; Documentation index](/START.md)
---
Expand All @@ -24,8 +30,16 @@ EOF
) \
"${out}"
sed -i \
-e '/<link rel="stylesheet".*octicons\.css/d' \
-e 's/.*<link rel="stylesheet".*octicons\.css.*/<style>.markdown-body .anchor span:before { font-size: 16px; content: "\\1f517"; }<\/style>/' \
-e '/<link rel="icon"/d' \
-e 's/<p>@@THAR-SENTINEL-START@@/<p style="background-color: #a8dfee; border: 1px solid #008296; padding: 1em;">/' \
-e 's/<a href="\([^ ">]*\).md/<a href="\1.html/g' \
-e 's^<a href="\.\./\.\./pull/[^ ">]*">\(#[0-9]\+\)</a>^\1^g' \
"${out}"
done

for extra in "${EXTRAS[@]}"; do
out="${top}/html/${extra}"
echo "Copying ${extra} to ${out}"
install -D "${extra}" "${out}"
done

0 comments on commit d111cda

Please sign in to comment.