Skip to content

Commit d2db6ba

Browse files
author
Rishabh
committed
adds v2 docs - initial commit
1 parent 7ec38f5 commit d2db6ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+21386
-0
lines changed

v2/.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*

v2/HOW_TO_NEW_DOCS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# To create a new doc project, you will need to:
2+
- Copy the `change_me` folder and rename it to the new docs
3+
- Copy `@docusaurus/plugin-content-docs` that belongs to `id: "change_me"`
4+
- Change `change_me` in that to the new docs project within that block
5+
- If this doc will have a version, copy `docsVersionDropdown` navbar item and change `change_me` in that.
6+
- If the github icon is not to be shown in the docs, modify `DO_NOT_SHOW_GITHUB_BUTTON` in `src/theme/NavbarItem/index.js`

v2/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
## Installation
6+
7+
```console
8+
yarn install
9+
```
10+
11+
## Local Development
12+
13+
```console
14+
yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
## Build
20+
21+
```console
22+
yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
## Deployment
28+
29+
```console
30+
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
31+
```
32+
33+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

v2/android_versions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"1.1.0",
3+
"1.0.0"
4+
]

v2/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+
};

v2/change_me/collapsible-element.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Collapsible Element
6+
7+
You can expand / minimize content by using the below:
8+
9+
<details><summary style={{
10+
fontSize: "20px"
11+
}}>appName (compulsory)</summary>
12+
This is the name of your application. It is used when sending password reset or email verification emails (in the default email design). An example of this is appName: "GitHub".
13+
</details>
14+
15+
<br />
16+
17+
<details><summary style={{
18+
fontSize: "20px"
19+
}}>websiteDomain (compulsory)</summary>
20+
21+
This is the domain part of your website on which the SuperTokens' will operate on. By operate, we mean that the login UI will be shown on this domain and / or the session information will be stored under this domain. For example:
22+
23+
- For local development, you are likely using localhost with some port (ex 8080). Then the value of this should be `"http://localhost:8080"`.
24+
- If your website is `https://www.example.com`, then the value of this should be `"https://www.example.com"`.
25+
- If your website is `https://example.com`, then the value of this should be `"https://example.com"`.
26+
- If you have multiple sub domains, and your users login via `https://auth.example.com`, then the value of this should be `"https://auth.example.com"`.
27+
28+
By default, the login UI will be displayed on `{websiteDomain}/auth/*` (See about websiteBasePath to change the `/auth/*` part).
29+
30+
We need the domain information on the frontend for routing purposes, and on the backend so that we can generate correct email verification and password reset links.
31+
32+
</details>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Deep info",
3+
"position": 4
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Deep info 1",
3+
"position": 1
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Deep info 2",
3+
"position": 1
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Deep info 3",
3+
"position": 1
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Hello

v2/change_me/introduction.mdx

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Introduction
6+
7+
# H1 - H4 have a custom style
8+
## H1 - H4 have a custom style
9+
### H1 - H4 have a custom style
10+
#### H1 - H4 have a custom style
11+
12+
##### H5 - H6 act as normal content
13+
###### H5 - H6 act as normal content
14+
15+
```jsx {2-3} title="/src/components/HelloCodeTitle.js"
16+
function HelloCodeTitle(props) {
17+
let a = 1;
18+
return <h1>Hello, {props.name}</h1>;
19+
}
20+
```
21+
22+
23+
<br/><br/><br/>
24+
25+
:::important
26+
You can render specialNotes like this one to highlight important information using the code snippet below.
27+
:::
28+
29+
:::note
30+
31+
The content and title *can* include markdown.
32+
33+
:::
34+
35+
:::tip You can specify an optional title
36+
37+
Heads up! Here's a pro-tip.
38+
39+
:::
40+
41+
:::tip
42+
43+
Tip with no title
44+
45+
:::
46+
47+
:::info
48+
49+
Useful information.
50+
51+
:::
52+
53+
:::caution
54+
55+
Warning! You better pay attention!
56+
57+
:::
58+
59+
:::danger
60+
61+
Danger danger, mayday!
62+
63+
:::
64+
65+
The documentation pages load assets from the following places
66+
- ```/static/assets/```: For all images that are universal to the website(For example logo)
67+
- ```/docs/static/assets```: For all images universal to only the documentation pages and not the rest of the website
68+
- ```/docs/static/style/commonDocs.css```: For styling common to all documentation pages
69+
- ```/docs/static/scripts/commonDocsBuilder.js```: A script that performs actions and adds common widgets universal to all documentation pages
70+
- `<this docs>/src/css/custom.css`: For styles custom to this docs.
71+
- `<this docs>/static/img/`: For images for just this docs
72+
73+
<br/><br/><br/>
74+
75+
All documentation pages have a common styling for [hyperlinks](/) and **bold text**
76+
77+
<br/><br/><br/>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"label": "More info",
3+
"position": 3,
4+
"collapsed": false
5+
}

v2/change_me/more-info/tabs.mdx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Tabs
6+
7+
import Tabs from '@theme/Tabs';
8+
import TabItem from '@theme/TabItem';
9+
10+
<Tabs
11+
defaultValue="apple"
12+
values={[
13+
{label: 'Apple', value: 'apple'},
14+
{label: 'Orange', value: 'orange'},
15+
{label: 'Banana', value: 'banana'},
16+
]}>
17+
<TabItem value="apple">
18+
<Tabs
19+
groupId="fruits"
20+
defaultValue="apple"
21+
values={[
22+
{label: 'Apple 2', value: 'apple'},
23+
{label: 'Orange 2', value: 'orange'},
24+
{label: 'Banana 2', value: 'banana'},
25+
]}>
26+
<TabItem value="apple">
27+
This is an apple 🍎
28+
</TabItem>
29+
<TabItem value="orange">This is an orange 🍊</TabItem>
30+
<TabItem value="banana">This is a banana 🍌</TabItem>
31+
</Tabs>
32+
</TabItem>
33+
<TabItem value="orange">This is an orange 🍊</TabItem>
34+
<TabItem value="banana">This is a banana 🍌</TabItem>
35+
</Tabs>
36+
37+
38+
Synced with:
39+
40+
<Tabs
41+
groupId="fruits"
42+
defaultValue="apple"
43+
values={[
44+
{label: 'Apple 2', value: 'apple'},
45+
{label: 'Orange 2', value: 'orange'},
46+
{label: 'Banana 2', value: 'banana'},
47+
]}>
48+
<TabItem value="apple">
49+
This is an apple 🍎
50+
</TabItem>
51+
<TabItem value="orange">This is an orange 🍊</TabItem>
52+
<TabItem value="banana">This is a banana 🍌</TabItem>
53+
</Tabs>

v2/change_me/sidebars.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Creating a sidebar enables you to:
3+
- create an ordered group of docs
4+
- render a sidebar for each doc of that group
5+
- provide next/previous navigation
6+
7+
The sidebars can be generated from the filesystem, or explicitly defined here.
8+
9+
Create as many sidebars as you want.
10+
*/
11+
12+
module.exports = {
13+
// By default, Docusaurus generates a sidebar from the docs folder structure
14+
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
15+
16+
// But you can create a sidebar manually
17+
/*
18+
tutorialSidebar: [
19+
{
20+
type: 'category',
21+
label: 'Tutorial',
22+
items: ['hello'],
23+
},
24+
],
25+
*/
26+
};

v2/community/collapsible-element.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Collapsible Element
6+
7+
You can expand / minimize content by using the below:
8+
9+
<details><summary style={{
10+
fontSize: "20px"
11+
}}>appName (compulsory)</summary>
12+
This is the name of your application. It is used when sending password reset or email verification emails (in the default email design). An example of this is appName: "GitHub".
13+
</details>
14+
15+
<br />
16+
17+
<details><summary style={{
18+
fontSize: "20px"
19+
}}>websiteDomain (compulsory)</summary>
20+
21+
This is the domain part of your website on which the SuperTokens' will operate on. By operate, we mean that the login UI will be shown on this domain and / or the session information will be stored under this domain. For example:
22+
23+
- For local development, you are likely using localhost with some port (ex 8080). Then the value of this should be `"http://localhost:8080"`.
24+
- If your website is `https://www.example.com`, then the value of this should be `"https://www.example.com"`.
25+
- If your website is `https://example.com`, then the value of this should be `"https://example.com"`.
26+
- If you have multiple sub domains, and your users login via `https://auth.example.com`, then the value of this should be `"https://auth.example.com"`.
27+
28+
By default, the login UI will be displayed on `{websiteDomain}/auth/*` (See about websiteBasePath to change the `/auth/*` part).
29+
30+
We need the domain information on the frontend for routing purposes, and on the backend so that we can generate correct email verification and password reset links.
31+
32+
</details>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Deep info",
3+
"position": 4
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Deep info 1",
3+
"position": 1
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Deep info 2",
3+
"position": 1
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Deep info 3",
3+
"position": 1
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Hello

0 commit comments

Comments
 (0)