Skip to content

Commit 1de5afa

Browse files
authored
Merge pull request #129 from rkratky/lp-links
Add extlinks for Launchpad + contrib update
2 parents 19fafb7 + 8f0d913 commit 1de5afa

File tree

2 files changed

+126
-0
lines changed

2 files changed

+126
-0
lines changed

docs/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@
347347
:class: vale-ignore
348348
"""
349349

350+
351+
# Allow for use of link substitutions
352+
extlinks = {
353+
"lpsrc": ("https://launchpad.net/ubuntu/+source/%s", "%s"),
354+
"lpbug": ("https://bugs.launchpad.net/bugs/%s", "LP: #%s"),
355+
}
356+
357+
350358
# Workaround for https://github.com/canonical/canonical-sphinx/issues/34
351359

352360
if "discourse_prefix" not in html_context and "discourse" in html_context:

docs/contributors/contribute-docs.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,124 @@ The following roles are especially useful:
197197
: Linux package name (this role is custom to this documentation project).
198198

199199

200+
### Special roles for links
201+
202+
The documentation project defines the following custom roles to simplify adding links to various resources.
203+
204+
`manpage`
205+
: Use to create links to manual pages hosted at [manpages.ubuntu.com](https://manpages.ubuntu.com/). The links always point to manual pages for the latest Ubuntu release.
206+
207+
::::{tab-set}
208+
209+
:::{tab-item} MyST
210+
Syntax:
211+
212+
```md
213+
{manpage}`<manual-page-name>(<manual-section-number>)`
214+
```
215+
216+
Example:
217+
218+
```md
219+
{manpage}`bash(1)`
220+
```
221+
:::
222+
223+
:::{tab-item} reStructuredText
224+
Syntax:
225+
226+
```md
227+
:manpage:`<manual-page-name>(<manual-section-number>)`
228+
```
229+
230+
Example:
231+
232+
```md
233+
:manpage:`bash(1)`
234+
```
235+
:::
236+
237+
::::
238+
239+
Renders as: {manpage}`bash(1)`
240+
241+
`lpbug`
242+
: Use to create links to Launchpad bugs at [bugs.launchpad.net](https://bugs.launchpad.net/).
243+
244+
245+
::::{tab-set}
246+
247+
:::{tab-item} MyST
248+
Syntax:
249+
250+
```md
251+
{lpbug}`<LP-bug-number>`
252+
```
253+
254+
Example:
255+
256+
```md
257+
{lpbug}`1`
258+
```
259+
:::
260+
261+
:::{tab-item} reStructuredText
262+
Syntax:
263+
264+
```md
265+
:lpbug:`<LP-bug-number>`
266+
```
267+
268+
Example:
269+
270+
```md
271+
:lpbug:`1`
272+
```
273+
:::
274+
275+
::::
276+
277+
Renders as: {lpbug}`1`
278+
279+
`lpsrc`
280+
: Use to create links to Ubuntu packages on Launchpad at [launchpad.net/ubuntu](https://launchpad.net/ubuntu).
281+
282+
283+
::::{tab-set}
284+
285+
:::{tab-item} MyST
286+
Syntax:
287+
288+
```md
289+
{lpsrc}`<Ubuntu-package-on-LP>`
290+
```
291+
292+
Example:
293+
294+
```md
295+
{lpsrc}`bash`
296+
```
297+
:::
298+
299+
:::{tab-item} reStructuredText
300+
Syntax:
301+
302+
```md
303+
:lpsrc:`<Ubuntu-package-on-LP>`
304+
```
305+
306+
Example:
307+
308+
```md
309+
:lpsrc:`bash`
310+
```
311+
:::
312+
313+
::::
314+
315+
Renders as: {lpsrc}`bash`
316+
317+
200318
### Command line and terminal output
201319

202320
Ubuntu Project documentation defaults to presenting command examples and terminal output in the following manner.

0 commit comments

Comments
 (0)