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
Clarify documentation related to article file names, and documentation extension file names. (#874)
* Clarify documentation related to article file names, and documentation
extension file names.
* PR feedback: Rephrase and supplement documentation related to article
file names, and documentation extension file names.
Copy file name to clipboardExpand all lines: Sources/docc/DocCDocumentation.docc/adding-supplemental-content-to-a-documentation-catalog.md
+33-5Lines changed: 33 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,19 @@ habitat.
62
62
...
63
63
```
64
64
65
-
To add an article to your documentation catalog, use a text editor and create a file with an appropriate title and add a `.md` extension.
65
+
To add an article to your documentation catalog, use a text editor and create a
66
+
file with an appropriate title and add an `.md` extension.
67
+
68
+
> Important:
69
+
> DocC uses the article's lowercased file name, with consecutive
70
+
> sequences of whitespace and punctuation replaced with a hyphen (`-`), as a
71
+
> path component in the URL for that page.
72
+
>
73
+
> If two or more articles have the same file name, DocC will raise a warning
74
+
> and skip building documentation for all but one of those articles.
75
+
>
76
+
> DocC doesn't display the article file name in content. Instead, it uses the
77
+
> title from the level 1 header in places where the article is referenced.
66
78
67
79
After the Overview section, additional sections and subsections use a double
68
80
hash (##) for a level 2 header, and a triple hash (###) for a level 3 header.
@@ -89,10 +101,26 @@ Although writing documentation comments in source files has many benefits, in so
89
101
* When your source documentation comments focus on the implementation of your
90
102
code, and aren't appropriate for external documentation
91
103
92
-
To add an extension file to your documentation catalog, create a file within the documentation catalog, then modify the first line of the file to identify the symbol that the file relates to using a symbol link in a level 1 header.
93
-
For more information on linking to symbols, see <doc:linking-to-symbols-and-other-content>.
94
-
95
-
> Important: The symbol path for the page title of an extension file need to start with the name of a top-level symbol or the name of the framework.
104
+
To add an extension file to your documentation catalog, create a file within the
105
+
documentation catalog, then modify the first line of the file to identify the
106
+
symbol that the file relates to using a symbol link in a level 1 header. For
107
+
more information on linking to symbols, see
108
+
<doc:linking-to-symbols-and-other-content>.
109
+
110
+
DocC ignores file names of documentation extensions; you can choose any file
111
+
name you would like as long as it uses an `.md` extension. DocC determines the
112
+
URL path of source documentation from the symbol's name, type and parent type
113
+
among other things.
114
+
115
+
> Important: If DocC can't resolve the symbol link in the level 1 header of the
116
+
> extension file, it will raise a warning about the link and skip the rest of
117
+
> the content of that extension file.
118
+
>
119
+
> DocC resolves symbol links in extension file headers relative to the module.
120
+
> To create an extension file for a nested type or member symbol, start the
121
+
> symbol link with the name of the top-level symbol that contains the nested
122
+
> type or member symbol. You can optionally prefix the symbol link with the
123
+
> name of the module, but DocC does not require this prefix.
96
124
97
125
By default, the extension file's content adds to the symbol's existing source documentation comment.
98
126
You can leave key information in the documentation comment---where it's available to people reading the source code---and use the extension file for longer documentation, code examples, images, and for organizing you documentation hierarchy.
0 commit comments