You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Documentation module provides documentation for Altis.
6
6
7
-
This module is used to generate the documentation you're currently reading, and can also be used [for your own custom project documentation](custom-documentation.md).
7
+
This module is used to generate the documentation you're currently reading, and can also be
8
+
used [for your own custom project documentation](custom-documentation.md).
The documentation module can be used for your own [custom modules](docs://getting-started/custom-modules.md), allowing you to build an internal knowledge base for your development team.
3
+
The documentation module can be used for your own [custom modules](docs://getting-started/custom-modules.md), allowing you to build
4
+
an internal knowledge base for your development team.
4
5
5
-
The built-in Documentation Set is intended for developer documentation. To add your documentation to the Developer Docs set, see the information below. To add additional sets of Documentation, perhaps for the users of your system, see [Additional Documentation Sets](./additional-doc-set.md).
6
+
The built-in Documentation Set is intended for developer documentation. To add your documentation to the Developer Docs set, see the
7
+
information below. To add additional sets of Documentation, perhaps for the users of your system,
8
+
see [Additional Documentation Sets](./additional-doc-set.md).
6
9
7
10
## Documentation Structure
8
11
9
-
Each module provides its own documentation. The Documentation module also includes project-level documentation, such as the [Guides](docs://guides/) and [Getting Started](docs://getting-started/) documentation.
10
-
11
-
The Documentation module automatically takes Markdown files from a `docs/` directory within each module's root directory, and parses them into pages. These are hierarchically-structured based on the directory structure, with `README.md` acting as the index file for each directory.
12
+
Each module provides its own documentation. The Documentation module also includes project-level documentation, such as
13
+
the [Guides](docs://guides/) and [Getting Started](docs://getting-started/) documentation.
12
14
15
+
The Documentation module automatically takes Markdown files from a `docs/` directory within each module's root directory, and parses
16
+
them into pages. These are hierarchically-structured based on the directory structure, with `README.md` acting as the index file for
17
+
each directory.
13
18
14
19
## Formatting
15
20
16
-
Documentation files are standard Markdown, as supported by [Parsedown](https://parsedown.org/). They also support [relative and in-project links](linking.md).
21
+
Documentation files are standard Markdown, as supported by [Parsedown](https://parsedown.org/). They also
22
+
support [relative and in-project links](linking.md).
17
23
18
-
Markdown files can contain YAML front-matter, which specifies a list of "meta" information about the page itself. The following fields are supported:
24
+
Markdown files can contain YAML front-matter, which specifies a list of "meta" information about the page itself. The following
25
+
fields are supported:
19
26
20
27
```yaml
21
28
---
@@ -30,18 +37,21 @@ order: 0
30
37
---
31
38
```
32
39
33
-
Headers have automatically generated fragment IDs attached for in-page linking. This automatic ID can be overridden if desired by suffixing with `{#id-name}`:
40
+
Headers have automatically generated fragment IDs attached for in-page linking. This automatic ID can be overridden if desired by
41
+
suffixing with `{#id-name}`:
34
42
35
43
```md
36
44
# Header Name {#override-id}
37
45
```
38
46
39
-
40
47
## Custom Behavior
41
48
42
-
Internally, the Documentation module stores an ordered list of "groups", which have an ID and associated top-level pages. Each page has metadata, content, and potentially sub-pages.
49
+
Internally, the Documentation module stores an ordered list of "groups", which have an ID and associated top-level pages. Each page
50
+
has metadata, content, and potentially sub-pages.
43
51
44
-
The `altis.documentation.groups` filter is provided the ordered list of `Group` objects, and you can add or remove groups from here, or manipulate existing groups. The `Documentation\add_docs_for_group()` function may be useful for this; see `Documentation\filter_add_dev_docs_set()` to see how Altis generates developer documentation for modules.
52
+
The `altis.documentation.groups` filter is provided the ordered list of `Group` objects, and you can add or remove groups from here,
53
+
or manipulate existing groups. The `Documentation\add_docs_for_group()` function may be useful for this;
54
+
see `Documentation\filter_add_dev_docs_set()` to see how Altis generates developer documentation for modules.
45
55
46
56
For example, to add your own Guides-style section:
47
57
@@ -50,10 +60,10 @@ use Altis\Documentation\Group;
50
60
use function Altis\Documentation\add_docs_for_group;
51
61
52
62
add_filter( 'altis.documentation.groups', function ( array $groups, string $set_id ) {
53
-
if ( $set_id === 'dev-docs' ) {
54
-
$groups['project-guides'] = new Group( 'Project Guides' );
Copy file name to clipboardExpand all lines: docs/linking.md
+21-15Lines changed: 21 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,15 @@
1
1
---
2
2
order: 10
3
3
---
4
+
4
5
# Linking
5
6
6
7
The Documentation module supports relative links and cross-linking between pages in documentation.
7
8
8
-
9
9
## Relative Links
10
10
11
-
Within a given module's documentation, you can use relative links between files. These will be resolved during the rendering of the documentation.
11
+
Within a given module's documentation, you can use relative links between files. These will be resolved during the rendering of the
12
+
documentation.
12
13
13
14
For example, to link to a document in the same directory called `doc.md`, you can format your link as:
14
15
@@ -24,17 +25,20 @@ To link to a document in a subdirectory or a parent directory, use similar relat
24
25
[Document in a subdirectory](./subdir/doc.md)
25
26
```
26
27
27
-
Note that relative links can only be used between documents in a single module, and links to other modules should instead use cross-linking.
28
-
28
+
Note that relative links can only be used between documents in a single module, and links to other modules should instead use
29
+
cross-linking.
29
30
30
31
## Cross-Linking
31
32
32
33
Cross-linking refers to links from one module to another. This allows creating richer documentation, tying together various modules.
33
34
34
-
To link from one module to another, use the special URL scheme `docs://`. This should be followed by the name of the documentation group (typically the module ID), followed by a slash, followed by the page ID (typically a file path within the module's documentation directory). You can also link between Sets of documentation, for example from a developer document to a custom project guide, using an optional leading Set ID.
35
+
To link from one module to another, use the special URL scheme `docs://`. This should be followed by the name of the documentation
36
+
group (typically the module ID), followed by a slash, followed by the page ID (typically a file path within the module's
37
+
documentation directory). You can also link between Sets of documentation, for example from a developer document to a custom project
38
+
guide, using an optional leading Set ID.
35
39
The full format is:
36
40
37
-
```
41
+
```md
38
42
docs://[{set}/]{group}/{id}
39
43
```
40
44
@@ -47,30 +51,32 @@ Consult the [branding documentation](docs://cms/branding.md)
47
51
Or to link to a `block-templates.md` document in the 'Layout guide' of your project's custom documentation set.
48
52
49
53
```md
50
-
All available [block templates](docs://project-docs/layout/block-templates.md) are listed in the [Layout guide](docs://project-docs/layout/)
54
+
All available [block templates](docs://project-docs/layout/block-templates.md) are listed in
55
+
the [Layout guide](docs://project-docs/layout/)
51
56
```
52
57
53
-
**Note:** while documentation group IDs generally align with module IDs, some special groups exist for meta documentation. This includes the Getting Started (ID `getting-started`) and Guides (ID `guides`) documentation, which are located in the `other-docs` directory of the Documentation module.
54
-
58
+
**Note:** while documentation group IDs generally align with module IDs, some special groups exist for meta documentation. This
59
+
includes the Getting Started (ID `getting-started`) and Guides (ID `guides`) documentation, which are located in the `other-docs`
60
+
directory of the Documentation module.
55
61
56
62
## Internal Linking
57
63
58
64
To enable rich documentation, you can link to internal resources on the site.
59
65
60
-
These links use the special `internal://` URL scheme. This is followed by the type of internal link, followed by a slash, followed by an optional additional path. The following types are available:
66
+
These links use the special `internal://` URL scheme. This is followed by the type of internal link, followed by a slash, followed
67
+
by an optional additional path. The following types are available:
61
68
62
-
*`internal://home/{path}` - URL on the frontend, equivalent to `home_url( $path )`
63
-
*`internal://site/{path}` - URL on the backend, equivalent to `site_url( $path )`
64
-
*`internal://admin/{path}` - Page in the admin, equivalent to `admin_url( $path )`
65
-
*`internal://network-admin/{path}` - Page in the network admin, equivalent to `network_admin_url( $path )`
69
+
-`internal://home/{path}` - URL on the frontend, equivalent to `home_url( $path )`
70
+
-`internal://site/{path}` - URL on the backend, equivalent to `site_url( $path )`
71
+
-`internal://admin/{path}` - Page in the admin, equivalent to `admin_url( $path )`
72
+
-`internal://network-admin/{path}` - Page in the network admin, equivalent to `network_admin_url( $path )`
66
73
67
74
For example, to link to the current user's profile page:
68
75
69
76
```md
70
77
[View your profile](internal://admin/profile.php)
71
78
```
72
79
73
-
74
80
## Link to support
75
81
76
82
You can easily display a direct link to the Altis support ticket system, pre-filled with the current environment stack name.
0 commit comments