Skip to content

Commit

Permalink
docs: add docs for RTD
Browse files Browse the repository at this point in the history
  • Loading branch information
tmihoc committed Dec 12, 2024
1 parent e07983e commit 7772c99
Show file tree
Hide file tree
Showing 455 changed files with 24,448 additions and 919 deletions.
4 changes: 2 additions & 2 deletions docs/.sphinx/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
canonical-sphinx[full] @ git+https://github.com/canonical/canonical-sphinx@main
canonical-sphinx[full]
sphinx-autobuild
sphinxcontrib-svg2pdfconverter[CairoSVG]
sphinx-tabs
10 changes: 5 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#
# TODO: Update with the official name of your project or product

project = "Juju CLI and core"
project = "Juju"
author = "Canonical Ltd."


Expand Down Expand Up @@ -103,7 +103,7 @@

html_context = {
# Product page URL; can be different from product docs URL
"product_page": "juju.is",
"product_page": "juju.is",
# Product tag image; the orange part of your logo, shown in the page header
'product_tag': '/docs/logos/juju-logo.png',
# Your Discourse instance URL
Expand Down Expand Up @@ -201,9 +201,9 @@
# - youtube-links

extensions = [
"canonical_sphinx",
"sphinxcontrib.cairosvgconverter",
]
'canonical_sphinx',
'sphinx_design',
]


# Excludes files or directories from processing
Expand Down
8 changes: 8 additions & 0 deletions docs/contributor/explanation/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(explanation)=
# Explanation

TBA

```{toctree}
```
File renamed without changes.
7 changes: 4 additions & 3 deletions docs/dev/how-to/index.md → docs/contributor/howto/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
(how-to)=
(how-to-guides)=
# How-to guides

How-to guides for Juju developers

```{toctree}
:titlesonly:
:glob:
/dev/how-to/*
```
/contributor/howto/*
```
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,9 @@
This document demonstrates how to write a unit test for Juju.

<!-- TOC -->
## Prepare for the test

* [Prepare for the test](#prepare-for-the-test)
* [Create `package_test.go`](#create-package_testgo)
* [Create](#create)
* [Import `gocheck`](#import-gocheck)
* [Add a unit test suite](#add-a-unit-test-suite)
* [Write the test](#write-the-test)
* [Run the test](#run-the-test)

<!-- TOC -->

# Prepare for the test

## Create `package_test.go`
### Create `package_test.go`

[note type=caution]
This step is necessary only if this file doesn't already exist.
Expand Down Expand Up @@ -58,7 +46,7 @@ to run old-style `JujuConnSuite` tests, which test against a running instance of
These tests are deprecated and are actively being removed. No more should be added.
[/note]

## Create
### Create

`

Expand All @@ -80,7 +68,7 @@ gc "gopkg.in/check.v1"
`gc` is the usual alias for [gocheck](https://labix.org/gocheck) across all the Juju repositories.
[/note]

## Add a unit test suite
### Add a unit test suite

> See also: [Unit test suite](/doc/dev/reference/testing/unit-testing/unit-test-suite.md)
Expand All @@ -97,7 +85,7 @@ type magicSuite struct{}
var _ = gc.Suite(&magicSuite{})
```

# Write the test
## Write the test

> See also: [Checker](/doc/dev/reference/testing/unit-testing/checker.md)
Expand Down Expand Up @@ -131,7 +119,7 @@ c.Assert(res, gc.Equals, 8)
}
```

# Run the test
## Run the test

Finally, to run the test, do:

Expand All @@ -153,4 +141,3 @@ See more here [`gocheck` > Selecting which tests to run](https://labix.org/goche
[/note]


> <small>Contributors: @jack-shaw </small>
58 changes: 58 additions & 0 deletions docs/contributor/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
(dev)=
# Juju contributor documentation

<!--
```{toctree}
:titlesonly:
:glob:
:maxdepth: 1
:hidden:
how-to/index.md
reference/index.md
unsorted/index.md
```
-->



````{grid} 1 1 2 2
```{grid-item-card} [Tutorial](tutorial)
:link: tutorial
:link-type: doc
**Start here**: a hands-on introduction to Juju for new contributors
```
```{grid-item-card} [How-to guides](/index)
:link: howto/index
:link-type: doc
**Step-by-step guides** covering key operations and common tasks
```
````

````{grid} 1 1 2 2
:reverse:
```{grid-item-card} [Reference](/index)
:link: reference/index
:link-type: doc
**Technical information** - specifications, APIs, architecture
```
```{grid-item-card} [Explanation](/index)
:link: explanation/index
:link-type: doc
**Discussion and clarification** of key topics
```
````




File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 7 additions & 16 deletions docs/custom_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import subprocess
import shutil

cli_dir = "user/cli/"
cli_dir = "user/reference/juju-cli/list-of-juju-cli-commands/"

# Remove existing cli folder to regenerate it
if os.path.exists(cli_dir):
Expand All @@ -12,29 +12,20 @@
subprocess.run(["juju", 'documentation', '--split', '--no-index', '--out', cli_dir],
check=True)

titles = []

for page in os.listdir(cli_dir):
title = page[:-3]
title = "`juju " + page[:-3]+ "`"
anchor = "command-juju-" + page[:-3]
# Add sphinx names to each file.
with open(os.path.join(cli_dir, page), 'r+') as mdfile:
content = mdfile.read()
# Remove trailing seperated (e.g. ----)
content = content.rstrip(" -\n")
mdfile.seek(0, 0)
mdfile.write('(' + page + ')=\n' +
'# `' + title + '`\n' +
mdfile.write('(' + anchor + ')=\n' +
'# ' + title + '\n' +
content)
titles.append(title)



# Add the template for the index file containing the command list.
if (not os.path.isfile(cli_dir + 'index.md')):
os.system('cp ' + 'user/cli_index.template ' + cli_dir + 'index.md')

# Write the list of commands to the index file toctree.
with open(cli_dir + "index.md", 'a') as index:
titles.sort()
for title in titles:
index.write(title + '\n')
index.write("```")
os.system('cp ' + 'user/reference/juju-cli/cli_index.template ' + cli_dir + 'index.md')
50 changes: 0 additions & 50 deletions docs/dev/index.md

This file was deleted.

63 changes: 55 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,77 @@
# Juju CLI and Controller documentation
# Juju documentation

Juju is an open source orchestration engine for software operators that enables the deployment, integration and lifecycle management of applications at any scale, on any infrastructure, using special software operators called ‘charms’.

Juju provides a model-driven way to install, provision, maintain, update, upgrade, and integrate applications on and across Kubernetes containers, Linux containers, virtual machines, and bare metal machines, on public or private cloud.

As such, Juju makes it simple, intuitive, and efficient to manage the full lifecycle of complex applications in hybrid cloud.

For system operators and DevOps who manage applications in the cloud, Juju simplifies code; for CIOs, it helps align code with business decisions.

This documentation contains the CIL and controller documentation.

## In this documentation

```{toctree}
:titlesonly:
:glob:
:hidden:
dev/index.md
user/index.md
- Tutorial <user/tutorial>
- How-to guides <user/howto/index>
- Reference <user/reference/index>
- Explanation <user/explanation/index>
contributor/index.md
- Tutorial <contributor/tutorial>
- How-to guides <contributor/howto/index>
- Reference <contributor/reference/index>
- Explanation <contributor/explanation/index>
- Unsorted <contributor/unsorted/index>
````
````{grid} 1 1 2 2
```{grid-item-card} [User reference](user/index.md)
```{grid-item-card} [User docs](user/index.md)
Docs for people who want to use `juju`, whether as SREs or as charm authors
**Reference inforamtion** for the controller and CLI
- [Tutorial](user/tutorial) -> **Start here!**
- [How-to guides](user/howto/index)
- [Reference](user/reference/index)
- [Explanation](user/explanation/index)
```

```{grid-item-card} [Developer documentation](dev/index.md)
```{grid-item-card} [Contributor docs](contributor/index.md)
Docs for people who want to contribute to `juju`, whether docs or code
**Developer information** for understanding and working on Juju
- [Tutorial](contributor/tutorial)
- [How-to guides](contributor/howto/index)
- [Reference](contributor/reference/index)
- [Explanation](contributor/explanation/index)
- [Unsorted](contributor/unsorted/index)
```

````
(project-and-community)=
## Project and community
Juju is an open source project that warmly welcomes community projects, contributions, suggestions, fixes and
constructive feedback.
* Learn about the [Roadmap & Releases](https://discourse.charmhub.io/t/5064)
* Read our [Code of Conduct ](https://ubuntu.com/community/code-of-conduct)
* Join our [Matrix chat](https://matrix.to/#/#charmhub-jujudev:ubuntu.com)
* Join the [Discourse forum ](https://discourse.charmhub.io/t/welcome-to-the-charmed-operator-community/8) to talk
about [Juju](https://discourse.charmhub.io/tags/c/juju/6/community-workshop), [charms](https://discourse.charmhub.io/c/charm/41), [docs](https://discourse.charmhub.io/c/doc/22),
or [to meet the community](https://discourse.charmhub.io/tag/community-workshop)
* Report a bug on [Launchpad ](https://bugs.launchpad.net/juju) (for code)
or [GitHub](https://github.com/juju/docs/issues) (for docs)
* Contribute to the documentation
on [Discourse](https://discourse.charmhub.io/t/documentation-guidelines-for-contributors/1245)
* Contribute to the code on [GitHub](https://github.com/juju/juju/blob/develop/CONTRIBUTING.md)
* Visit the [Juju careers page](https://juju.is/careers)
Loading

0 comments on commit 7772c99

Please sign in to comment.