Skip to content

Commit f6c0b8d

Browse files
committed
url_conventions: readability
1 parent a7a70b4 commit f6c0b8d

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

docs/url_conventions.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ For example, the correct URL for the reference page about the `circle` function
88
* good: https://beta.p5js.org/reference/p5/circle/
99
* bad: https://beta.p5js.org/reference/p5/circle
1010

11-
More correctly, it should come at the end of the path part. It should come _before_ any query string (starts with a question mark `?`), and before any hash / fragment part (starts with a hash character `#`), if either of those is present.
11+
More correctly, it should come at the end of the _path_ part of the URL.
1212

13-
Example before a query string
13+
If a query string or hash/fragment is present in the URL, the trailing slash should come before those, as shown in these examples:
14+
15+
Example with a query string
1416
* good: https://beta.p5js.org/search/?term=colorMode
15-
* bad: https://beta.p5js.org/search?term=colorMode
1617
* bad: https://beta.p5js.org/search?term=colorMode/
18+
* bad: https://beta.p5js.org/search?term=colorMode
1719

18-
Example before a hash / fragment part
20+
Example with a hash / fragment part
1921
* good: https://beta.p5js.org/contribute/documentation_style_guide/#comments
2022
* bad: https://beta.p5js.org/contribute/documentation_style_guide#comments/
2123

@@ -28,8 +30,9 @@ Example before a hash / fragment part
2830
* https://beta.p5js.org/examples/shapes-and-color-shape-primitives/
2931
* https://beta.p5js.org/
3032

31-
The production webserver _may_ add a trailing slash to a requested URL when it is missing, but this should not be relied upon.
32-
33+
### Automatic trailing slash addition
34+
While the production webserver _may_ add a trailing slash to a requested URL when it is missing, but this should not be relied upon.
35+
Instead write (or generate) links that follow the rules above.
3336

3437
## Case in URLs
3538

@@ -38,9 +41,8 @@ URL casing is somewhat inconsistent across the website. Guidelines for new reso
3841
* Prefer lower-case
3942
* Spaces should not be used in URLs.
4043
* In place of spaces, dashes (`-`) should ideally be used in preference to underscores (`_`).
41-
* Follow the local conventions used by other resources of the same type
42-
* e.g. contributor docs use underscores "like_this"
43-
* e.g. most other resources (tutorials, examples, code-of-conduct) use kebab-case "like-this"
44+
* First, however, follow established local conventions used by other resources of the same type
45+
* e.g. all contributor docs use underscores "like_this"
4446

4547
#### Examples of kebab-case URL:
4648
* https://beta.p5js.org/tutorials/variables-and-change/
@@ -49,7 +51,7 @@ URL casing is somewhat inconsistent across the website. Guidelines for new reso
4951

5052
### A case exception: reference pages
5153

52-
In reference pages, the URLs follow the names of the functions, classes, and variables. So they include some capitals and use camel-case (`createCanvas`, not `create-canvas`).
54+
In reference pages, the URLs follow the names of the functions, classes, and variables. So, they include some capitals and use "camel-case" e.g. `createCanvas`.
5355

5456
#### Examples of reference page URLs
5557
* https://p5js.org/reference/p5.Vector/fromAngle/

0 commit comments

Comments
 (0)