Skip to content

Commit

Permalink
Import from Container Engine docs, addition of Tabs functionality, va…
Browse files Browse the repository at this point in the history
…rious link fixes
  • Loading branch information
johndmulhausen committed Mar 16, 2016
1 parent 3a20266 commit c8dd8b8
Show file tree
Hide file tree
Showing 56 changed files with 1,974 additions and 34 deletions.
16 changes: 16 additions & 0 deletions README.md
Expand Up @@ -88,6 +88,22 @@ To include a file that is hosted in the external, main Kubernetes repo, make sur

* `PATHFROMK8SROOT`: The path to the file relative to the root of [the Kubernetes repo](https://github.com/kubernetes/kubernetes/tree/release-1.2), e.g. `/examples/rbd/foo.yaml`

## Using tabs for multi-language examples

By specifying some inline CSV in a varable called `tabspec`, you can include a file
called `tabs.html` that generates tabs showing code examples in multiple langauges.

<pre>&#123;% capture tabspec %&#125;servicesample
JSON,json,service-sample.json,/docs/user-guide/services/service-sample.json
YAML,yaml,service-sample.yaml,/docs/user-guide/services/service-sample.yaml&#123;% endcapture %&#125;
&#123;% include tabs.html %&#125;</pre>

In English, this would read: "Create a set of tabs with the alias `servicesample`,
and have tabs visually labeled "JSON" and "YAML" that use `json` and `yaml` Rouge syntax highlighting, which display the contents of
`service-sample.{extension}` on the page, and link to the file in GitHub at (full path)."

Example file: [Pods: Multi-Container](/docs/user-guide/pods/multi-container/).

## Use a global variable

The `/_config.yml` file defines some useful variables you can use when editing docs.
Expand Down
14 changes: 14 additions & 0 deletions _data/guides.yml
Expand Up @@ -132,6 +132,12 @@ toc:
path: /docs/getting-started-guides/scratch/
- title: Authenticating Across Clusters with kubeconfig
path: /docs/user-guide/kubeconfig-file/
- title: Replication Controller Operations
path: /docs/user-guide/replication-controller/operations/
- title: Resizing a Replication Controller
path: /docs/user-guide/resizing-a-replication-controller/
- title: Service Operations
path: /docs/user-guide/services/operations/

- title: Using Nodes, Pods, and Containers
section:
Expand All @@ -147,6 +153,10 @@ toc:
path: /docs/user-guide/getting-into-containers/
- title: The Lifecycle of a Pod
path: /docs/user-guide/pod-states/
- title: Creating Single-Container Pods
path: /docs/user-guide/pods/single-container/
- title: Creating Multi-Container Pods
path: /docs/user-guide/pods/multi-container/
- title: Pod Templates
path: /docs/user-guide/pod-templates/
- title: Assigning Pods to Nodes
Expand All @@ -166,6 +176,8 @@ toc:
section:
- title: Networking in Kubernetes
path: /docs/admin/networking/
- title: Creating an External Load Balancer
path: /docs/user-guide/load-balancer/
- title: Using DNS Pods and Services
path: /docs/admin/dns/
- title: Setting Up and Configuring DNS
Expand Down Expand Up @@ -224,6 +236,8 @@ toc:
path: /docs/user-guide/managing-deployments/
- title: Deploying Applications
path: /docs/user-guide/deploying-applications/
- title: Updating Applications with Rolling Updates
path: /docs/user-guide/rolling-updates/
- title: Launching, Exposing, and Killing Applications
path: /docs/user-guide/quick-start/

Expand Down
2 changes: 2 additions & 0 deletions _data/support.yml
Expand Up @@ -6,6 +6,8 @@ toc:

- title: Troubleshooting
section:
- title: Debugging Pods and Replication Controllers
path: /docs/user-guide/debugging-pods-and-replication-controllers/
- title: Web Interface
path: /docs/user-guide/ui/
- title: Application Introspection and Debugging
Expand Down
4 changes: 3 additions & 1 deletion _includes/head-header.html
Expand Up @@ -4,9 +4,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="/images/favicon.png">
<link href='https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Roboto+Mono' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href='https://fonts.googleapis.com/css?family=Roboto+Mono' type='text/css'>
<link rel="stylesheet" href="/css/styles.css"/>
<link rel="stylesheet" href="/css/jquery-ui.min.css">
<script src="/js/jquery-2.2.0.min.js"></script>
<script src="/js/jquery-ui.min.js"></script>
<script src="/js/script.js"></script>
<title>Kubernetes - {{ title }}</title>
</head>
Expand Down
17 changes: 17 additions & 0 deletions _includes/tabs.html
@@ -0,0 +1,17 @@
{% assign tabsraw = tabspec | newline_to_br | split: '<br />' %}
{% assign tabsetname = tabsraw[0] %}
<script>$(function(){$("#{{tabsetname}}").tabs();});</script>
<div id="{{tabsetname}}">
<ul>{% for tab in tabsraw offset:1 %}{% assign thisTab = tab | split: ',' %}
<li><a href="#{{ thisTab[0] | strip | handleize }}">{{ thisTab[0] | strip}}</a></li>{% endfor %}
</ul>
{% for tab in tabsraw offset:1 %}
{% assign thisTab = tab | split: ',' %}
{% assign tabLang=thisTab[1] %}
{% assign tabFile=thisTab[2] %}
{% assign tabGHLink=thisTab[3] %}
<div id="{{ thisTab[0] | strip | handleize }}">
{% include code.html language=tabLang file=tabFile ghlink=tabGHLink %}
</div>
{% endfor %}
</div>
62 changes: 43 additions & 19 deletions _sass/_base.sass
Expand Up @@ -120,7 +120,7 @@ header
top: 0
left: 0
transform: none
background-image: url(../images/nav_logo.svg)
background-image: url(/images/nav_logo.svg)
background-size: contain
background-position: center center
background-repeat: no-repeat
Expand All @@ -133,7 +133,7 @@ header
left: 20px
width: 50px
height: 50px
background-image: url(../images/toc_icon.png)
background-image: url(/images/toc_icon.png)
background-position: center center
background-repeat: no-repeat
background-size: auto
Expand All @@ -152,11 +152,11 @@ header
display: block
width: 45px
height: 44px
background-image: url(../images/favicon.png)
background-image: url(/images/favicon.png)


&.flip-nav .flyout-button
background-image: url(../images/toc_icon_grey.png)
background-image: url(/images/toc_icon_grey.png)


.nav-buttons
Expand Down Expand Up @@ -295,7 +295,7 @@ header

// HERO
#hero
background-image: url(../images/texture.png)
background-image: url(/images/texture.png)
background-color: $dark-grey
text-align: center
padding-left: 0
Expand All @@ -321,7 +321,7 @@ header
// FOOTER
footer
width: 100%
background-image: url(../images/texture.png)
background-image: url(/images/texture.png)
background-color: $dark-grey

main
Expand Down Expand Up @@ -373,7 +373,7 @@ footer

.social a
display: inline-block
background-image: url(../images/social_sprite.png)
background-image: url(/images/social_sprite.png)
background-repeat: no-repeat
background-size: auto
width: 50px
Expand Down Expand Up @@ -845,7 +845,7 @@ dd
white-space: nowrap
text-indent: 50px
overflow: hidden
background: $blue url(../images/pencil.png) no-repeat
background: $blue url(/images/pencil.png) no-repeat
background-position: 1px 1px
background-size: auto

Expand Down Expand Up @@ -929,7 +929,7 @@ $feature-box-div-margin-bottom: 40px
#home
&.flip-nav, &.open-nav
.logo
background-image: url(../images/nav_logo2.svg)
background-image: url(/images/nav_logo2.svg)

#hero
margin-bottom: 0
Expand Down Expand Up @@ -979,7 +979,7 @@ $feature-box-div-margin-bottom: 40px
#video
width: 100%
position: relative
background-image: url(../images/kub_video_thm.jpg)
background-image: url(/images/kub_video_thm.jpg)
background-position: center center
background-size: cover

Expand Down Expand Up @@ -1084,7 +1084,7 @@ $feature-box-div-margin-bottom: 40px
#features
padding-top: 140px
background-color: $light-grey
background-image: url(../images/wheel.png)
background-image: url(/images/wheel.png)
background-position: center 60px
background-repeat: no-repeat
background-size: auto
Expand Down Expand Up @@ -1124,7 +1124,7 @@ $feature-box-div-margin-bottom: 40px
#community
&.open-nav, &.flip-nav
.logo
background-image: url(../images/nav_logo2.svg)
background-image: url(/images/nav_logo2.svg)

#hero
padding-bottom: 20px
Expand Down Expand Up @@ -1175,6 +1175,30 @@ $feature-box-div-margin-bottom: 40px
width: 100%
height: 100%

// Tabs
.ui-widget-header
background: transparent !important
background-color: transparent !important
border: 0px !important

.ui-tabs
ul, ol, li
padding: 0px !important
list-style: none !important
margin-bottom: 0px !important
margin-left: 1px !important

.ui-widget-content
border: 0px !important

.ui-widget-content
table
margin: 0px !important

.ui-tabs .ui-tabs-panel
padding: 0px !important
border: 1px solid #ccc !important

// Talk to us
#talkToUs
h3, h4
Expand Down Expand Up @@ -1203,16 +1227,16 @@ $feature-box-div-margin-bottom: 40px
background-repeat: no-repeat

div:nth-child(1)
background-image: url(../images/twitter_icon.png)
background-image: url(/images/twitter_icon.png)

div:nth-child(2)
background-image: url(../images/github_icon.png)
background-image: url(/images/github_icon.png)

div:nth-child(3)
background-image: url(../images/slack_icon.png)
background-image: url(/images/slack_icon.png)

div:nth-child(4)
background-image: url(../images/stackoverflow_icon.png)
background-image: url(/images/stackoverflow_icon.png)

div + div
margin-top: 20px
Expand Down Expand Up @@ -1240,10 +1264,10 @@ $feature-box-div-margin-bottom: 40px
padding-top: 125px

div:nth-child(1)
background-image: url(../images/community_logos/viacom_logo.png)
background-image: url(/images/community_logos/viacom_logo.png)

div:nth-child(2)
background-image: url(../images/community_logos/ebay_logo.png)
background-image: url(/images/community_logos/ebay_logo.png)

div:nth-child(3)
background-image: url(../images/community_logos/wikimedia_foundation_logo.png)
background-image: url(/images/community_logos/wikimedia_foundation_logo.png)
7 changes: 7 additions & 0 deletions css/jquery-ui.min.css

Large diffs are not rendered by default.

0 comments on commit c8dd8b8

Please sign in to comment.