Skip to content

Commit

Permalink
adds v2 docs - initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabh committed Jul 17, 2021
1 parent 7ec38f5 commit d2db6ba
Show file tree
Hide file tree
Showing 45 changed files with 21,386 additions and 0 deletions.
20 changes: 20 additions & 0 deletions v2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
6 changes: 6 additions & 0 deletions v2/HOW_TO_NEW_DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# To create a new doc project, you will need to:
- Copy the `change_me` folder and rename it to the new docs
- Copy `@docusaurus/plugin-content-docs` that belongs to `id: "change_me"`
- Change `change_me` in that to the new docs project within that block
- If this doc will have a version, copy `docsVersionDropdown` navbar item and change `change_me` in that.
- If the github icon is not to be shown in the docs, modify `DO_NOT_SHOW_GITHUB_BUTTON` in `src/theme/NavbarItem/index.js`
33 changes: 33 additions & 0 deletions v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

## Installation

```console
yarn install
```

## Local Development

```console
yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

## Build

```console
yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

## Deployment

```console
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```

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.
4 changes: 4 additions & 0 deletions v2/android_versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"1.1.0",
"1.0.0"
]
3 changes: 3 additions & 0 deletions v2/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
32 changes: 32 additions & 0 deletions v2/change_me/collapsible-element.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
sidebar_position: 2
---

# Collapsible Element

You can expand / minimize content by using the below:

<details><summary style={{
fontSize: "20px"
}}>appName (compulsory)</summary>
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".
</details>

<br />

<details><summary style={{
fontSize: "20px"
}}>websiteDomain (compulsory)</summary>

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:

- For local development, you are likely using localhost with some port (ex 8080). Then the value of this should be `"http://localhost:8080"`.
- If your website is `https://www.example.com`, then the value of this should be `"https://www.example.com"`.
- If your website is `https://example.com`, then the value of this should be `"https://example.com"`.
- 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"`.

By default, the login UI will be displayed on `{websiteDomain}/auth/*` (See about websiteBasePath to change the `/auth/*` part).

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.

</details>
4 changes: 4 additions & 0 deletions v2/change_me/deep-info/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Deep info",
"position": 4
}
4 changes: 4 additions & 0 deletions v2/change_me/deep-info/deep-info-1/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Deep info 1",
"position": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Deep info 2",
"position": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Deep info 3",
"position": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 1
---

# Hello
77 changes: 77 additions & 0 deletions v2/change_me/introduction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
sidebar_position: 1
---

# Introduction

# H1 - H4 have a custom style
## H1 - H4 have a custom style
### H1 - H4 have a custom style
#### H1 - H4 have a custom style

##### H5 - H6 act as normal content
###### H5 - H6 act as normal content

```jsx {2-3} title="/src/components/HelloCodeTitle.js"
function HelloCodeTitle(props) {
let a = 1;
return <h1>Hello, {props.name}</h1>;
}
```


<br/><br/><br/>

:::important
You can render specialNotes like this one to highlight important information using the code snippet below.
:::

:::note

The content and title *can* include markdown.

:::

:::tip You can specify an optional title

Heads up! Here's a pro-tip.

:::

:::tip

Tip with no title

:::

:::info

Useful information.

:::

:::caution

Warning! You better pay attention!

:::

:::danger

Danger danger, mayday!

:::

The documentation pages load assets from the following places
- ```/static/assets/```: For all images that are universal to the website(For example logo)
- ```/docs/static/assets```: For all images universal to only the documentation pages and not the rest of the website
- ```/docs/static/style/commonDocs.css```: For styling common to all documentation pages
- ```/docs/static/scripts/commonDocsBuilder.js```: A script that performs actions and adds common widgets universal to all documentation pages
- `<this docs>/src/css/custom.css`: For styles custom to this docs.
- `<this docs>/static/img/`: For images for just this docs

<br/><br/><br/>

All documentation pages have a common styling for [hyperlinks](/) and **bold text**

<br/><br/><br/>
5 changes: 5 additions & 0 deletions v2/change_me/more-info/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "More info",
"position": 3,
"collapsed": false
}
53 changes: 53 additions & 0 deletions v2/change_me/more-info/tabs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
sidebar_position: 1
---

# Tabs

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs
defaultValue="apple"
values={[
{label: 'Apple', value: 'apple'},
{label: 'Orange', value: 'orange'},
{label: 'Banana', value: 'banana'},
]}>
<TabItem value="apple">
<Tabs
groupId="fruits"
defaultValue="apple"
values={[
{label: 'Apple 2', value: 'apple'},
{label: 'Orange 2', value: 'orange'},
{label: 'Banana 2', value: 'banana'},
]}>
<TabItem value="apple">
This is an apple 🍎
</TabItem>
<TabItem value="orange">This is an orange 🍊</TabItem>
<TabItem value="banana">This is a banana 🍌</TabItem>
</Tabs>
</TabItem>
<TabItem value="orange">This is an orange 🍊</TabItem>
<TabItem value="banana">This is a banana 🍌</TabItem>
</Tabs>


Synced with:

<Tabs
groupId="fruits"
defaultValue="apple"
values={[
{label: 'Apple 2', value: 'apple'},
{label: 'Orange 2', value: 'orange'},
{label: 'Banana 2', value: 'banana'},
]}>
<TabItem value="apple">
This is an apple 🍎
</TabItem>
<TabItem value="orange">This is an orange 🍊</TabItem>
<TabItem value="banana">This is a banana 🍌</TabItem>
</Tabs>
26 changes: 26 additions & 0 deletions v2/change_me/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/

module.exports = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
tutorialSidebar: [
{
type: 'category',
label: 'Tutorial',
items: ['hello'],
},
],
*/
};
32 changes: 32 additions & 0 deletions v2/community/collapsible-element.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
sidebar_position: 2
---

# Collapsible Element

You can expand / minimize content by using the below:

<details><summary style={{
fontSize: "20px"
}}>appName (compulsory)</summary>
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".
</details>

<br />

<details><summary style={{
fontSize: "20px"
}}>websiteDomain (compulsory)</summary>

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:

- For local development, you are likely using localhost with some port (ex 8080). Then the value of this should be `"http://localhost:8080"`.
- If your website is `https://www.example.com`, then the value of this should be `"https://www.example.com"`.
- If your website is `https://example.com`, then the value of this should be `"https://example.com"`.
- 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"`.

By default, the login UI will be displayed on `{websiteDomain}/auth/*` (See about websiteBasePath to change the `/auth/*` part).

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.

</details>
4 changes: 4 additions & 0 deletions v2/community/deep-info/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Deep info",
"position": 4
}
4 changes: 4 additions & 0 deletions v2/community/deep-info/deep-info-1/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Deep info 1",
"position": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Deep info 2",
"position": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Deep info 3",
"position": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 1
---

# Hello
Loading

0 comments on commit d2db6ba

Please sign in to comment.