From a388fe7b5b412b8975be0a12867b28eac814ba15 Mon Sep 17 00:00:00 2001 From: zhangqx2010 Date: Fri, 8 Sep 2017 22:10:43 +0800 Subject: [PATCH] add-include-file --- cn/_includes/code.html | 26 ++++++++++ cn/_includes/task-tutorial-prereqs.md | 4 ++ cn/_includes/templates/concept.md | 32 +++++++++++++ cn/_includes/templates/task.md | 55 ++++++++++++++++++++++ cn/_includes/templates/tutorial.md | 68 +++++++++++++++++++++++++++ 5 files changed, 185 insertions(+) create mode 100644 cn/_includes/code.html create mode 100644 cn/_includes/task-tutorial-prereqs.md create mode 100644 cn/_includes/templates/concept.md create mode 100644 cn/_includes/templates/task.md create mode 100644 cn/_includes/templates/tutorial.md diff --git a/cn/_includes/code.html b/cn/_includes/code.html new file mode 100644 index 0000000000..d59db08ff7 --- /dev/null +++ b/cn/_includes/code.html @@ -0,0 +1,26 @@ +{% capture samplecode %}{% include_relative {{include.file}} %}{% endcapture %} +{% if include.k8slink %}{% capture ghlink %}https://raw.githubusercontent.com/kubernetes/kubernetes/blob/{{page.githubbranch}}{{include.k8slink}}{% endcapture %}{% endif %} +{% if include.ghlink %}{% capture ghlink %}https://raw.githubusercontent.com/kubernetes/kubernetes.github.io/{{page.docsbranch}}{{include.ghlink}}{% endcapture %}{% endif %} +{% capture mysample %} +```{{include.language}} +{{ samplecode | raw | strip }} +``` +{: id="{{include.file | handleize}}"} +{% endcapture %} + + + + + + + + + + + +
+ {% if ghlink %}{% endif %} + {{include.file}} + {% if ghlink %}{% endif %} + +
{{ mysample | markdownify }}
diff --git a/cn/_includes/task-tutorial-prereqs.md b/cn/_includes/task-tutorial-prereqs.md new file mode 100644 index 0000000000..a9cf90d265 --- /dev/null +++ b/cn/_includes/task-tutorial-prereqs.md @@ -0,0 +1,4 @@ +You need to have a Kubernetes cluster, and the kubectl command-line tool must +be configured to communicate with your cluster. If you do not already have a +cluster, you can create one by using +[Minikube](/docs/getting-started-guides/minikube). diff --git a/cn/_includes/templates/concept.md b/cn/_includes/templates/concept.md new file mode 100644 index 0000000000..65edc7f808 --- /dev/null +++ b/cn/_includes/templates/concept.md @@ -0,0 +1,32 @@ +{% if overview %} + +{{ overview }} + +{% else %} + +{% include templates/_errorthrower.md missing_block='overview' purpose='provides an overview of this concept.' %} + +{% endif %} + +* TOC +{:toc} + +{% if body %} + +{{ body }} + +{% else %} + +{% include templates/_errorthrower.md missing_block='body' purpose='supplies the body of the page content.' %} + +{% endif %} + + +{% if whatsnext %} + +## What's next + +{{ whatsnext }} + +{% endif %} + diff --git a/cn/_includes/templates/task.md b/cn/_includes/templates/task.md new file mode 100644 index 0000000000..e76cb7b117 --- /dev/null +++ b/cn/_includes/templates/task.md @@ -0,0 +1,55 @@ +{% if overview %} + +{{ overview }} + +{% else %} + +{% include templates/_errorthrower.md missing_block='overview' purpose='states, in one or two sentences, the purpose of this document' %} + +{% endif %} + + +* TOC +{: toc} + + +{% if prerequisites %} + +## Before you begin + +{{ prerequisites }} + +{% else %} + +{% include templates/_errorthrower.md missing_block='prerequisites' heading='Before you begin' purpose='lists action prerequisites and knowledge prerequisites' %} + +{% endif %} + + +{% if steps %} + +{{ steps }} + +{% else %} + +{% include templates/_errorthrower.md missing_block='steps' purpose='lists a sequence of numbered steps that accomplish the task.' %} + +{% endif %} + + +{% if discussion %} + +{{ discussion }} + +{% else %} + +{% endif %} + + +{% if whatsnext %} + +## What's next + +{{ whatsnext }} + +{% endif %} diff --git a/cn/_includes/templates/tutorial.md b/cn/_includes/templates/tutorial.md new file mode 100644 index 0000000000..b4c1faa0f1 --- /dev/null +++ b/cn/_includes/templates/tutorial.md @@ -0,0 +1,68 @@ +{% if overview %} + +{{ overview }} + +{% else %} + +{% include templates/_errorthrower.md missing_block='overview' purpose='states, in one or two sentences, the purpose of this document' %} + +{% endif %} + + +* TOC +{: toc} + + +{% if objectives %} + +## Objectives + +{{ objectives }} + +{% else %} + +{% include templates/_errorthrower.md missing_block='objectives' heading='Objectives' purpose='lists the objectives for this tutorial.' %} + +{% endif %} + + +{% if prerequisites %} + +## Before you begin + +{{ prerequisites }} + +{% else %} + +{% include templates/_errorthrower.md missing_block='prerequisites' heading='Before you begin' purpose='lists action prerequisites and knowledge prerequisites' %} + +{% endif %} + + +{% if lessoncontent %} + +{{ lessoncontent }} + +{% else %} + +{% include templates/_errorthrower.md missing_block='lessoncontent' purpose='provides the lesson content for this tutorial.' %} + +{% endif %} + + +{% if cleanup %} + +## Cleaning up + +{{ cleanup }} + +{% endif %} + + +{% if whatsnext %} + +## What's next + +{{ whatsnext }} + +{% endif %}