Skip to content

Commit ed44423

Browse files
authored
Various small documentation phrasing updates (#590)
1 parent 99bea04 commit ed44423

File tree

4 files changed

+64
-59
lines changed

4 files changed

+64
-59
lines changed

Sources/docc/DocCDocumentation.docc/adding-structure-to-your-documentation-pages.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Adding Structure to Your Documentation Pages
22

3-
Arrange symbols into groups and collections that make them easy to find.
3+
Make symbols easier to find by arranging them into groups and collections.
44

55
## Overview
66

@@ -24,9 +24,10 @@ For more information, see
2424
### Customize Your Documentation's Landing Page
2525

2626
A landing page provides an overview of your framework, introduces important
27-
terms, and organizes the resources within your documentation catalog to ease
28-
the reader's learning path. It's an opportunity for you to discuss key features
29-
of your framework and offer motivation for when the reader might want to use
27+
terms, and organizes the resources within your documentation catalog — the
28+
files that enrich your source documentation comments. The landing page is an
29+
opportunity for you to ease the reader's learning path, discuss key features of
30+
your technology, and offer motivation for the reader to return to when they need
3031
it.
3132

3233
For projects that don't include a documentation catalog, DocC generates a
@@ -40,7 +41,7 @@ of your framework.
4041
If you need to manually add a landing page to your documentation catalog, use your text editor to create a file to match the name of the framework. For example, for the
4142
`SlothCreator` framework, the filename is `SlothCreator.md`.
4243

43-
The first line of content in a landing page is the name of the framework, which
44+
The first line of content in a landing page is an H1 heading containing the framework's product module name, which
4445
you precede with a single hash (`#`) and encapsulate in a set of double backticks (\`\`).
4546

4647
```markdown
@@ -61,18 +62,18 @@ Catalog sloths you find in nature and create new adorable virtual sloths.
6162

6263
After the summary, add another blank line and then one or more paragraphs that
6364
introduce your framework to form the Overview section of the landing
64-
page. Keep the Overview brief — typically less than a screen's worth of
65+
page. Try to keep the Overview brief — typically less than a screen's worth of
6566
content. Avoid detailing every feature in your framework. Instead,
6667
provide content that helps the reader understand what problems the framework
6768
solves.
6869

69-
Write your Overview using _documentation markup_; a lightweight markup language
70+
Write your Overview using _documentation markup_, a lightweight markup language
7071
that allows you to include images, lists, and links to
7172
symbols and other content. For more information, see
7273
<doc:formatting-your-documentation-content>.
7374

74-
In addition to presenting rich content, a custom landing page provides organization of the top-level symbols and other content in your
75-
documentation hierarchy.
75+
In addition to presenting rich content, a custom landing page organizes the top-level
76+
symbols and other content in your documentation hierarchy.
7677

7778
### Arrange Top-Level Symbols Using Topic Groups
7879

@@ -84,7 +85,7 @@ between those symbols.
8485
To help readers more easily navigate your framework, arrange symbols into
8586
groups with meaningful names. Place important symbols higher on the page, and
8687
nest supporting symbols inside other symbols. Use group names that are unique,
87-
mutually exclusive, and have clear meaning. Experiment with different
88+
mutually exclusive, and clear. Experiment with different
8889
arrangements to find what works best for you.
8990

9091
![A screenshot showing the rendered documentation containing two topic groups: Essentials and Creating Sloths.](4_topics_1)
@@ -125,16 +126,16 @@ symbol's type information and summary. For more information, see
125126
<doc:formatting-your-documentation-content>.
126127

127128
When you rebuild your documentation, the documentation viewer reflects these
128-
organizational changes in the navigation pane and on the framework's
129+
organizational changes in the navigation pane and on the
129130
landing page, as the image above shows.
130131

131132
### Arrange Nested Symbols in Extension Files
132133

133-
Not all public symbols appear at the top-level of a framework. For example,
134+
Not all symbols appear on the top-level landing page. For example,
134135
classes and structures define methods and properties, and in some cases, nested
135136
classes or structures introduce additional levels of hierarchy.
136137

137-
As with the framework's landing page, DocC generates default topic groups for
138+
As with the top-level landing page, DocC generates default topic groups for
138139
nested symbols according to their type. Use extension files to override this
139140
default organization and provide a more appropriate structure for your symbols.
140141

@@ -143,15 +144,14 @@ default organization and provide a more appropriate structure for your symbols.
143144
To add an extension file to your documentation catalog for a specific symbol, use a text editor to create a new file named `Extension.md`.
144145

145146
In the `Extension.md` file, replace the `Symbol` placeholder
146-
with the name of the symbol you're organizing and rename the file accordingly.
147+
with the symbol path of the symbol you're organizing and rename the file accordingly.
147148

148149
```markdown
149150
# ``SlothCreator/Sloth``
150151
```
151152

152-
> Important: You must use the symbol's absolute path for the page title of an
153-
extension file and include the name of the framework or package. DocC doesn't
154-
support relative symbol paths in this context.
153+
> Important: The symbol path for the page title of an extension file need to start
154+
with the name of a top-level symbol or the name of the framework.
155155

156156
The Extension File template includes a `Topics` section with a single named
157157
group, ready for you to fill out. Alternatively, if your documentation catalog
@@ -222,4 +222,4 @@ they can also confuse a reader if you create too many levels of hierarchy.
222222
Avoid using a collection when a topic group at a higher level can achieve the
223223
same result.
224224

225-
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->
225+
<!-- Copyright (c) 2021-2023 Apple Inc and the Swift Project authors. All Rights Reserved. -->

Sources/docc/DocCDocumentation.docc/adding-supplemental-content-to-a-documentation-catalog.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include this conceptual content. Articles are markup files that contain
1515
information that doesn't relate to a specific symbol. Use articles to:
1616

1717
* Provide a landing page that includes an overview of your package or framework
18-
* Craft a learning path for readers to understand how to use your code base, such
18+
* Craft a learning path for readers to understand how to use your project, such
1919
as with a getting started guide or a tutorial
2020

2121
Extension files are markup files that complement source documentation
@@ -32,14 +32,14 @@ files, see
3232
The process of crafting great documentation is an art. Your
3333
content is unique; you know which elements, beyond source
3434
documentation comments, provide the most value to your readers. For
35-
information about adding documentation to your code base and creating a
35+
information about adding documentation to your project and creating a
3636
documentation catalog, see
3737
<doc:documenting-a-swift-framework-or-package>.
3838

3939
### Add Articles to Explain Concepts or Describe Tasks
4040

4141
Adding articles to your documentation catalog helps readers understand how
42-
the types and methods in your code base work as a system. They let you
42+
the types and methods in your project work as a system. They let you
4343
explain how to complete a task, or discuss a broader concept that doesn't fit
4444
into an Overview section for a specific symbol.
4545

@@ -48,7 +48,7 @@ into an Overview section for a specific symbol.
4848
The structure of an article is similar to symbol files or a top-level landing
4949
page, with the exception that the first level 1 header is regular content instead
5050
of a symbol reference. For example, the Getting Started with Sloths article
51-
contains the following title, single-sentence abstract or summary, and overview section:
51+
contains the following title, single-sentence abstract or summary, and Overview section:
5252

5353
```markdown
5454
# Getting Started with Sloths
@@ -64,7 +64,7 @@ habitat.
6464

6565
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.
6666

67-
After the overview section, additional sections and subsections use a double
67+
After the Overview section, additional sections and subsections use a double
6868
hash (##) for a level 2 header, and a triple hash (###) for a level 3 header.
6969
Follow the hashes with a space, and then the title for that section or
7070
subsection.
@@ -77,7 +77,7 @@ When you add an article to a documentation catalog, DocC includes a link to it
7777
on the project's top-level page. To choose a different location for the
7878
article, add a link to it from a group or collection. When DocC renders a link to
7979
an article, it uses the article's title for the text of the link. For more information
80-
about organizing your code base's documentation, see
80+
about organizing your project's documentation, see
8181
<doc:adding-structure-to-your-documentation-pages>.
8282

8383
### Add Extension Files to Append to or Override Source Documentation Comments
@@ -95,9 +95,8 @@ In cases like these, DocC supports supplementing or completely replacing source
9595
documentation comments with content in extension files. To add an extension file to your
9696
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.
9797

98-
> Important: You must use the symbol's absolute path for the page title of an
99-
extension file and include the name of the framework or package. DocC doesn't
100-
support relative symbol paths in this context.
98+
> Important: The symbol path for the page title of an extension file need to start
99+
with the name of a top-level symbol or the name of the framework.
101100

102101
If the symbol already has source documentation comments, add a
103102
`DocumentationExtension` directive to specify whether the content of the
@@ -151,7 +150,7 @@ This overrides the in-source summary.
151150
This content overrides in-source content.
152151
````
153152

154-
For additional details about `Metadata` and other directives, see
153+
For more information on `Metadata` and other directives, see
155154
<doc:Metadata>.
156155

157-
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->
156+
<!-- Copyright (c) 2021-2023 Apple Inc and the Swift Project authors. All Rights Reserved. -->
Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,72 @@
11
# Documenting a Swift Framework or Package
22

3-
Create rich and engaging documentation from your in-source comments, and add a
4-
documentation catalog to your code base to provide additional content.
3+
Create developer documentation from in-source comments, add articles with code snippets,
4+
and add tutorials for a guided learning experience.
55

66
## Overview
77

8-
DocC, or _Documentation Compiler_, makes it easy for you to produce
9-
documentation for your Swift frameworks and packages. The compiler builds your
10-
documentation by combining comments that you write in-source with extension files,
8+
DocC, or _Documentation Compiler_, makes it easy to produce
9+
rich and engaging developer documentation for your Swift frameworks and packages.
10+
The compiler builds documentation by combining in-source comments with extension files,
1111
articles, and other resources,
1212
allowing you to create rich and engaging documentation for developers.
1313

1414
With DocC, you provide a combination of reference and conceptual content, and
1515
connect it together using powerful organization and linking capabilities. Because you write
1616
documentation directly in source, you can use the tools you're already familiar
17-
with, such as Git, to track changes you make.
17+
with, like Git, to track changes.
1818

1919
### Build Simple Documentation from Your Source Comments
2020

2121
For DocC to compile your documentation, the Swift compiler first builds your Swift framework
2222
or package, and stores additional information about its public APIs alongside
23-
the compiled artifacts. It then consumes that information and compiles your
24-
documentation into a DocC Archive. This process repeats for every Swift
25-
framework or package that your target depends on.
23+
the compiled artifacts. DocC consumes that information and compiles the documentation into a DocC Archive. This process repeats for every Swift framework or package your target depends on.
2624

2725
![A diagram showing how the Swift compiler turns code into a Swift framework and supplies information about the framework's public APIs to the documentation compiler, which generates a DocC Archive using that information.](docc-compilation-default)
2826

2927
To build documentation for your Swift framework or package, use the DocC command-line interface in preview mode and specify a location. On macOS, DocC monitors the files in the location and recompiles when you make changes. On other platforms, you need to quit and restart DocC to recompile the documentation.
3028

3129
![A screenshot showing the Sloth structure documentation in its rendered form.](1_sloth)
3230

33-
DocC uses the comments that you write in your source code as the content for the
31+
> Tip: You can also use the Swift-DocC Plugin to
32+
[build a documentation archive for a Swift package][plugin-docs].
33+
[plugin-docs]: https://apple.github.io/swift-docc-plugin/documentation/swiftdoccplugin/generating-documentation-for-hosting-online/
34+
35+
DocC uses the comments you write in your source code as the content for the
3436
documentation pages it generates. At a minimum, add basic documentation
3537
comments to the framework's public symbols so that DocC can use this information as the symbols'
36-
single-sentence abstracts or summaries. You can also add thorough
37-
documentation comments to provide further detail, including information about
38-
parameters, return values, and errors. For more information, see
38+
single-sentence abstracts or summaries.
39+
40+
Alternatively, add thorough documentation comments to provide further detail, including
41+
information about parameters, return values, and errors. For more information, see
3942
<doc:writing-symbol-documentation-in-your-source-files>.
4043

41-
### Create Documentation for a Swift Package
44+
### Configure a Richer Documentation Experience
4245

43-
By default, DocC compiles only your in-source symbol documentation and then
46+
By default, DocC compiles only in-source symbol documentation and then
4447
groups those symbols together by their kind, such as protocols, classes,
4548
enumerations, and so forth. When you want to provide additional content or
46-
customize the organization of your framework's symbols, use a documentation
49+
customize the organization of symbols, use a documentation
4750
catalog.
4851

4952
DocC combines the public API information from the Swift compiler with the
50-
contents of the documentation catalog to generate a richer DocC Archive.
53+
contents of the documentation catalog to generate a much richer DocC Archive.
5154

5255
![A diagram showing how the Swift compiler turns code into a Swift framework and supplies information about the framework's public APIs to the documentation compiler, which combines that with a documentation catalog to generate a rich DocC Archive.](docc-compilation-catalog)
5356

54-
Use a documentation catalog when you want to include:
57+
Use a documentation catalog when you want to include any of the following:
5558

56-
* A landing page that introduces your framework and arranges its top-level
57-
symbols, as well as extension files that provide custom organization for your
59+
* A landing page that introduces a framework and arranges its top-level
60+
symbols, as well as extension files that provide custom organization for the
5861
symbols' properties and methods. For more information, see
5962
<doc:adding-structure-to-your-documentation-pages>.
60-
* Extension files that supplement your in-source comments, and articles that
63+
* Extension files that supplement in-source comments, and articles that
6164
provide supporting conceptual content. For more information, see
6265
<doc:adding-supplemental-content-to-a-documentation-catalog>.
63-
* Tutorials that allow you to teach developers your framework's APIs through
66+
* Tutorials that teach developers APIs through
6467
step-by-step, interactive content. For more information, see
6568
<doc:building-an-interactive-tutorial>.
66-
* Resource files to use in your documentation, such as images and videos.
69+
* Resource files to use in your documentation, like images and videos.
6770

6871
> Important: To use a documentation catalog in a Swift package, make sure the
6972
manifest's Swift tools version is set to `5.5` or later.
@@ -80,4 +83,4 @@ and publishing your documentation to your [website](https://apple.github.io/swif
8083

8184
- <doc:writing-symbol-documentation-in-your-source-files>
8285

83-
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->
86+
<!-- Copyright (c) 2021-2023 Apple Inc and the Swift Project authors. All Rights Reserved. -->

Sources/docc/DocCDocumentation.docc/writing-symbol-documentation-in-your-source-files.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ mutating public func eat(_ food: Food, quantity: Int) throws -> Int {
2323
}
2424
```
2525

26-
To help people who use your API better understand it, follow the steps in the sections below to
27-
add documentation comments to the public symbols in your code base. DocC compiles
26+
To help the people who use your API have a better understanding of it, follow the steps in the sections below to
27+
add documentation comments to the public symbols in your project. DocC compiles
2828
those comments and generates formatted documentation that you share with your users.
2929

3030
### Add a Basic Description for Each Symbol
@@ -78,6 +78,9 @@ Insert blank lines to break text into separate paragraphs.
7878
mutating public func eat(_ food: Food, quantity: Int) throws -> Int {
7979
```
8080

81+
Any paragraphs you add appear below the Discussion header in the symbol
82+
reference page that DocC generates.
83+
8184
When writing content for a Discussion section, use documentation markup. For
8285
more information, see <doc:formatting-your-documentation-content>.
8386

@@ -88,7 +91,7 @@ summary, or the Discussion section, if you include one. Describe each parameter
8891
in isolation. Discuss its purpose and, where necessary, the range of acceptable
8992
values.
9093

91-
DocC supports two approaches to document the parameters of a
94+
DocC supports two approaches for documenting the parameters of a
9295
method. You can add a Parameters section, or one or more parameter fields.
9396
Both use Markdown's list syntax.
9497

@@ -114,7 +117,7 @@ the name of the parameter.
114117
mutating public func eat(_ food: Food, quantity: Int) throws -> Int {
115118
```
116119

117-
After you add documentation for a method’s parameters, preview it in a web browser to see the rendered content.
120+
After you add documentation for a methods parameters, preview it in a web browser to see the rendered content.
118121

119122
![A screenshot showing the rendered documentation for the eat(_:quantity:) method.](3_eat)
120123

@@ -189,12 +192,12 @@ In addition, DocC includes features that allow you to create even richer
189192
documentation for your symbols:
190193

191194
* Use symbol links instead of code voice when referring to other symbols in
192-
your framework. Symbol links allow you to quickly navigate your framework's
195+
your project. Symbol links allow you to quickly navigate your project's
193196
documentation when viewing in a browser. For more information, see
194197
<doc:formatting-your-documentation-content>.
195198
* Use extension files to provide additional content for your symbols, such as
196199
code examples and images, and to help keep the size of their in-source comments
197200
manageable. For more information, see
198201
<doc:adding-supplemental-content-to-a-documentation-catalog>.
199202

200-
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->
203+
<!-- Copyright (c) 2021-2023 Apple Inc and the Swift Project authors. All Rights Reserved. -->

0 commit comments

Comments
 (0)