Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MicroCloud doc integration #372

Merged
merged 9 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ jobs:
uses: canonical/documentation-workflows/.github/workflows/documentation-checks.yaml@main
with:
working-directory: './doc'
makefile: 'Makefile'

snap:
name: Trigger snap edge build
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ update-schema:
@echo "Code generation completed"

doc-%:
cd doc && $(MAKE) -f Makefile.sp sp-$* ALLFILES='*.md **/*.md'
cd doc && $(MAKE) -f Makefile $* ALLFILES='*.md **/*.md'

doc: doc-clean-doc doc-html
1 change: 1 addition & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ __pycache__
.vscode/
.sphinx/styles/*
.sphinx/vale.ini
integration/
17 changes: 12 additions & 5 deletions doc/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ version: 2
build:
os: ubuntu-22.04
tools:
golang: "1.22"
python: "3.11"
jobs:
pre_install:
- cd doc && python3 .sphinx/build_requirements.py
commands:
- git fetch --unshallow || true
- cd doc && make integrate
- cd doc/integration/lxd/ && go build -ldflags "-s -w" -o trimpath -o lxc.bin ./lxc
# Pretend that woke is installed - we don't need it for building
# (workaround until https://github.com/canonical/microovn/pull/168 is merged
# and https://github.com/canonical/microceph/pull/400 is restored)
- ln -s /bin/true doc/integration/microovn/docs/woke
- ln -s /bin/true doc/integration/microceph/docs/woke
- make doc-html-rtd PATH=$PATH:.

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand All @@ -22,8 +29,8 @@ sphinx:
fail_on_warning: true

# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf
#formats:
# - pdf
MggMuggins marked this conversation as resolved.
Show resolved Hide resolved

# Optionally declare the Python requirements required to build your docs
python:
Expand Down
20 changes: 20 additions & 0 deletions doc/.sphinx/_integration/add_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Links to other doc sets (used in the header)
# All paths are relative to the URL of one doc set
html_context['microcloud_path'] = "../microcloud"
html_context['microcloud_tag'] = "../microcloud/_static/tag.png"
html_context['lxd_path'] = "../lxd"
html_context['lxd_tag'] = "../lxd/_static/tag.png"
html_context['microceph_path'] = "../microceph"
html_context['microceph_tag'] = "../microceph/_static/tag.png"
html_context['microovn_path'] = "../microovn"
html_context['microovn_tag'] = "../microovn/_static/microovn.png"

# Add the search JavaScript file
custom_html_js_files.append('rtd-search.js')

if project == "LXD":
html_baseurl = "https://documentation.ubuntu.com/lxd/en/latest/"
elif project == "MicroCeph":
html_baseurl = "https://canonical-microceph.readthedocs-hosted.com/en/latest/"
elif project == "MicroOVN":
html_baseurl = "https://canonical-microovn.readthedocs-hosted.com/en/latest/"
179 changes: 179 additions & 0 deletions doc/.sphinx/_integration/header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
.p-navigation {
MggMuggins marked this conversation as resolved.
Show resolved Hide resolved
border-bottom: 1px solid var(--color-sidebar-background-border);
}

.p-navigation__nav {
background: #333333;
display: flex;
}

.p-logo {
display: flex !important;
padding-top: 0 !important;
text-decoration: none;
}

.p-logo-image {
height: 44px;
padding-right: 10px;
}

.p-logo-text {
margin-top: 18px;
color: white;
text-decoration: none;
}

ul.p-navigation__links {
display: flex;
list-style: none;
margin-left: 0;
margin-top: auto;
margin-bottom: auto;
width: 100%;
}

ul.p-navigation__links li {
margin: 0 auto;
text-align: center;
width: 100%;
padding-left: 20px;
}

ul.p-navigation__links li.active {
background-color: #E95420;
}

ul.p-navigation__links li a {
background-color: rgba(0, 0, 0, 0);
border: none;
border-radius: 0;
color: var(--color-sidebar-link-text);
display: block;
font-weight: 400;
line-height: 1.5rem;
margin: 0;
overflow: hidden;
padding: 1rem 0;
position: relative;
text-align: left;
text-overflow: ellipsis;
transition-duration: .1s;
transition-property: background-color, color, opacity;
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
white-space: nowrap;
width: 100%;
}

ul.p-navigation__links .p-navigation__link {
color: #ffffff;
font-weight: 300;
text-align: center;
text-decoration: none;
}


ul.p-navigation__links li a:hover {
text-decoration: none;
}
ul.p-navigation__links li a:visited:hover {
text-decoration: none;
}

ul.p-navigation__links .p-navigation__link:hover {
background-color: #2b2b2b;
}

ul.p-navigation__links .p-dropdown__link:hover {
background-color: var(--color-sidebar-item-background--hover);
}

ul.p-navigation__links .p-navigation__sub-link {
background: var(--color-background-primary);
padding: .5rem 0 .5rem .5rem;
font-weight: 300;
}

ul.p-navigation__links .more-links-dropdown li a {
border-left: 1px solid var(--color-sidebar-background-border);
border-right: 1px solid var(--color-sidebar-background-border);
}

ul.p-navigation__links .more-links-dropdown li:first-child a {
border-top: 1px solid var(--color-sidebar-background-border);
}

ul.p-navigation__links .more-links-dropdown li:last-child a {
border-bottom: 1px solid var(--color-sidebar-background-border);
}

ul.p-navigation__links .p-navigation__logo {
padding: 0.5rem;
}

ul.p-navigation__links .p-navigation__logo img {
width: 40px;
}

ul.more-links-dropdown {
display: none;
overflow-x: visible;
height: 0;
z-index: 55;
padding: 0;
position: relative;
list-style: none;
margin-bottom: 0;
margin-top: 0;
}

.nav-more-links::after {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill='%23111' d='M8.187 11.748l6.187-6.187-1.06-1.061-5.127 5.127L3.061 4.5 2 5.561z'/%3E%3C/svg%3E");
background-position: center;
background-repeat: no-repeat;
background-size: contain;
content: "";
display: block;
filter: invert(100%);
height: 1rem;
pointer-events: none;
position: absolute;
right: 1rem;
text-indent: calc(100% + 10rem);
top: calc(1rem + 0.25rem);
width: 1rem;
}

.nav-ubuntu-com {
display: none;
}

@media only screen and (min-width: 480px) {
ul.p-navigation__links li {
width: 100%;
}

.nav-ubuntu-com {
display: inherit;
}
}

@media only screen and (max-width: 800px) {
.nav-more-links {
margin-left: auto !important;
padding-right: 2rem !important;
width: 8rem !important;
}
}

@media only screen and (min-width: 800px) {
ul.p-navigation__links li {
width: 100% !important;
}
}

@media only screen and (min-width: 1310px) {
ul.p-navigation__links {
margin-left: calc(50% - 41em);
}
}
43 changes: 43 additions & 0 deletions doc/.sphinx/_integration/lxd.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<header id="header" class="p-navigation">
MggMuggins marked this conversation as resolved.
Show resolved Hide resolved

<div class="p-navigation__nav" role="menubar">

<ul class="p-navigation__links" role="menu">

<li>
<a class="p-logo" href="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microcloud_path }}/" aria-current="page">
<img src="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microcloud_tag }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">MicroCloud
</div>
</a>
</li>

<li class="active">
<a class="p-logo" href="{{ pathto(root_doc) }}" aria-current="page">
<img src="{{ pathto(product_tag,1) }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">{{ project }}
</div>
</a>
</li>

<li>
<a class="p-logo" href="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microceph_path }}/" aria-current="page">
<img src="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microceph_tag }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">MicroCeph
</div>
</a>
</li>

<li>
<a class="p-logo" href="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microovn_path }}/" aria-current="page">
<img src="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microovn_tag }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">MicroOVN
</div>
</a>
</li>



</ul>
</div>
</header>
43 changes: 43 additions & 0 deletions doc/.sphinx/_integration/microceph.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<header id="header" class="p-navigation">

<div class="p-navigation__nav" role="menubar">

<ul class="p-navigation__links" role="menu">

<li>
<a class="p-logo" href="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microcloud_path }}/" aria-current="page">
<img src="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microcloud_tag }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">MicroCloud
</div>
</a>
</li>

<li>
<a class="p-logo" href="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ lxd_path }}/" aria-current="page">
<img src="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ lxd_tag }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">LXD
</div>
</a>
</li>

<li class="active">
<a class="p-logo" href="{{ pathto(root_doc) }}" aria-current="page">
<img src="{{ pathto(product_tag,1) }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">{{ project }}
</div>
</a>
</li>

<li>
<a class="p-logo" href="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microovn_path }}/" aria-current="page">
<img src="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microovn_tag }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">MicroOVN
</div>
</a>
</li>



</ul>
</div>
</header>
43 changes: 43 additions & 0 deletions doc/.sphinx/_integration/microcloud.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<header id="header" class="p-navigation">

<div class="p-navigation__nav" role="menubar">

<ul class="p-navigation__links" role="menu">

<li class="active">
<a class="p-logo" href="{{ pathto(root_doc) }}" aria-current="page">
<img src="{{ pathto(product_tag,1) }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">{{ project }}
</div>
</a>
</li>

<li>
<a class="p-logo" href="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ lxd_path }}/" aria-current="page">
<img src="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ lxd_tag }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">LXD
</div>
</a>
</li>

<li>
<a class="p-logo" href="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microceph_path }}/" aria-current="page">
<img src="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microceph_tag }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">MicroCeph
</div>
</a>
</li>

<li>
<a class="p-logo" href="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microovn_path }}/" aria-current="page">
<img src="{{ pathto(root_doc) if pathto(root_doc) != '#' }}{{ microovn_tag }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">MicroOVN
</div>
</a>
</li>



</ul>
</div>
</header>
Loading
Loading