Merge pull request #1798 from liuboaibc/create-doc-pdf

doc to pdf
This commit is contained in:
LiuBo 2021-07-08 12:47:16 +08:00 committed by GitHub
commit 730e294961
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 679 additions and 23 deletions

View File

@ -145,3 +145,16 @@ Total in 2396 ms
#### Get the already built static content
You will find the previously generated content in the `public` directory.
## Create Docs PDF
```
hugo
```
```
cat ./public/all-docs/index.html | wkhtmltopdf --outline-depth 2 --enable-internal-links - ./static/pdf/all-docs.pdf
cat ./public/zh/all-docs/index.html | wkhtmltopdf --outline-depth 2 --enable-internal-links - ./static/pdf/all-docs-zh.pdf
```

View File

@ -1,4 +1,4 @@
baseURL = "https://kubesphere-v3.netlify.app"
baseURL = "https://kubesphere.io"
enableRobotsTXT = true

View File

View File

View File

@ -60,6 +60,8 @@
translation: Last updated
- id: Whats on this Page
translation: Whats on this Page
- id: Content
translation: Content
- id: Previous
translation: Previous
- id: Next

View File

@ -60,6 +60,8 @@
translation: 最新更新
- id: Whats on this Page
translation: 页面内容
- id: Content
translation: 目录
- id: Previous
translation: 上一篇
- id: Next
@ -129,4 +131,4 @@
- id: Install on Kubernetes
translation: 在 Kubernetes 安装
- id: Install on Linux
translation: 在 Linux 安装
translation: 在 Linux 安装

View File

@ -0,0 +1,7 @@
<p>
{{ if strings.HasPrefix .Destination "http" }}
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
{{ else }}
<img src="{{ .Destination | absURL | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
{{ end }}
</p>

View File

@ -1 +1,11 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener noreferrer"{{ end }}>{{ .Text }}</a>
{{ if strings.HasPrefix .Destination "http" }}
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }} target="_blank" rel="noopener noreferrer">{{ .Text }}</a>
{{ else }}
{{ $page := .Page.GetPage .Destination }}
{{ if $page }}
<a href="#{{ $page.UniqueID }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ .Text }}</a>
{{ else}}
{{ $page := .Page.GetPage (substr .Destination 3 -1) }}
<a href="#{{ $page.UniqueID }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ .Text }}</a>
{{ end }}
{{ end }}

637
layouts/all-docs/list.html Normal file
View File

@ -0,0 +1,637 @@
<!DOCTYPE html>
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
<head>
<meta charset="utf-8">
<title>Kubesphere Doc</title>
<style>
html {
font-size: 24px;
}
li {
margin-top: 20px;
}
.md-body {
line-height: 2;
word-wrap: break-word;
color: #485b7f;
}
.md-body::before {
display: table;
content: '';
}
.md-body::after {
display: table;
clear: both;
content: '';
}
.md-body > *:first-child {
margin-top: 0 !important;
}
.md-body > *:last-child {
margin-bottom: 0 !important;
}
.md-body a {
color: #55bc8a;
text-decoration: none;
}
.md-body .absent {
color: #cb2431;
}
.md-body .anchor {
float: left;
padding-right: 4px;
margin-left: -20px;
line-height: 1;
}
.md-body .anchor:focus {
outline: none;
}
.md-body p,
.md-body blockquote,
.md-body ul,
.md-body ol,
.md-body dl,
.md-body table,
.md-body pre {
margin: 0 0 12px;
}
.md-body hr {
height: 0.25em;
padding: 0;
margin: 24px 0;
background-color: #e1e4e8;
border: 0;
}
.md-body blockquote {
padding: 0 1em;
border-left: 4px solid #cfd9df;
line-height: 1.71;
color: #8f94a1;
}
.md-body blockquote > p {
line-height: 1.71;
color: #8f94a1;
}
.md-body blockquote > :first-child {
margin-top: 0;
}
.md-body blockquote > :last-child {
margin-bottom: 0;
}
.md-body kbd {
display: inline-block;
padding: 3px 5px;
line-height: 10px;
color: #444d56;
vertical-align: middle;
background-color: #fafbfc;
border: solid 1px #c6cbd1;
border-bottom-color: #959da5;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #959da5;
}
.md-body h1,
.md-body h2,
.md-body h3,
.md-body h4,
.md-body h5,
.md-body h6 {
margin-top: 20px;
margin-bottom: 5px;
font-weight: 600;
line-height: 1.5;
color: #171c34;
}
.md-body h1 .octicon-link,
.md-body h2 .octicon-link,
.md-body h3 .octicon-link,
.md-body h4 .octicon-link,
.md-body h5 .octicon-link,
.md-body h6 .octicon-link {
color: #1b1f23;
vertical-align: middle;
visibility: hidden;
}
.md-body h1:hover .anchor,
.md-body h2:hover .anchor,
.md-body h3:hover .anchor,
.md-body h4:hover .anchor,
.md-body h5:hover .anchor,
.md-body h6:hover .anchor {
text-decoration: none;
}
.md-body h1:hover .anchor .octicon-link,
.md-body h2:hover .anchor .octicon-link,
.md-body h3:hover .anchor .octicon-link,
.md-body h4:hover .anchor .octicon-link,
.md-body h5:hover .anchor .octicon-link,
.md-body h6:hover .anchor .octicon-link {
visibility: visible;
}
.md-body h1 tt,
.md-body h1 code,
.md-body h2 tt,
.md-body h2 code,
.md-body h3 tt,
.md-body h3 code,
.md-body h4 tt,
.md-body h4 code,
.md-body h5 tt,
.md-body h5 code,
.md-body h6 tt,
.md-body h6 code {
font-size: inherit;
}
.md-body h1 {
padding-bottom: 0.3em;
border-bottom: 1px solid #eaecef;
}
.md-body h2 {
font-weight: normal;
line-height: 1.63;
color: #171c34;
text-shadow: 0 4px 8px rgba(35, 45, 65, 0.1);
}
.md-body ul,
.md-body ol {
padding-left: 2em;
}
.md-body ul > li {
list-style: disc;
}
.md-body ol > li {
list-style: decimal;
}
.md-body ul.no-list,
.md-body ol.no-list {
padding: 0;
list-style-type: none;
}
.md-body ul ul,
.md-body ul ol,
.md-body ol ol,
.md-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.md-body li {
word-wrap: break-word;
}
.md-body li > p {
margin-top: 16px;
}
.md-body li + li {
margin-top: 0.25em;
}
.md-body dl {
padding: 0;
}
.md-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: 600;
}
.md-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.md-body table {
display: table;
width: 100%;
overflow: auto;
border-collapse: collapse;
}
.md-body table a {
word-break: break-word;
}
.md-body table th {
font-weight: 600;
border-radius: 3px;
background-color: #ecf0f2;
border: solid 1px #cfd9df;
text-align: left;
}
.md-body table th,
.md-body table td {
padding: 6px 13px;
border: 1px solid #dfe2e5;
}
.md-body table tr {
background-color: #fff;
border-top: 1px solid #c6cbd1;
}
.md-body table tr:nth-child(2n) {
background-color: #f6f8fa;
}
.md-body table img {
background-color: transparent;
}
.md-body img {
max-width: 100%;
box-sizing: content-box;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 4px 15px 0 rgba(7, 42, 68, 0.1);
}
.md-body img[align='right'] {
padding-left: 20px;
}
.md-body img[align='left'] {
padding-right: 20px;
}
.md-body .emoji {
max-width: none;
vertical-align: text-top;
background-color: transparent;
}
.md-body span.frame {
display: block;
overflow: hidden;
}
.md-body span.frame > span {
display: block;
float: left;
width: auto;
padding: 7px;
margin: 13px 0 0;
overflow: hidden;
border: 1px solid #dfe2e5;
}
.md-body span.frame span img {
display: block;
float: left;
}
.md-body span.frame span span {
display: block;
padding: 5px 0 0;
clear: both;
color: #24292e;
}
.md-body span.align-center {
display: block;
overflow: hidden;
clear: both;
}
.md-body span.align-center > span {
display: block;
margin: 13px auto 0;
overflow: hidden;
text-align: center;
}
.md-body span.align-center span img {
margin: 0 auto;
text-align: center;
}
.md-body span.align-right {
display: block;
overflow: hidden;
clear: both;
}
.md-body span.align-right > span {
display: block;
margin: 13px 0 0;
overflow: hidden;
text-align: right;
}
.md-body span.align-right span img {
margin: 0;
text-align: right;
}
.md-body span.float-left {
display: block;
float: left;
margin-right: 13px;
overflow: hidden;
}
.md-body span.float-left span {
margin: 13px 0 0;
}
.md-body span.float-right {
display: block;
float: right;
margin-left: 13px;
overflow: hidden;
}
.md-body span.float-right > span {
display: block;
margin: 13px auto 0;
overflow: hidden;
text-align: right;
}
.md-body code,
.md-body tt {
padding: 0.2em 0.4em;
margin: 0;
font-size: 85%;
background-color: rgba(27, 31, 35, 0.05);
border-radius: 3px;
}
.md-body code br,
.md-body tt br {
display: none;
}
.md-body del code {
text-decoration: inherit;
}
.md-body pre {
position: relative;
word-wrap: normal;
}
.md-body pre code {
display: inline-block;
white-space: pre;
padding: 1em;
font-family: Monaco;
line-height: 1.71;
color: #ffffff;
}
.md-body .highlight {
margin-bottom: 16px;
}
.md-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.md-body .highlight pre,
.md-body pre {
margin-bottom: 20px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
border-radius: 5px;
background-color: #242e42;
border: solid 1px #242e42;
}
.md-body .csv-data td,
.md-body .csv-data th {
padding: 5px;
overflow: hidden;
line-height: 1;
text-align: left;
white-space: nowrap;
}
.md-body .csv-data .blob-num {
padding: 10px 8px 9px;
text-align: right;
background: #fff;
border: 0;
}
.md-body .csv-data tr {
border-top: 0;
}
.md-body .csv-data th {
font-weight: 600;
background: #f6f8fa;
border-top: 0;
}
.md-body img {
max-width: 100%;
margin: 0 auto;
box-sizing: content-box;
background-color: #fff;
border-radius: 5px;
box-shadow: none;
}
.md-body blockquote {
padding: 4px 20px 4px 12px;
border-radius: 4px;
background-color: #ecf0f2;
}
.popular-page-div {
display: none;
}
a {
color: #00a971;
text-decoration: none;
}
a:hover {
color: #008a5c;
}
.notices {
margin: 20px 0;
position: relative;
}
.notices > p {
padding: 0 10px;
margin: 0!important;
height: 30px;
line-height: 30px;
color: #ffffff;
}
.notices > div {
padding: 10px;
}
.notices.note > p {
background: #6ab0de
}
.notices.note > div {
background: #e7f2fa;
}
.notices.tip > p {
background: #78C578
}
.notices.tip > div {
background: #E6F9E6;
}
.notices.info > p {
background: #F0B37E
}
.notices.info > div {
background: #FFF2DB;
}
.notices.warning > p {
background: #E06F6C
}
.notices.warning > div {
background: #FAE2E2;
}
.popular-page-div {
position: relative;
display: inline-block;
box-sizing: border-box;
width: 373px;
padding: 20px;
margin-top: 17px;
margin-left: 5px;
border-radius: 3px;
background-color: #f6f8fa;
}
.popular-page-div img {
position: absolute;
top: 50%;
left: 20px;
transform: translateY(-50%);
width: 40px;
height: 40px;
padding: 12px;
border-radius: 7px;
box-shadow: 0 4px 8px 0 rgba(36, 46, 66, 0.06), 0 8px 16px 0 rgba(36, 46, 66, 0.05);
background-color: #ffffff;
}
.popular-page-div div {
margin-left: 84px;
}
.popular-page-div h2 {
height: 24px;
font-size: 16px;
margin: 0;
text-align: left;
line-height: 1.5;
overflow: hidden;
}
.popular-page-div p {
max-height: 42px;
margin-top: 8px;
margin-bottom: 0;
font-size: 14px;
line-height: 1.5;
color: #31383e;
overflow: hidden;
}
</style>
</head>
<body>
<h1>{{ i18n "Content" }}</h1>
{{ define "table" }}
<li><a href="#{{ .File.UniqueID }}">{{ .LinkTitle }}</a></li>
{{ if .IsSection }}
<ul>
{{ range (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
{{ template "table" . }}
{{ end }}
</ul>
{{ end }}
{{ end }}
<ul>
{{ with .Site.GetPage "section" "docs" }}
{{ range (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
{{ template "table" . }}
{{ end }}
{{ end }}
</ul>
<div style="page-break-after:always;"></div>
<div style="page-break-before:always;"></div>
{{ define "content" }}
<h1 id="{{ .File.UniqueID }}">{{ .LinkTitle }}</h1>
<div class="md-body">
{{ .Content }}
</div>
<div style="page-break-after:always;"></div>
<div style="page-break-before:always;"></div>
{{ if .IsSection }}
{{ range (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
{{ template "content" . }}
{{ end }}
{{ end }}
{{ end }}
{{ with .Site.GetPage "section" "docs" }}
{{ range (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
{{ template "content" . }}
{{ end }}
{{ end }}
</body>
</html>

View File

@ -117,29 +117,14 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
</div>
</div>
</div>
{{ define "content" }}
{{ if .context.IsSection }}
<h{{.count}}>{{ .context.LinkTitle }}</h{{.count}}>
{{ else }}
<h{{.count}}><a href="{{ .context.RelPermalink }}">{{ .context.LinkTitle }}</a></h{{.count}}>
{{ end }}
<p>{{ .context.Description }}</p>
{{ $count := add .count 1 }}
{{ if .context.IsSection }}
{{ range (union (where .context.Pages ".context.Params._build.render" "!=" false) .context.Sections).ByWeight }}
{{ template "content" (dict "context" . "count" $count) }}
{{ end }}
{{ else}}
{{ end }}
{{ end }}
<div class="content-div main-div">
<div class="md-body">
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ range (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
{{ template "content" (dict "context" . "count" 2) }}
<h2>{{ .LinkTitle }}</h2>
<p>{{ .Description }}</p>
{{ end }}
</div>
</div>

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40" viewBox="0 0 40 40"><defs><linearGradient id="6js54ddskb" x1="50%" x2="50%" y1="0%" y2="96.807%"><stop offset="0%" stop-opacity="0"/><stop offset="100%" stop-opacity=".1"/></linearGradient><rect id="4h6iseb8xa" width="40" height="40" x="0" y="0" rx="20"/></defs><g fill="none" fill-rule="evenodd"><g><g><g><g transform="translate(-1199 -491) translate(926 483) translate(273 8)"><use fill="#86DBA2" xlink:href="#4h6iseb8xa"/><use fill="url(#6js54ddskb)" xlink:href="#4h6iseb8xa"/></g><g fill-rule="nonzero"><path fill="#FFF" d="M14.018 9.329l-7.26 4.868c-.734.492-1.728.296-2.22-.438-.177-.264-.271-.574-.271-.891V3.132c0-.883.716-1.6 1.6-1.6.317 0 .627.095.89.271l7.26 4.868c.735.492.93 1.486.439 2.22-.116.173-.265.322-.438.438z" transform="translate(-1199 -491) translate(926 483) translate(273 8) translate(12 12)"/></g></g></g></g></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40" viewBox="0 0 40 40"><defs><linearGradient id="6js54ddskb" x1="50%" x2="50%" y1="0%" y2="96.807%"><stop offset="0%" stop-opacity="0"/><stop offset="100%" stop-opacity=".1"/></linearGradient><rect id="4h6iseb8xa" width="40" height="40" x="0" y="0" rx="20"/></defs><g fill="none" fill-rule="evenodd"><g><g><g><g transform="translate(-1199 -491) translate(926 483) translate(273 8)"><use fill="#86DBA2" xlink:href="#4h6iseb8xa"/><use fill="url(#6js54ddskb)" xlink:href="#4h6iseb8xa"/></g><g fill-rule="nonzero"><path fill="#FFF" d="M14.018 9.329l-7.26 4.868c-.734.492-1.728.296-2.22-.438-.177-.264-.271-.574-.271-.891V3.132c0-.883.716-1.6 1.6-1.6.317 0 .627.095.89.271l7.26 4.868c.735.492.93 1.486.439 2.22-.116.173-.265.322-.438.438z" transform="translate(-1199 -491) translate(926 483) translate(273 8) translate(12 12)"/></g></g></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 952 B

After

Width:  |  Height:  |  Size: 953 B

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40" viewBox="0 0 40 40"><defs><linearGradient id="x2roophgib" x1="50%" x2="50%" y1="0%" y2="96.807%"><stop offset="0%" stop-opacity="0"/><stop offset="100%" stop-opacity=".1"/></linearGradient><rect id="oup9cb8fka" width="40" height="40" x="0" y="0" rx="20"/></defs><g fill="none" fill-rule="evenodd" opacity=".502"><g><g><g><g transform="translate(-1199 -427) translate(926 419) translate(273 8)"><use fill="#D5DEE7" xlink:href="#oup9cb8fka"/><use fill="url(#x2roophgib)" xlink:href="#oup9cb8fka"/></g><g fill-rule="nonzero"><path fill="#3D3E49" d="M14.018 9.329l-7.26 4.868c-.734.492-1.728.296-2.22-.438-.177-.264-.271-.574-.271-.891V3.132c0-.883.716-1.6 1.6-1.6.317 0 .627.095.89.271l7.26 4.868c.735.492.93 1.486.439 2.22-.116.173-.265.322-.438.438z" transform="translate(-1199 -427) translate(926 419) translate(273 8) translate(12 12)"/></g></g></g></g></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40" viewBox="0 0 40 40"><defs><linearGradient id="x2roophgib" x1="50%" x2="50%" y1="0%" y2="96.807%"><stop offset="0%" stop-opacity="0"/><stop offset="100%" stop-opacity=".1"/></linearGradient><rect id="oup9cb8fka" width="40" height="40" x="0" y="0" rx="20"/></defs><g fill="none" fill-rule="evenodd" opacity=".502"><g><g><g><g transform="translate(-1199 -427) translate(926 419) translate(273 8)"><use fill="#D5DEE7" xlink:href="#oup9cb8fka"/><use fill="url(#x2roophgib)" xlink:href="#oup9cb8fka"/></g><g fill-rule="nonzero"><path fill="#3D3E49" d="M14.018 9.329l-7.26 4.868c-.734.492-1.728.296-2.22-.438-.177-.264-.271-.574-.271-.891V3.132c0-.883.716-1.6 1.6-1.6.317 0 .627.095.89.271l7.26 4.868c.735.492.93 1.486.439 2.22-.116.173-.265.322-.438.438z" transform="translate(-1199 -427) translate(926 419) translate(273 8) translate(12 12)"/></g></g></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 971 B

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="288" height="83" viewBox="0 0 288 83"><g fill="none" fill-rule="evenodd"><g><g><g transform="translate(-140 -614) translate(140 303) translate(-28 336)"><circle cx="253.5" cy="101.5" r="50.5" stroke="#FFF" stroke-width="50" opacity=".062"/><circle cx="104.5" cy="104.5" r="104.5" stroke="#38FFB4" stroke-opacity=".153" stroke-width="50"/></g></g></g></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="288" height="83" viewBox="0 0 288 83"><g fill="none" fill-rule="evenodd"><g><g><g transform="translate(-140 -614) translate(140 303) translate(-28 336)"><circle cx="253.5" cy="101.5" r="50.5" stroke="#FFF" stroke-width="50" opacity=".062"/><circle cx="104.5" cy="104.5" r="104.5" stroke="#38FFB4" stroke-opacity=".153" stroke-width="50"/></g></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 408 B