Skip to content

Commit

Permalink
Merge pull request #220 from lxc-jp/update-2022-04-01
Browse files Browse the repository at this point in the history
Update translations of LXD 5.0.0 (Closes #219)
  • Loading branch information
tenforward authored Apr 7, 2022
2 parents 83ce71e + 80fa9cb commit d93c2e7
Show file tree
Hide file tree
Showing 30 changed files with 772 additions and 161 deletions.
57 changes: 29 additions & 28 deletions .sphinx/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
alabaster==0.7.12
Babel==2.9.1
certifi==2021.5.30
charset-normalizer==2.0.4
colorama==0.4.4
docutils==0.16.0
idna==3.2
imagesize==1.2.0
Jinja2==3.0.1
livereload==2.6.3
MarkupSafe==2.0.1
packaging==21.0
Pygments==2.10.0
pyparsing==2.4.7
pytz==2021.1
requests==2.26.0
six==1.16.0
snowballstemmer==2.1.0
Sphinx==4.1.2
sphinx-autobuild==2021.3.14
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tornado==6.1
urllib3==1.26.6
alabaster
Babel
certifi
charset-normalizer
colorama
docutils<0.18
idna
imagesize
Jinja2
livereload
MarkupSafe
packaging
Pygments
pyparsing
pytz
requests
six
snowballstemmer
Sphinx
sphinx-autobuild
sphinxcontrib-applehelp
sphinxcontrib-devhelp
sphinxcontrib-htmlhelp
sphinxcontrib-jsmath
sphinxcontrib-qthelp
sphinxcontrib-serializinghtml
tornado
urllib3
myst-parser
sphinx-tabs
sphinx-reredirects
linkify-it-py
furo
sphinxext-opengraph>=0.6.1
125 changes: 125 additions & 0 deletions doc/_extensions/related-links.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
######################################################################
# This extension allows adding related links on a per-page basis
# in two ways (which can be combined):
#
# - Add links to Discourse topics by specifying the Discourse prefix
# in the html_context variable in conf.py, for example:
#
# html_context = {
# "discourse_prefix": "https://discuss.linuxcontainers.org/t/"
# }
#
# Then add the topic IDs that you want to link to the metadata at
# the top of the page using the tag "discourse".
# For example (in MyST syntax):
#
# ---
# discourse: 12033,13128
# ---
#
# - Add related URLs to the metadata at the top of the page using
# the tag "relatedlinks". The link text is extracted automatically
# or can be specified in Markdown syntax. Note that spaces are
# ignored; if you need spaces in the title, replace them with &#32;.
# For example (in MyST syntax):
#
# ---
# relatedlinks: https://www.example.com, [Link&#32;text](https://www.example.com)
# ---
#
# If Sphinx complains about the metadata value because it starts
# with "[", enclose the full value in double quotes.
#
# For both ways, check for errors in the output. Invalid links are
# not added to the output.
######################################################################

import requests
import json
from bs4 import BeautifulSoup

cache = {}

def setup_func(app, pagename, templatename, context, doctree):

def discourse_links(IDlist):

if context["discourse_prefix"] and IDlist:

posts = IDlist.strip().replace(" ","").split(",")

linklist = "<ul>";

for post in posts:
title = ""
linkurl = context["discourse_prefix"]+post

if post in cache:
title = cache[post]
else:
try:
r = requests.get(linkurl+".json")
r.raise_for_status()
title = json.loads(r.text)["title"]
cache[post] = title
except requests.HTTPError as err:
print(err)

if title:
linklist += '<li><a href="'+linkurl+'" target="_blank">'+title+'</a></li>'

linklist += "</ul>"

return linklist

else:
return ""

def related_links(linklist):

if linklist:

links = linklist.strip().replace(" ","").split(",")

linklist = "<ul>";

for link in links:
title = ""

if link in cache:
title = cache[link]
elif link.startswith("[") and link.endswith(")"):
split = link.partition("](")
title = split[0][1:]
link = split[2][:-1]
else:
try:
r = requests.get(link)
r.raise_for_status()
soup = BeautifulSoup(r.text, 'html.parser')
title = soup.title.get_text()
cache[link] = title
except requests.HTTPError as err:
print(err)

if title:
linklist += '<li><a href="'+link+'" target="_blank">'+title+'</a></li>'

linklist += "</ul>"

return linklist

else:
return ""

context['discourse_links'] = discourse_links
context['related_links'] = related_links

def setup(app):
app.connect("html-page-context", setup_func)

return {
'version': '0.1',
'parallel_read_safe': True,
'parallel_write_safe': True,
}
31 changes: 31 additions & 0 deletions doc/_extensions/youtube-link.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from docutils import nodes
from docutils.parsers.rst import Directive

class YouTubeLink(Directive):

required_arguments = 1
optional_arguments = 0
has_content = False

def run(self):

fragment = ' \
<p class="youtube_link"> \
<a href="'+self.arguments[0]+'" target="_blank"> \
<span class="play_icon">▶</span> \
<span>Watch on YouTube</span> \
</a> \
</p>'
raw = nodes.raw(text=fragment, format="html")

return [raw]


def setup(app):
app.add_directive("youtube", YouTubeLink)

return {
'version': '0.1',
'parallel_read_safe': True,
'parallel_write_safe': True,
}
75 changes: 75 additions & 0 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,78 @@ table.min-width-4-8 td.text-left:nth-child(4) {
abbr[title] {
text-decoration: underline solid #cdcdcd;
}

/** Use the same style for right-details as for left-details **/
.bottom-of-page .right-details {
font-size: var(--font-size--small);
display: block;
}

/** Links to YouTube videos **/

p.youtube_link {
float: right;
border: 1px #cdcdcd solid;
margin-left: 5px;
margin-bottom: 5px;
padding-bottom: 5px;
}

p.youtube_link a {
text-align: center;
}

p.youtube_link span.play_icon {
color: #E95420;
font-size: 2em;
}

p.youtube_link span.play_icon::after {
content: "\a"
}

p.youtube_link span {
display: block;
font-size: small;
max-width: 70px;
}

/** Related links **/

.relatedlinks-title {
color: var(--color-toc-title-text);
font-size: var(--toc-title-font-size);
padding-left: var(--toc-spacing-horizontal);
text-transform: uppercase;
}

.relatedlinks {
font-size: var(--font-size--small--2);
padding-left: calc(var(--toc-spacing-horizontal) - var(--toc-item-spacing-horizontal));
padding-bottom: 1em;
}

.relatedlinks ul {
list-style-type: none;
margin-bottom: 0;
margin-top: 0;
padding-left: var(--toc-item-spacing-horizontal);
}

.relatedlinks li {
padding-top: var(--toc-item-spacing-vertical);
}

.relatedlinks a {
overflow-wrap: anywhere;
text-decoration: none;
}

.relatedlinks a::before {
content: url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='12' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke-width='1.5' stroke='%23607D8B' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 0h24v24H0z' stroke='none'/%3E%3Cpath d='M11 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-5M10 14 20 4M15 4h5v5'/%3E%3C/svg%3E");
margin-right: 0.25rem;
}

.relatedlinks-title-container {
padding-top: 2em;
}
39 changes: 39 additions & 0 deletions doc/_templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,42 @@
{% include "header.html" %}
{{ super() }}
{%- endblock body %}

{% if meta and ((meta.discourse and discourse_prefix) or meta.relatedlinks) %}
{% set furo_hide_toc_orig = furo_hide_toc %}
{% set furo_hide_toc=false %}
{% endif %}

{% block right_sidebar %}
<div class="toc-sticky toc-scroll">
{% if not furo_hide_toc_orig %}
<div class="toc-title-container">
<span class="toc-title">
{{ _("Contents") }}
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
{{ toc }}
</div>
</div>
{% endif %}
{% if meta and ((meta.discourse and discourse_prefix) or meta.relatedlinks) %}
<div class="relatedlinks-title-container">
<span class="relatedlinks-title">
関連リンク
</span>
</div>
<div class="relatedlinks-container">
<div class="relatedlinks">
{% if meta.discourse and discourse_prefix %}
{{ discourse_links(meta.discourse) }}
{% endif %}
{% if meta.relatedlinks %}
{{ related_links(meta.relatedlinks) }}
{% endif %}
</div>
</div>
{% endif %}
</div>
{% endblock right_sidebar %}
17 changes: 17 additions & 0 deletions doc/api-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1601,3 +1601,20 @@ LXDが使用するCPU時間をミリ秒ではなく秒単位で出力するよ

## metrics\_authentication
`core.metrics_authentication` というサーバ設定オプションを追加し /1.0/metrics のエンドポイントをクライアント認証無しでアクセスすることを可能にします。

## images\_target\_project
コピー元とは異なるプロジェクトにイメージをコピーできるようにします。

## cluster\_migration\_inconsistent\_copy
`POST /1.0/instances/<name>``allow_inconsistent` フィールドを追加します。 true に設定するとクラスタメンバー間で不整合なコピーを許します。

## cluster\_ovn\_chassis
`ovn-chassis` というクラスタロールを追加します。これはクラスタメンバーが OVN シャーシとしてどう振る舞うかを指定できるようにします。

## container\_syscall\_intercept\_sched\_setscheduler
`security.syscalls.intercept.sched_setscheduler` を追加し、コンテナ内の高度なプロセス優先度管理を可能にします。

## storage\_lvm\_thinpool\_metadata\_size
`storage.thinpool_metadata_size` により thinpool のメタデータボリュームサイズを指定できるようにします。

指定しない場合のデフォルトは LVM が適切な thinpool のメタデータボリュームサイズを選択します。
Loading

0 comments on commit d93c2e7

Please sign in to comment.