Skip to content

Commit 70eea7b

Browse files
bsmthRumyra
andauthored
chore(docs): Add some usage docs (#28)
* chore(docs): Add some usage docs * feat: Add image used in some examples * Update README.md Co-authored-by: Ruth John <[email protected]> --------- Co-authored-by: Ruth John <[email protected]>
1 parent 7bde03d commit 70eea7b

File tree

3 files changed

+54
-74
lines changed

3 files changed

+54
-74
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
- [Finding an issue](#finding-an-issue)
77
- [Asking for help](#asking-for-help)
88
- [Pull request process](#pull-request-process)
9-
- [Setting up the development environment](#setting-up-the-development-environment)
109
- [Forking and cloning the project](#forking-and-cloning-the-project)
11-
- [Prerequisites](#prerequisites)
12-
- [Signing commits](#signing-commits)
1310

1411
Welcome 👋 Thank you for your interest in contributing to MDN Web Docs. We are happy to have you join us! 💖
1512

@@ -26,8 +23,6 @@ If anything doesn't make sense or work as expected, please open an issue and let
2623

2724
We welcome many different types of contributions including:
2825

29-
<!-- TODO: These are not set in stone and should be reconsidered per project based on needs. -->
30-
3126
- New features and content suggestions.
3227
- Identifying and filing issues.
3328
- Providing feedback on existing issues.
@@ -50,68 +45,13 @@ Also, mention the community team using the `@mdn/mdn-community-engagement` handl
5045

5146
## Asking for help
5247

53-
The best way to reach us with a question when contributing is to use the following channels in the following order of precedence:
54-
55-
- [Start a discussion](https://github.com/orgs/mdn/discussions)
56-
- Ask your question or highlight your discussion on [Matrix](https://matrix.to/#/#mdn:mozilla.org).
57-
- File an issue and tag the community team using the `@mdn/mdn-community-engagement` handle.
48+
The best way to contact us with a question when contributing is to reach out to us in [one of our communication channels](https://developer.mozilla.org/en-US/docs/MDN/Community/Communication_channels).
5849

5950
## Pull request process
6051

6152
The MDN Web Docs project has a well-defined pull request process which is documented in the [Pull request guidelines](https://developer.mozilla.org/en-US/docs/MDN/Community/Pull_requests).
6253
Make sure you read and understand this process before you start working on a pull request.
6354

64-
## Setting up the development environment
65-
66-
<!-- TODO -->
67-
6855
### Forking and cloning the project
6956

7057
The first step in setting up your development environment is to [fork the repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo) and [clone](https://docs.github.com/en/get-started/quickstart/fork-a-repo#cloning-your-forked-repository) the repository to your local machine.
71-
72-
<!--
73-
74-
TODO
75-
76-
### Prerequisites
77-
78-
A section here that describes the steps needed to prepare a local machine before building.
79-
It should look like this:
80-
81-
To get started, make sure you have the following:
82-
83-
- [NVM](https://github.com/nvm-sh/nvm) or [NVM for Windows](https://github.com/coreybutler/nvm-windows)
84-
- [Nodejs](https://nodejs.org/en/) (Latest stable release or up to two versions back)
85-
86-
### Building the project
87-
88-
Add a section here that describes the steps needed to build this project.
89-
It should follow the same structure as the following example:
90-
91-
Once you have the above installed and have the repository cloned, it is time to install the project dependencies.
92-
93-
```bash
94-
npm i
95-
```
96-
97-
With the dependencies installed you can start the project with the following command:
98-
99-
```bash
100-
npm start
101-
```
102-
103-
Open `http://localhost:3000` in your browser.
104-
105-
To run the test suite, use the following command:
106-
107-
```bash
108-
npm test
109-
```
110-
111-
-->
112-
113-
## Signing commits
114-
115-
We require all commits to be signed to verify the author's identity.
116-
GitHub has a detailed guide on [setting up signed commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits).
117-
If you get stuck, please [ask for help](#asking-for-help).

README.md

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,69 @@
22

33
This repository contains shared media assets for MDN Web Docs, including source files where available.
44

5-
The assets are hosted at https://mdn.github.io/shared-assets/, so use the `mdn.github.io` URLs in MDN content.
5+
The assets are hosted at <https://mdn.github.io/shared-assets/>, so use the `mdn.github.io` URLs in MDN content.
66

7-
<!--
7+
## Getting started
88

9-
TODO:
9+
If you are creating a live sample on MDN that requires assets (images, fonts) to demonstrate a feature, you can use these resources instead of adding new ones to the content repositories.
1010

11-
## Getting Started
11+
### Using shared assets in documentation
1212

13-
To get up and running, follow these steps:
13+
If you are working on MDN documentation, you can refer to images in markdown like so (suitable for diagrams):
1414

15-
Include enough details to get started using the project here and link to other docs with more detail as needed.
16-
This should look like:
15+
```markdown:
16+
![Diagram of a preflight request](https://mdn.github.io/shared-assets/images/diagrams/http/cors/preflight-correct.svg)
17+
```
1718

18-
- quick installation/build instructions
19-
- a few simple examples of use
19+
If you want to use assets in code samples, you can refer to them like this for fonts, for example:
2020

21-
More detailed build instructions (e.g., prerequisites and testing hints) should be in the CONTRIBUTING.md file.
22-
-->
21+
```css
22+
@font-face {
23+
src: url("https://mdn.github.io/shared-assets/fonts/LeagueMono-VF.ttf");
24+
font-family: "LeagueMonoVariable";
25+
/* etc. */
26+
}
27+
```
28+
29+
Images are also similar in CSS:
30+
31+
```css
32+
body {
33+
background: url("https://mdn.github.io/shared-assets/images/examples/leopard.jpg")
34+
#00d no-repeat fixed;
35+
}
36+
```
37+
38+
And in HTML, for example:
39+
40+
```html
41+
<img
42+
alt="colorful balloon against a blue sky"
43+
src="https://mdn.github.io/shared-assets/images/examples/balloon.jpg"
44+
/>
45+
```
46+
47+
### Adding new assets
48+
49+
First, check if the shared assets repository (this repo) already contains a suitable existing resource.
50+
If there is nothing appropriate, you may open a pull request that adds new resources.
51+
Make sure you've checked the following things:
52+
53+
- compress resources such as images to conserve bandwidth on live pages
54+
- the resources are [CC0](https://creativecommons.org/public-domain/cc0/) or are under a permissive license
55+
- there is a need to add the resource instead of using existing ones
56+
57+
Your pull request must include:
58+
59+
- rationale for adding a resource, and
60+
- links to licensing terms of the asset(s).
61+
62+
Once assets are added to the `main` branch, they will be available at `https://mdn.github.io/shared-assets/path/to/new/asset`.
2363

2464
## Contributing
2565

2666
Our project welcomes contributions from any member of our community.
27-
To get started contributing, please see our [Contributor Guide](CONTRIBUTING.md).
67+
If you want to find out more, you can see helpful links in our [Contributor Guide](CONTRIBUTING.md).
2868

2969
By participating in and contributing to our projects and discussions, you acknowledge that you have read and agree to our [Code of Conduct](CODE_OF_CONDUCT.md).
3070

@@ -38,4 +78,4 @@ This project is licensed under the [LICENSE](LICENSE.md).
3878

3979
### Attributions
4080

41-
- The font `fonts/font_with_slant_axis.woff2` was created by https://github.com/arrowtype and is used under the OFL license.
81+
- The font `fonts/font_with_slant_axis.woff2` was created by <https://github.com/arrowtype> and is used under the OFL license.

images/examples/colorful-heart.png

22.8 KB
Loading

0 commit comments

Comments
 (0)