Skip to content

Commit d63208d

Browse files
docs: set up intersphinx and add links (#1546)
This PR sets up intersphinx for Juju and Charmcraft links and adds intersphinx-style links to Juju and Charmcraft in all the places we had bookmarked through UPDATE LINKS comments before (see #1516 ). --------- Co-authored-by: Tony Meyer <[email protected]>
1 parent 427aaf3 commit d63208d

15 files changed

+86
-125
lines changed

docs/custom_conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,11 @@
295295

296296
# This config value contains the locations and names of other projects
297297
# that should be linked to in this documentation.
298-
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
298+
intersphinx_mapping = {
299+
'python': ('https://docs.python.org/3', None),
300+
'juju': ('https://canonical-juju.readthedocs-hosted.com/en/latest/', None),
301+
'charmcraft': ('https://canonical-charmcraft.readthedocs-hosted.com/en/latest/', None),
302+
}
299303

300304
# -- General configuration ---------------------------------------------------
301305

docs/howto/manage-actions.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
(manage-actions)=
22
# How to manage actions
3-
4-
<!-- UPDATE LINKS
5-
> See first: [`juju` | Action](https://juju.is/docs/juju/action), [`juju` | Manage actions](https://juju.is/docs/juju/manage-actions), [`charmcraft` | Manage actions]()
6-
-->
3+
> See first: {external+juju:ref}`Juju | Charm <action>`, {external+juju:ref}`Juju | Manage actions <manage-actions>`, {external+charmcraft:ref}`Charmcraft | Manage actions <manage-actions>`
74
85
## Implement the feature
96

docs/howto/manage-configurations.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
(manage-configurations)=
22
# Manage configurations
3-
4-
<!-- UPDATE LINKS:
5-
> See first: [`juju` | Application configuration](https://juju.is/docs/juju/configuration#heading--application-configuration), [`juju` | Manage application configurations](https://juju.is/docs/juju/manage-applications#heading--configure-an-application), [`charmcraft` | Manage configurations]()
6-
-->
3+
> See first: {external+juju:ref}`Juju | <application-configuration>`, {external+juju:ref}`Juju | Manage applications > Configure <configure-an-application>`, {external+charmcraft:ref}`Charmcraft | Manage configurations <manage-configurations>`
74
85

96
## Implement the feature

docs/howto/manage-leadership-changes.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
(manage-leadership-changes)=
22
# Manage leadership changes
3-
4-
<!-- UPDATE LINKS:
5-
> See first: [`juju` | Leader](https://juju.is/docs/juju/leader)
6-
-->
3+
> See first: {external+juju:ref}`Juju | Leader unit <leader-unit>`
74
85
## Implement response to leadership changes
96

docs/howto/manage-libraries.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
(manage-libraries)=
22
# Manage libraries
3+
> See first: {external+charmcraft:ref}`Charmcraft | Manage libraries <manage-libraries>`
4+
35

4-
<!-- UPDATE LINKS:
5-
> See first: [`juju` | Library](), [`charmcraft` | Manage libraries]()
6-
-->
76
## Write a library
87

98
When you're writing libraries, instead of callbacks, you can use custom events; that'll result in a more `ops`-native-feeling API. A custom event is, from a technical standpoint, an EventBase subclass that can be emitted at any point throughout the charm's lifecycle. These events are therefore totally unknown to Juju. They are essentially charm-internal, and can be useful to abstract certain conditional workflows and wrap the toplevel Juju event so it can be observed independently.
@@ -221,10 +220,6 @@ def test_my_object_data(context, endpoint, n_relations):
221220

222221
Fetch the library.
223222

224-
<!-- UPDATE LINKS:
225-
> See more: [`charmcraft` | Manage libraries]()
226-
-->
227-
228223
In your `src/charm.py`, observe the custom events it puts at your disposal. For example, a database library may have provided a `database_relation_ready` event -- a high-level wrapper around the relevant `juju` relation events -- so you use it to manage the database integration in your charm as below:
229224

230225
```python

docs/howto/manage-logs.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
(how-to-log-a-message-in-a-charm)=
22
# How to log a message in a charm
33

4-
<!-- UPDATE LINKS:
5-
> See first: [`juju` | Log](https://juju.is/docs/juju/log), [`juju` | How to manage logs > Manage the logging configuration](https://juju.is/docs/juju/manage-logs#heading--manage-the-logging-configuration)
6-
-->
4+
> See first: {external+juju:ref}`Juju | Log <log>`, {external+juju:ref}`Juju | Manage logs <manage-logs>`
75
86
<!--
97
>

docs/howto/manage-relations.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
(manage-relations)=
22
# How to manage relations
3+
> See first: {external+juju:ref}`Juju | Relation <relation>`, {external+juju:ref}`Juju | Manage relations <manage-relations>`, {external+charmcraft:ref}`Charmcraft | Manage relations <manage-relations>`
34
45
To add integration capabilities to a charm, you’ll have to define the relation in your charm’s charmcraft.yaml file and then add relation event handlers in your charm’s `src/charm.py` file.
56

6-
<!-- UPDATE LINKS
7-
> See first: [`juju` | Relation (integration)](https://juju.is/docs/juju/relation), [`juju` | Manage relations](https://juju.is/docs/juju/manage-relations), [`charmcraft` | Manage relations]()
8-
-->
9-
107
## Implement the feature
118

129
### Declare the relation endpoint

docs/howto/manage-resources.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
(manage-resources)=
22
# How to manage resources
33

4-
<!-- UPDATE LINKS:
5-
> See also: [`juju` | Resource (charm)](https://juju.is/docs/juju/charm-resource), [`juju` | Manage resources](https://juju.is/docs/juju/manage-charm-resources), [`charmcraft` | Manage resources]()
6-
-->
4+
> See also: {external+juju:ref}`Juju | Charm resource <charm-resource>`, {external+juju:ref}`Juju | Manage charm resources <manage-charm-resources>`, {external+charmcraft:ref}`Charmcraft | Manage resources <manage-resources>`
75
86
## Implement the feature
97

docs/howto/manage-secrets.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
(manage-secrets)=
22
# How to manage secrets
3-
4-
<!-- UPDATE LINKS:
5-
> See first: [`juju` | Secret](https://juju.is/docs/juju/secret), [`juju` | Manage secrets](https://juju.is/docs/juju/manage-secrets), [`charmcraft` | Manage secrets]()
6-
-->
3+
> See first: {external+juju:ref}`Juju | Secret <secret>`, {external+juju:ref}`Juju | Manage secrets <manage-secrets>`, {external+charmcraft:ref}`Charmcraft | Manage secrets <manage-secrets>`
74
85
> Added in `Juju 3.0.2`
96

docs/howto/manage-storage.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
(manage-storage)=
22
# How to manage storage
3-
4-
<!-- UPDATE LINKS:
5-
> See first: [`juju` | Storage](https://juju.is/docs/juju/storage), [`juju` | Manage storage](https://juju.is/docs/juju/manage-storage), [`charmcraft | Manage storage]()
6-
-->
3+
> See first: {external+juju:ref}`Juju | Storage <storage>`, {external+juju:ref}`Juju | Manage storage <manage-storage>`, {external+charmcraft:ref}`Charmcraft | Manage storage <manage-storage>`
74
85
## Implement the feature
96

0 commit comments

Comments
 (0)