Skip to content

Commit f02fb0b

Browse files
authored
chore: Format MD files with Markdownlint (mdn#486)
1 parent ac08680 commit f02fb0b

File tree

3 files changed

+39
-30
lines changed

3 files changed

+39
-30
lines changed

LICENSE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Creative Commons may be contacted at http://creativecommons.org/.
7474
Code examples and snippets added on or after August 20, 2010 are in the public domain
7575
([CC0](https://creativecommons.org/publicdomain/zero/1.0/legalcode)). No licensing notice
7676
is necessary, but if you need one, you can use:
77+
7778
```
7879
Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/
7980
```
@@ -209,6 +210,7 @@ express Statement of Purpose.
209210
Code examples and snippets added before August 20, 2010 are available under
210211
the [MIT license](https://opensource.org/licenses/MIT). You should insert
211212
the following attribution information into the MIT license template:
213+
212214
```
213215
© <date of last page revision> <name of person who created it>
214216
```

README.md

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,29 @@ If you're not familiar with [`git`](https://git-scm.com) and
3535
helpful.
3636

3737
There are several ways forward from this point. It's up to you. Here are some options:
38-
1. Go to https://github.com/mdn/content and just use the [GitHub UI](https://docs.github.com/en/free-pro-team@latest/github/managing-files-in-a-repository/managing-files-on-github). This is the easiest approach if you just want to make a simple change to a single file, like fixing a typo.
38+
39+
1. Go to <https://github.com/mdn/content> and just use the [GitHub UI](https://docs.github.com/en/free-pro-team@latest/github/managing-files-in-a-repository/managing-files-on-github). This is the easiest approach if you just want to make a simple change to a single file, like fixing a typo.
3940
1. Install and use the [GitHub Desktop](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/github-desktop)
4041
1. Install and use the [GitHub CLI](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/github-cli)
4142
1. [Install `git`](https://git-scm.com/downloads) and use it from the command line. You might find these resources helpful:
42-
- [Using Git](https://docs.github.com/en/free-pro-team@latest/github/using-git)
43-
- [`git` cheatsheet](https://training.github.com/)
43+
* [Using Git](https://docs.github.com/en/free-pro-team@latest/github/using-git)
44+
* [`git` cheatsheet](https://training.github.com/)
4445

4546
If you choose an option other than the GitHub UI, you want to install
4647
[Node.js (version >=12.11)](https://nodejs.org) and [`yarn`](https://classic.yarnpkg.com/en/docs/install).
4748

4849
### Fundamental content concepts
4950

5051
These are some important things to keep in mind about the MDN content.
51-
- **Documents are folders** -- Documents are always
52+
53+
* **Documents are folders** -- Documents are always
5254
represented by a folder (e.g., [`files/en-us/web/javascript`](files/en-us/web/javascript)), and that folder will contain the content of that specific document as an
5355
`index.html` file (e.g., [`files/en-us/web/javascript/index.html`](files/en-us/web/javascript/index.html)).
54-
- **Documents are hierarchical** - A document folder may contain other folders, where those folders would represent child documents (e.g., [`files/en-us/web/javascript/closures/index.html`](files/en-us/web/javascript/closures/index.html)).
55-
- **Document folders may contain image files** -- A document folder may also contain image files, which are referenced within that document's `index.html` file.
56-
- **All redirects are specified in a single file** -- All of the redirects are specified within [`files/en-us/_redirects.txt`](files/en-us/_redirects.txt), one redirect per line. Each line specifies a `from` and `to` URI separated by whitespace. When you move a document, you'll need to add a redirect to this file specifying that its old URI now redirects to its new URI. If both an `index.html` file and a redirect exist for a document, the document takes precedence and the redirect is ignored.
57-
- **A document's `index.html` starts with "front-matter"** -- Each document's `index.html` file must begin with some YAML called front-matter that defines some important information about the document: `title`, `slug`, and [`tags`](https://developer.mozilla.org/en-US/docs/MDN/Contribute/Howto/Tag) (if any). Here's an example that shows the front-matter from the [JavaScript landing page](files/en-us/web/javascript/index.html):
56+
* **Documents are hierarchical** - A document folder may contain other folders, where those folders would represent child documents (e.g., [`files/en-us/web/javascript/closures/index.html`](files/en-us/web/javascript/closures/index.html)).
57+
* **Document folders may contain image files** -- A document folder may also contain image files, which are referenced within that document's `index.html` file.
58+
* **All redirects are specified in a single file** -- All of the redirects are specified within [`files/en-us/_redirects.txt`](files/en-us/_redirects.txt), one redirect per line. Each line specifies a `from` and `to` URI separated by whitespace. When you move a document, you'll need to add a redirect to this file specifying that its old URI now redirects to its new URI. If both an `index.html` file and a redirect exist for a document, the document takes precedence and the redirect is ignored.
59+
* **A document's `index.html` starts with "front-matter"** -- Each document's `index.html` file must begin with some YAML called front-matter that defines some important information about the document: `title`, `slug`, and [`tags`](https://developer.mozilla.org/en-US/docs/MDN/Contribute/Howto/Tag) (if any). Here's an example that shows the front-matter from the [JavaScript landing page](files/en-us/web/javascript/index.html):
60+
5861
```yaml
5962
---
6063
title: JavaScript
@@ -73,7 +76,7 @@ represented by a folder (e.g., [`files/en-us/web/javascript`](files/en-us/web/ja
7376
If you just want to make a simple change to a single file, like fixing a typo, the
7477
GitHub UI is the simplest way to do that. For example, if you've found
7578
a typo within the [JavaScript landing page](files/en-us/web/javascript/index.html),
76-
you can sign into GitHub, go to https://github.com/mdn/content, navigate to
79+
you can sign into GitHub, go to <https://github.com/mdn/content>, navigate to
7780
`files/en-us/web/javascript/index.html`, and then click on the edit (pencil) button. From there the GitHub UI will take your hand and
7881
[walk you through the rest](https://docs.github.com/en/free-pro-team@latest/github/managing-files-in-a-repository/editing-files-in-your-repository),
7982
like automatically creating a
@@ -149,7 +152,7 @@ and use it to make a pull request.
149152

150153
1. Next, you'll want to start the local preview service, so you can see the changes
151154
you'll make as they would look in production. Once started, this local preview
152-
service is available at http://localhost:5000 within your browser.
155+
service is available at `http://localhost:5000` within your browser.
153156

154157
```sh
155158
# Switch to a separate terminal.
@@ -193,20 +196,20 @@ service is available at http://localhost:5000 within your browser.
193196
1. Make your desired changes to one or more `index.html` files using
194197
your preferred code editor. **When thinking about your desired changes, it's
195198
important to keep the following in mind:**
196-
- **Make sure you've read the
199+
* **Make sure you've read the
197200
[MDN guidelines](https://developer.mozilla.org/en-US/docs/MDN/Guidelines),
198201
including the
199202
[Writing style guide](https://developer.mozilla.org/en-US/docs/MDN/Guidelines/Writing_style_guide).**
200-
- **Large chunks of work can be difficult to review, so try to group your
203+
* **Large chunks of work can be difficult to review, so try to group your
201204
changes into the smallest logical chunks that make sense, and create a
202205
separate pull request for each logical chunk.**
203206

204207
1. Once you've made and saved your changes, open a browser, and navigate to the page(s)
205208
you've changed. For example, if you changed `files/en-us/web/javascript/index.html`,
206-
open http://localhost:5000/en-us/docs/web/javascript in your browser.
209+
open `http://localhost:5000/en-us/docs/web/javascript` in your browser.
207210

208211
1. You might have noticed that at the top of each page that you preview, for example
209-
the http://localhost:5000/en-us/docs/web/javascript page, there is a `Show flaws` button.
212+
the `http://localhost:5000/en-us/docs/web/javascript` page, there is a `Show flaws` button.
210213
Click on that button to see if your changes have introduced flaws on the page.
211214

212215
1. Once you're happy with your changes, add and commit them to your branch, and then
@@ -270,18 +273,21 @@ a separate pull request for each logical set of changes that belong together.
270273

271274
Adding a new document is relatively straightforward, especially if you can start by copying
272275
the `index.html` of a similar document. There are only a few things to keep in mind:
273-
- Remember that a document is represented by an `index.html` file within its own folder.
274-
- Determine where in the document hierarchy your document belongs. For example, if you're
276+
277+
* Remember that a document is represented by an `index.html` file within its own folder.
278+
* Determine where in the document hierarchy your document belongs. For example, if you're
275279
creating a new CSS document for a new property `foo`, you'll want to create a new folder
276280
`files/en-us/web/css/foo/` and its `files/en-us/web/css/foo/index.html` file.
277-
- Remember that a document's `index.html` file must start with front-matter that defines
281+
* Remember that a document's `index.html` file must start with front-matter that defines
278282
the `title`, `slug`, and
279283
[`tags`](https://developer.mozilla.org/en-US/docs/MDN/Contribute/Howto/Tag)
280284
(if any) for the document. You might find it helpful to refer
281285
to the front-matter within a similar document's `index.html`.
282286

283287
As we outlined above, the step-by-step process in general would be:
288+
284289
1. Start a fresh, up-to-date branch to work within:
290+
285291
```sh
286292
cd ~/repos/mdn/content
287293
git checkout main
@@ -295,6 +301,7 @@ As we outlined above, the step-by-step process in general would be:
295301
1. Create one or more new document folders, each with their own `index.html` file.
296302

297303
1. Add and commit your new files, as well as push your new branch to your fork:
304+
298305
```sh
299306
git add files/en-us/folder/you/created
300307
git commit
@@ -454,31 +461,31 @@ push your branch to your fork:
454461
The browser compatibility table shown near the bottom of many of the MDN document pages,
455462
for example on
456463
[the JavaScript Array page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Browser_compatibility),
457-
is generated from the `npm` package created from the https://github.com/mdn/browser-compat-data
464+
is generated from the `npm` package created from the <https://github.com/mdn/browser-compat-data>
458465
repository. If you'd like to make or suggest a change to the content of the browser-compatibility
459466
table on any given MDN document page, you can either use the `Report problems with this data on GitHub` link in the upper-right corner of the table on the page itself to create an issue,
460-
or go to https://github.com/mdn/browser-compat-data and
467+
or go to <https://github.com/mdn/browser-compat-data> and
461468
[read more to learn how to contribute](https://github.com/mdn/browser-compat-data/blob/master/docs/contributing.md).
462469

463470
### Adding code examples
464471

465472
There are a lot of code examples on MDN, and you'll probably want to add some as you contribute content to the project. There are four types of code example used on MDN:
466473

467-
- [Static examples](https://developer.mozilla.org/en-US/docs/MDN/Structures/Code_examples#Static_examples) — plain code blocks, possibly with a screenshot to statically show the
474+
* [Static examples](https://developer.mozilla.org/en-US/docs/MDN/Structures/Code_examples#Static_examples) — plain code blocks, possibly with a screenshot to statically show the
468475
result of such code if it were to be run.
469-
- [Traditional MDN "live samples"](https://developer.mozilla.org/en-US/docs/MDN/Structures/Code_examples#Traditional_live_samples) — A macro that takes plain code blocks, dynamically puts
476+
* [Traditional MDN "live samples"](https://developer.mozilla.org/en-US/docs/MDN/Structures/Code_examples#Traditional_live_samples) — A macro that takes plain code blocks, dynamically puts
470477
them into a document inside an `<iframe>` element, and embeds it into the page to show the
471478
code running live.
472-
- [GitHub "live samples"](https://developer.mozilla.org/en-US/docs/MDN/Structures/Code_examples#GitHub_live_samples) — A macro that takes a document in a GitHub repo inside the [`mdn
473-
organization`](https://github.com/mdn), puts it inside an `<iframe>` element, and embeds
479+
* [GitHub "live samples"](https://developer.mozilla.org/en-US/docs/MDN/Structures/Code_examples#GitHub_live_samples) — A macro that takes a document in a GitHub repo inside the [mdn
480+
organization](https://github.com/mdn), puts it inside an `<iframe>` element, and embeds
474481
it into the page to show the code running live.
475-
- [Interactive examples](https://developer.mozilla.org/en-US/docs/MDN/Structures/Code_examples#Interactive_examples) — Our system for creating live interactive examples that show the
482+
* [Interactive examples](https://developer.mozilla.org/en-US/docs/MDN/Structures/Code_examples#Interactive_examples) — Our system for creating live interactive examples that show the
476483
code running live but also allow you to change code on the fly to see what the effect is.
477484

478485
For a complete description of this topic, see
479486
[the MDN code examples page](https://developer.mozilla.org/en-US/docs/MDN/Structures/Code_examples).
480487

481-
Also make sure that your code examples follow the [MDN code example guidelines](https://developer.mozilla.org/en-US/docs/MDN/Guidelines/Code_guidelines).
488+
Also make sure that your code examples follow the [MDN code example guidelines](https://developer.mozilla.org/en-US/docs/MDN/Guidelines/Code_guidelines).
482489

483490
### Archiving and unarchiving pages
484491

@@ -488,8 +495,8 @@ If you find a page that is marked archived and you think it shouldn't be, you ca
488495

489496
* Submit an issue to check why the page is archived and if it should be unarchived.
490497
* Find the source code location of the archived page. Archived pages live in the [Archived content](https://github.com/mdn/archived-content/) repo, the structure of which is the same as this repo (except that there are also locale directories present other than `en-US`). As an example:
491-
* Take the archived [Mobile developer challenge](https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Mobile_developer_challenge) page, which is at the URL `https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Mobile_developer_challenge`.
492-
* This page's source code is at [https://github.com/mdn/archived-content/blob/main/files/en-us/mozilla/mobile/mobile_developer_challenge/index.html](https://github.com/mdn/archived-content/blob/main/files/en-us/mozilla/mobile/mobile_developer_challenge/index.html).
498+
* Take the archived [Mobile developer challenge](https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Mobile_developer_challenge) page, which is at the URL `https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Mobile_developer_challenge`.
499+
* This page's source code is at [https://github.com/mdn/archived-content/blob/main/files/en-us/mozilla/mobile/mobile_developer_challenge/index.html](https://github.com/mdn/archived-content/blob/main/files/en-us/mozilla/mobile/mobile_developer_challenge/index.html).
493500
* To unarchive the page, you need to open a pull request to move the page's directory into the appropriate place inside this repo, and update the page's meta data (like `slug`) if needed.
494501

495502
Note: To archive a currently-non-archived page, you need to follow the above procedure, but move the page in question the opposite way between repos.
@@ -504,5 +511,5 @@ Sometimes you'll want to make a change to the content that relies on a macro cha
504511

505512
In such situations:
506513

507-
1. Make the required PR to `https://github.com/mdn/yari/blob/master/kumascript/macros/` first, and get that merged.
514+
1. Make the required PR to <https://github.com/mdn/yari/blob/master/kumascript/macros/> first, and get that merged.
508515
2. Add the content to this repo.

0 commit comments

Comments
 (0)