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
Copy file name to clipboardExpand all lines: contributor-guides/writing-and-style-guide.md
+34-34
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ All readers can benefit from clear, straightforward writing, but this can be par
14
14
- have cognitive, learning or attention difficulties.
15
15
- come from a non-traditional development background.
16
16
17
-
We aim for **clear** and **helpful** documentation that serves the reader above all else!
17
+
We aim for **clear** and **helpful** documentation that serves the reader above all else!
18
18
19
19
Usually this means choosing:
20
20
@@ -59,7 +59,7 @@ Whenever possible, give the reader a direct instruction:
59
59
60
60
e.g. Type the command...
61
61
62
-
Do not use _"Let's..."_ or _"Next, we will..."_. You are not sitting there with your reader! (This also means you will never need the words _we_, _us_, and _our_. If you see them, rephrase!)
62
+
Do not use *"Let's..."* or *"Next, we will..."*. You are not sitting there with your reader! (This also means you will never need the words *we*, *us*, and *our*. If you see them, rephrase!)
63
63
64
64
If you must address the reader, it is OK to use "you" and "your". Especially for emphasis in very important steps where something could go wrong:
65
65
@@ -85,12 +85,11 @@ Here is an example edit we made to one of our own recipes to illustrate the diff
85
85
> 1.
86
86
> 2. ...
87
87
88
-
89
88
### Opinionated Instructions
90
89
91
-
Sometimes you will need to give an instruction where the reader has options. You want to illustrate the example with the specific choice you made, but you also want to make it clear that other decisions are acceptable.
90
+
Sometimes you will need to give an instruction where the reader has options. You want to illustrate the example with the specific choice you made, but you also want to make it clear that other decisions are acceptable.
92
91
93
-
In this case, try to separate the instruction from the opinion. First, give the action to take with a more general description. Then state the opinionated choice that your example uses. Your reader will be able to first process what you are doing and then will see the choice you have made. They can still follow your instruction, making a choice that works for their own project.
92
+
In this case, try to separate the instruction from the opinion. First, give the action to take with a more general description. Then state the opinionated choice that your example uses. Your reader will be able to first process what you are doing and then will see the choice you have made. They can still follow your instruction, making a choice that works for their own project.
94
93
95
94
This can be easier to follow (and perhaps more reassuring!) than a statement that gives multiple options. This is also usually easier to write since you do not have to remind the reader that this file is from *your* example, and may not appear in their project.
96
95
@@ -105,7 +104,6 @@ This can be easier to follow (and perhaps more reassuring!) than a statement tha
105
104
106
105
<!--
107
106
108
-
109
107
-->
110
108
111
109
## Custom Components
@@ -161,7 +159,7 @@ By default, the badge uses a muted colour scheme to blend in. It also has an acc
161
159
162
160
### Since Component
163
161
164
-
As features are added to Astro, it can be helpful to document _when_ they were added. This allows users to easily see if the version of Astro (or other packages) they are running supports a specific feature as described in the docs.
162
+
As features are added to Astro, it can be helpful to document *when* they were added. This allows users to easily see if the version of Astro (or other packages) they are running supports a specific feature as described in the docs.
165
163
166
164
You can use the `<Since />` component to display this information in a standardized way.
167
165
@@ -277,28 +275,29 @@ Inside `MyCustomTabs.jsx`, import the Tabs component and create one `<Tabs>` com
To create your custom tab component, follow the pattern below using a `<Fragment>` with a named slot for each tab and panel to be created. Note that you must define your tab names here (e.g. Preact, React, Solid, Svelte, Vue), but the content for each panel will be written when your custom component is imported and used in a Markdown page, as in the previous `<PackageManagerTabs>` example.
@@ -318,7 +317,7 @@ import RecipeLinks from "~/components/RecipeLinks.astro";
318
317
319
318
## Lists vs. Headings
320
319
321
-
Both lists and headings are used in our docs for readability. We will often start by using `<ul>` to list related items.
320
+
Both lists and headings are used in our docs for readability. We will often start by using `<ul>` to list related items.
322
321
323
322
But, when individual line items become large, span multiple paragraphs, or contain too many `<code>` terms affecting readability, then we will change to section headings.
324
323
@@ -339,33 +338,36 @@ Do use headings to break up text into organized sections! Many readers prefer to
339
338
## Examples (e.g. examples)
340
339
341
340
Current practice is to use the words "for example" in full within the text of a sentence, but (e.g. Netlify, Vercel) inside a parenthetical so as to not take the reader out of the flow the sentence.
342
-
343
-
> For example, when passing props . . .
344
341
345
-
> If you store your Astro project in an online Git provider (e.g. GitHub, GitLab), you can . . .
342
+
> For example, when passing props . . .
343
+
344
+
> If you store your Astro project in an online Git provider (e.g. GitHub, GitLab), you can . . .
346
345
347
346
## Code Samples
348
347
349
-
We take great pride in our code samples, but they require a little extra work to write!
348
+
We take great pride in our code samples, but they require a little extra work to write!
350
349
351
350
Don't worry! We'll help you out in a PR if your code authoring needs some adjustment before merging. But, you can make use of all our features below and preview them locally to make sure your code looks the way you want.
352
351
353
352
If you are **editing existing code samples**, then please make sure to preview your updated code sample! Update any necessary syntax such as line highlighting or title (file name).
354
353
355
-
If you are **adding new code samples**, you have the option of adding a file name (usually recommended!) to be displayed as a title. You can also highlight individual words, phrases, or entire lines in regular or "diff" (red/green) style.
354
+
If you are **adding new code samples**, you have the option of adding a file name (usually recommended!) to be displayed as a title. You can also highlight individual words, phrases, or entire lines in regular or "diff" (red/green) style.
356
355
357
356
**All extra code styling is written on the opening line of the code block, immediately after the language.**
358
357
359
358
Here are two examples of what our code snippets look like written in Markdown, just so you can see what it looks like in action. Syntax explanations follow.
- apply "+ diff" styling (green backround) to any occurrence of `<Button />`
371
373
- highlight any occurrence of `{props.title}` and `{props.social}`
@@ -379,9 +381,10 @@ Here are two examples of what our code snippets look like written in Markdown, j
379
381
380
382
Most code should include a sample file name so that we give the reader not only copy-pastable code, but also provide the file into which that code should be pasted.
381
383
382
-
`title="src/pages/index.astro"`
384
+
`title="src/pages/index.astro"`
383
385
384
386
Alternatively, write the file name as a code comment in a separate line. Write the file name of `.astro` files immediately after the opening `---`
387
+
385
388
``````markdown
386
389
```astro
387
390
---
@@ -403,7 +406,6 @@ Use Curly braces to highlight (default), or show "diff" style (+/-) "inserted" o
403
406
- del={2} - Shows "diff" style (-) at line 2
404
407
- ins={7-9} - Shows "diff" style (+) lines 7-9
405
408
406
-
407
409
### Text Highlighting
408
410
409
411
Use quotation marks to highlight (default), or assign red/green "diff" style background colors for individual words and phrases.
@@ -419,14 +421,12 @@ Regular expressions are supported within slashes `/ /`. See a handy [tool for co
419
421
- /{frontmatter.(title|description)}/ - Highlight all instances of `{frontmatter.title}` and `{frontmatter.description}`
420
422
421
423
> ***Note***
424
+
>
422
425
> - del="<p class=\"hi\">" - Use `\` to escape quotation marks and other special characters in the search string
423
426
>
424
427
>- del='\<p class="hi">' - Use single quotes to make it easier to match double quotes
425
428
426
-
427
-
428
-
429
-
### Don't destructure props
429
+
### Don't destructure props
430
430
431
431
The following prop syntax is relevant to all component frameworks we support:
0 commit comments