Add support for {{< quote >}} (#3237)

This commit is contained in:
Martin Taillefer 2019-02-12 08:22:28 -08:00 committed by GitHub
parent 7d2167bb6d
commit d6b3bfac56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 92 additions and 28 deletions

View File

@ -483,11 +483,11 @@ which looks like:
Mixer use an {{<gloss adapters>}}adapter{{</gloss>}} to interface to a backend.
So even though the glossary entry is for *adapters*, the word singular form of *adapter* can be used in the text.
So even though the glossary entry is for *adapters*, the singular form of *adapter* can be used in the text.
## Callouts
You can bring special attention to blocks of content by highlighting warnings, ideas, and tips:
You can bring special attention to blocks of content by highlighting warnings, ideas, tips, and quotes:
{{< text markdown >}}
{{</* warning */>}}
@ -501,6 +501,10 @@ This is a great idea
{{</* tip */>}}
This is a useful tip from an expert
{{</* /tip */>}}
{{</* quote */>}}
This is a quote from somewhere
{{</* /quote */>}}
{{< /text >}}
which looks like:
@ -517,6 +521,10 @@ This is a great idea
This is a useful tip from an expert
{{< /tip >}}
{{< quote >}}
This is a quote from somewhere
{{< /quote >}}
## Embedding boilerplate text
You can embed common boilerplate text into any markdown output using the `boilerplate` sequence:

View File

@ -8,7 +8,9 @@ weight: 86
keywords: [appswitch,performance]
---
>_All problems in computer science can be solved with another layer, except of course the problem of too many layers._ -- David Wheeler
{{< quote >}}
All problems in computer science can be solved with another layer, except of course the problem of too many layers. -- David Wheeler
{{< /quote >}}
The sidecar proxy approach enables a lot of awesomeness. Squarely in the datapath between microservices, the sidecar can precisely tell what the application is trying to do. It can monitor and instrument protocol traffic, not in the bowels of the networking layers but at the application level, to enable deep visibility, access controls and traffic management.
@ -208,7 +210,9 @@ Yes, AppSwitch is clearly another layer. However it is one that can remove mult
Perhaps Wheelers quote should read:
>_All problems in computer science can be solved with another layer, **even** the problem of too many layers!_
{{< quote >}}
All problems in computer science can be solved with another layer, **even** the problem of too many layers!
{{< /quote >}}
## Acknowledgements

View File

@ -13,11 +13,13 @@ A simple overview of an Istio service-mesh architecture always starts with descr
[From Istios documentation:](/docs/concepts/what-is-istio/#architecture)
> An Istio service mesh is logically split into a data plane and a control plane.
>
> The data plane is composed of a set of intelligent proxies (Envoy) deployed as sidecars. These proxies mediate and control all network communication between microservices along with Mixer, a general-purpose policy and telemetry hub.
>
> The control plane manages and configures the proxies to route traffic. Additionally, the control plane configures Mixers to enforce policies and collect telemetry.
{{< quote >}}
An Istio service mesh is logically split into a data plane and a control plane.
The data plane is composed of a set of intelligent proxies (Envoy) deployed as sidecars. These proxies mediate and control all network communication between microservices along with Mixer, a general-purpose policy and telemetry hub.
The control plane manages and configures the proxies to route traffic. Additionally, the control plane configures Mixers to enforce policies and collect telemetry.
{{< /quote >}}
{{< image width="40%"
ratio="33%"
@ -207,7 +209,9 @@ But how does this work? To get to the bottom of this, we need to understand Kube
[From Kubernetes documentation:](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/)
> An admission controller is a piece of code that intercepts requests to the Kubernetes API server prior to persistence of the object, but after the request is authenticated and authorized. You can define two types of admission webhooks, validating admission Webhook and mutating admission webhook. With validating admission Webhooks, you may reject requests to enforce custom admission policies. With mutating admission Webhooks, you may change requests to enforce custom defaults.
{{< tip >}}
An admission controller is a piece of code that intercepts requests to the Kubernetes API server prior to persistence of the object, but after the request is authenticated and authorized. You can define two types of admission webhooks, validating admission Webhook and mutating admission webhook. With validating admission Webhooks, you may reject requests to enforce custom admission policies. With mutating admission Webhooks, you may change requests to enforce custom defaults.
{{< /tip >}}
For automatic sidecar injection, Istio relies on `Mutating Admission Webhook`. Lets look at the details of the `istio-sidecar-injector` mutating webhook configuration.
@ -343,4 +347,6 @@ The output above clearly shows that all the incoming traffic to port 80, which i
This brings us to the end of this post. I hope it helped to de-mystify how Istio manages to inject the sidecar proxies into an existing deployment and how Istio routes the traffic to the proxy.
> Update: In place of `istio-init`, there now seems to be an option of using the new CNI, which removes the need for the init container and associated privileges. This [`istio-cni`] (<https://github.com/istio/cni>) plugin sets up the pods' networking to fulfill this requirement in place of the current Istio injected pod `istio-init` approach.
{{< idea >}}
Update: In place of `istio-init`, there now seems to be an option of using the new CNI, which removes the need for the init container and associated privileges. This [`istio-cni`] (<https://github.com/istio/cni>) plugin sets up the pods' networking to fulfill this requirement in place of the current Istio injected pod `istio-init` approach.
{{< /idea >}}

View File

@ -112,7 +112,9 @@ istio-pilot-58c65f74bc-2f5xn 1/1 Running 0 1m
* If desired, run the following command to delete all CRDs:
> {{< warning_icon >}} Deleting CRDs deletes any configuration changes that you have made to Istio.
{{< warning >}}
Deleting CRDs deletes any configuration changes that you have made to Istio.
{{< /warning >}}
{{< text bash >}}
$ for i in install/kubernetes/helm/istio-init/files/crd*yaml; do kubectl delete -f $i; done

View File

@ -352,9 +352,10 @@ spec:
EOF
{{< /text >}}
>
{{< tip >}}
* In this example, we do **not** specify namespace in metadata but put it in the command line (`-n bar`), which has an identical effect.
* There is no restriction on the authentication policy and destination rule name. This example uses the name of the service itself for simplicity.
{{< /tip >}}
Again, run the probing command. As expected, request from `sleep.legacy` to `httpbin.bar` starts failing with the same reasons.
@ -546,7 +547,7 @@ spec:
EOF
{{< /text >}}
The same curl command from before will return with 401 error code, as a result of server is expecting JWT but none was provided:
The same `curl` command from before will return with 401 error code, as a result of server is expecting JWT but none was provided:
{{< text bash >}}
$ curl $INGRESS_HOST/headers -s -o /dev/null -w "%{http_code}\n"

View File

@ -403,8 +403,10 @@ Istio.
command terminated with exit code 35
{{< /text >}}
> It might take time for the configuration change to propagate so you might still get successful connections.
{{< warning >}}
It might take time for the configuration change to propagate so you might still get successful connections.
Wait for several seconds and then retry the last command.
{{< /warning >}}
## Understanding what happened

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -174,6 +174,18 @@
c-0.952,0.55-1.392,1.589-0.976,2.31C37.345,16.038,38.465,16.177,39.418,15.627z"/>
<path d="M35.036,3.09c-0.722-0.416-1.762,0.023-2.312,0.976l-1.781,3.087c-0.55,0.953-0.411,2.072,0.31,2.488
c0.722,0.416,1.761-0.023,2.311-0.976l1.783-3.087C35.896,4.626,35.756,3.506,35.036,3.09z"/>
</symbol><symbol id="callout-quote" viewBox="0 0 489.3 489.3">
<path d="M265,369.25c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3H38.4c-7.7,0-13.9-6.2-13.9-13.9V77.35
c0-7.7,6.2-13.9,13.9-13.9H451c7.7,0,13.9,6.2,13.9,13.9v253.6c0,7.7-6.2,13.9-13.9,13.9h-30.2c-6.8,0-12.3,5.5-12.3,12.3v60.9
l-69.5-69.5c-4.8-4.8-12.5-4.8-17.3,0s-4.8,12.5,0,17.3l78.9,78.9c3.6,3.6,8.5,5.6,13.4,5.6c2.4,0,4.9-0.5,7.3-1.4
c7.1-2.9,11.7-9.8,11.7-17.5v-61.9h17.9c21.2,0,38.4-17.2,38.4-38.4V77.35c0-21.2-17.2-38.4-38.4-38.4H38.4
C17.2,38.95,0,56.15,0,77.35v253.6c0,21.2,17.2,38.4,38.4,38.4H265V369.25z"/>
<path d="M88.1,152.85h313.2c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3H88.1c-6.8,0-12.3,5.5-12.3,12.3
S81.3,152.85,88.1,152.85z"/>
<path d="M88.1,218.75h313.2c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3H88.1c-6.8,0-12.3,5.5-12.3,12.3
S81.3,218.75,88.1,218.75z"/>
<path d="M244.7,284.65h156.6c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3H244.7c-6.8,0-12.3,5.5-12.3,12.3
C232.5,279.15,237.9,284.65,244.7,284.65z"/>
</symbol><symbol id="callout-tip" viewBox="0 0 496.304 496.303">
<path d="M248.146,0C111.314,0,0,111.321,0,248.152c0,136.829,111.314,248.151,248.146,248.151
c136.835,0,248.158-111.322,248.158-248.151C496.304,111.321,384.98,0,248.146,0z M248.146,472.093

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

@ -0,0 +1,9 @@
<div class="callout quote">
<div class="type">
<svg class="large_icon"><use xlink:href="/img/icons.svg#callout-quote"/></svg>
</div>
<div class="content">
{{ $trimmed := trim .Inner " \n" }}
{{ markdownify $trimmed }}
</div>
</div>

View File

@ -106,7 +106,7 @@ fi
# grep -l -e "blockquote" $f
# if [[ "$?" == "0" ]]
# then
# echo "Ensure site use {{< tip >}}, {{< warning >}} and {{< idea >}} instead of block quotes"
# echo "Ensure markdown content only uses {{< tip >}}, {{< warning >}}, {{< idea >}}, and {{< quote >}} instead of block quotes"
# FAILED=1
# fi
#done

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 489.3 489.3" style="enable-background:new 0 0 489.3 489.3;" xml:space="preserve">
<path d="M265,369.25c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3H38.4c-7.7,0-13.9-6.2-13.9-13.9V77.35
c0-7.7,6.2-13.9,13.9-13.9H451c7.7,0,13.9,6.2,13.9,13.9v253.6c0,7.7-6.2,13.9-13.9,13.9h-30.2c-6.8,0-12.3,5.5-12.3,12.3v60.9
l-69.5-69.5c-4.8-4.8-12.5-4.8-17.3,0s-4.8,12.5,0,17.3l78.9,78.9c3.6,3.6,8.5,5.6,13.4,5.6c2.4,0,4.9-0.5,7.3-1.4
c7.1-2.9,11.7-9.8,11.7-17.5v-61.9h17.9c21.2,0,38.4-17.2,38.4-38.4V77.35c0-21.2-17.2-38.4-38.4-38.4H38.4
C17.2,38.95,0,56.15,0,77.35v253.6c0,21.2,17.2,38.4,38.4,38.4H265V369.25z"/>
<path d="M88.1,152.85h313.2c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3H88.1c-6.8,0-12.3,5.5-12.3,12.3
S81.3,152.85,88.1,152.85z"/>
<path d="M88.1,218.75h313.2c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3H88.1c-6.8,0-12.3,5.5-12.3,12.3
S81.3,218.75,88.1,218.75z"/>
<path d="M244.7,284.65h156.6c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3H244.7c-6.8,0-12.3,5.5-12.3,12.3
C232.5,279.15,237.9,284.65,244.7,284.65z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -38,6 +38,11 @@
background-color: $warningCalloutBackgroundColor;
}
&.quote {
background-color: $blockQuoteBackgroundColor;
font-style: italic;
}
&:hover {
svg {
animation: shake 2.82s cubic-bezier(.36, .07, .19, .97) both;