Skip to content

Commit 906b93a

Browse files
authored
Merge pull request #1 from mozilla/jh/setup
Set up basic Docusaurus files, add Actions workflow for deploying, Dependabot config
2 parents e00e10a + daf386b commit 906b93a

File tree

19 files changed

+10968
-0
lines changed

19 files changed

+10968
-0
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
labels:
8+
- "dependencies"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: documentation
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
checks:
11+
if: github.event_name != 'push'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v1
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: "12.x"
18+
- name: Test Build
19+
run: |
20+
yarn install --frozen-lockfile
21+
npm run build
22+
gh-release:
23+
if: github.event_name != 'pull_request'
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v1
27+
- uses: actions/setup-node@v1
28+
with:
29+
node-version: "12.x"
30+
- name: Add key to allow access to repository
31+
env:
32+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
33+
run: |
34+
mkdir -p ~/.ssh
35+
ssh-keyscan github.com >> ~/.ssh/known_hosts
36+
echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
37+
chmod 600 ~/.ssh/id_rsa
38+
cat <<EOT >> ~/.ssh/config
39+
Host github.com
40+
HostName github.com
41+
IdentityFile ~/.ssh/id_rsa
42+
EOT
43+
- name: Release to GitHub Pages
44+
env:
45+
USE_SSH: true
46+
GIT_USER: git
47+
run: |
48+
git config --global user.email "[email protected]"
49+
git config --global user.name "gh-actions"
50+
yarn install --frozen-lockfile
51+
npx docusaurus deploy

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
## Experimenter Docs
22

33
This repo is the documentation hub for [Experimenter](https://github.com/mozilla/experimenter).
4+
5+
## Working on the docs
6+
7+
Pages are written in Markdown, and can be found under [`/docs`](/docs).
8+
9+
### Using GitHub
10+
11+
You do not necessarily need to clone or set up this repo locally if you just want to contribute to or change documentation.
12+
13+
If you wish to modify an existing page, navigate to its Markdown file and click the "Edit" pencil icon in the top-right of the content. You will be presented with a Markdown editor. Make and commit your changes.
14+
15+
If you wish to add a new page, navigate to the directory where you wish to generate the new page and click the "Add File" button in the top right of the GitHub UI. From there you can create the page, add content, and commit it.
16+
17+
### Working locally
18+
19+
The site is built using [Docusaurus v2](https://v2.docusaurus.io/) and is automatically deployed from the `main` branch to GitHub Pages using GitHub Actions. To build and run it locally you can:
20+
21+
```
22+
yarn install
23+
yarn start
24+
```
25+
26+
That should open a new browser window automatically, or you can manually browse to http://localhost:3000/ecosystem-platform/ to view the docs.

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

docs/doc1.md

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
---
2+
id: doc1
3+
title: Style Guide
4+
sidebar_label: Style Guide
5+
slug: /
6+
---
7+
8+
You can write content using [GitHub-flavored Markdown syntax](https://github.github.com/gfm/).
9+
10+
## Markdown Syntax
11+
12+
To serve as an example page when styling markdown based Docusaurus sites.
13+
14+
## Headers
15+
16+
# H1 - Create the best documentation
17+
18+
## H2 - Create the best documentation
19+
20+
### H3 - Create the best documentation
21+
22+
#### H4 - Create the best documentation
23+
24+
##### H5 - Create the best documentation
25+
26+
###### H6 - Create the best documentation
27+
28+
---
29+
30+
## Emphasis
31+
32+
Emphasis, aka italics, with *asterisks* or _underscores_.
33+
34+
Strong emphasis, aka bold, with **asterisks** or __underscores__.
35+
36+
Combined emphasis with **asterisks and _underscores_**.
37+
38+
Strikethrough uses two tildes. ~~Scratch this.~~
39+
40+
---
41+
42+
## Lists
43+
44+
1. First ordered list item
45+
1. Another item
46+
- Unordered sub-list.
47+
1. Actual numbers don't matter, just that it's a number
48+
1. Ordered sub-list
49+
1. And another item.
50+
51+
* Unordered list can use asterisks
52+
53+
- Or minuses
54+
55+
+ Or pluses
56+
57+
---
58+
59+
## Links
60+
61+
[I'm an inline-style link](https://www.google.com/)
62+
63+
[I'm an inline-style link with title](https://www.google.com/ "Google's Homepage")
64+
65+
[I'm a reference-style link][arbitrary case-insensitive reference text]
66+
67+
[You can use numbers for reference-style link definitions][1]
68+
69+
Or leave it empty and use the [link text itself].
70+
71+
URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com/ or <http://www.example.com/> and sometimes example.com (but not on GitHub, for example).
72+
73+
Some text to show that the reference links can follow later.
74+
75+
[arbitrary case-insensitive reference text]: https://www.mozilla.org/
76+
[1]: http://slashdot.org/
77+
[link text itself]: http://www.reddit.com/
78+
79+
---
80+
81+
## Images
82+
83+
Here's our logo (hover to see the title text):
84+
85+
Inline-style: ![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
86+
87+
Reference-style: ![alt text][logo]
88+
89+
[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 2'
90+
91+
Images from any folder can be used by providing path to file. Path should be relative to markdown file.
92+
93+
![img](../static/img/logo.svg)
94+
95+
---
96+
97+
## Code
98+
99+
```javascript
100+
var s = 'JavaScript syntax highlighting';
101+
alert(s);
102+
```
103+
104+
```python
105+
s = "Python syntax highlighting"
106+
print(s)
107+
```
108+
109+
```
110+
No language indicated, so no syntax highlighting.
111+
But let's throw in a <b>tag</b>.
112+
```
113+
114+
```js {2}
115+
function highlightMe() {
116+
console.log('This line can be highlighted!');
117+
}
118+
```
119+
120+
---
121+
122+
## Tables
123+
124+
Colons can be used to align columns.
125+
126+
| Tables | Are | Cool |
127+
| ------------- | :-----------: | -----: |
128+
| col 3 is | right-aligned | \$1600 |
129+
| col 2 is | centered | \$12 |
130+
| zebra stripes | are neat | \$1 |
131+
132+
There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.
133+
134+
| Markdown | Less | Pretty |
135+
| -------- | --------- | ---------- |
136+
| _Still_ | `renders` | **nicely** |
137+
| 1 | 2 | 3 |
138+
139+
---
140+
141+
## Blockquotes
142+
143+
> Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.
144+
145+
Quote break.
146+
147+
> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can _put_ **Markdown** into a blockquote.
148+
149+
---
150+
151+
## Inline HTML
152+
153+
<dl>
154+
<dt>Definition list</dt>
155+
<dd>Is something people use sometimes.</dd>
156+
157+
<dt>Markdown in HTML</dt>
158+
<dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd>
159+
</dl>
160+
161+
---
162+
163+
## Line Breaks
164+
165+
Here's a line for us to start with.
166+
167+
This line is separated from the one above by two newlines, so it will be a _separate paragraph_.
168+
169+
This line is also a separate paragraph, but... This line is only separated by a single newline, so it's a separate line in the _same paragraph_.
170+
171+
---
172+
173+
## Admonitions
174+
175+
:::note
176+
177+
This is a note
178+
179+
:::
180+
181+
:::tip
182+
183+
This is a tip
184+
185+
:::
186+
187+
:::important
188+
189+
This is important
190+
191+
:::
192+
193+
:::caution
194+
195+
This is a caution
196+
197+
:::
198+
199+
:::warning
200+
201+
This is a warning
202+
203+
:::

docs/doc2.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
id: doc2
3+
title: Document Number 2
4+
---
5+
6+
This is a link to [another document.](doc3.md) This is a link to an [external page.](http://www.example.com/)

docs/doc3.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
id: doc3
3+
title: This is Document Number 3
4+
---
5+
6+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ac euismod odio, eu consequat dui. Nullam molestie consectetur risus id imperdiet. Proin sodales ornare turpis, non mollis massa ultricies id. Nam at nibh scelerisque, feugiat ante non, dapibus tortor. Vivamus volutpat diam quis tellus elementum bibendum. Praesent semper gravida velit quis aliquam. Etiam in cursus neque. Nam lectus ligula, malesuada et mauris a, bibendum faucibus mi. Phasellus ut interdum felis. Phasellus in odio pulvinar, porttitor urna eget, fringilla lectus. Aliquam sollicitudin est eros. Mauris consectetur quam vitae mauris interdum hendrerit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
7+
8+
Duis et egestas libero, imperdiet faucibus ipsum. Sed posuere eget urna vel feugiat. Vivamus a arcu sagittis, fermentum urna dapibus, congue lectus. Fusce vulputate porttitor nisl, ac cursus elit volutpat vitae. Nullam vitae ipsum egestas, convallis quam non, porta nibh. Morbi gravida erat nec neque bibendum, eu pellentesque velit posuere. Fusce aliquam erat eu massa eleifend tristique.
9+
10+
Sed consequat sollicitudin ipsum eget tempus. Integer a aliquet velit. In justo nibh, pellentesque non suscipit eget, gravida vel lacus. Donec odio ante, malesuada in massa quis, pharetra tristique ligula. Donec eros est, tristique eget finibus quis, semper non nisl. Vivamus et elit nec enim ornare placerat. Sed posuere odio a elit cursus sagittis.
11+
12+
Phasellus feugiat purus eu tortor ultrices finibus. Ut libero nibh, lobortis et libero nec, dapibus posuere eros. Sed sagittis euismod justo at consectetur. Nulla finibus libero placerat, cursus sapien at, eleifend ligula. Vivamus elit nisl, hendrerit ac nibh eu, ultrices tempus dui. Nam tellus neque, commodo non rhoncus eu, gravida in risus. Nullam id iaculis tortor.
13+
14+
Nullam at odio in sem varius tempor sit amet vel lorem. Etiam eu hendrerit nisl. Fusce nibh mauris, vulputate sit amet ex vitae, congue rhoncus nisl. Sed eget tellus purus. Nullam tempus commodo erat ut tristique. Cras accumsan massa sit amet justo consequat eleifend. Integer scelerisque vitae tellus id consectetur.

docs/mdx.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
id: mdx
3+
title: Powered by MDX
4+
---
5+
6+
You can write JSX and use React components within your Markdown thanks to [MDX](https://mdxjs.com/).
7+
8+
export const Highlight = ({children, color}) => ( <span style={{
9+
backgroundColor: color,
10+
borderRadius: '2px',
11+
color: '#fff',
12+
padding: '0.2rem',
13+
}}>{children}</span> );
14+
15+
<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">Facebook blue</Highlight> are my favorite colors.
16+
17+
I can write **Markdown** alongside my _JSX_!

0 commit comments

Comments
 (0)