Skip to content

Commit

Permalink
Add prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
onattech committed Feb 18, 2023
1 parent 08b8d72 commit 5dcd455
Show file tree
Hide file tree
Showing 23 changed files with 11,941 additions and 8,856 deletions.
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tabWidth": 4,
"semi": false,
"singleQuote": true
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Docusaurus `Soft Design`

Open-Source docusaurus theme styled with `Soft Dashboard` Design from `Creative-Tim`.
Open-Source docusaurus theme styled with `Soft Dashboard` Design from `Creative-Tim`.

> UI KIT: https://github.com/creativetimofficial/soft-ui-dashboard-react
<br />

---

Docusaurus `Soft Design` - provided by AppSeed
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
}
4 changes: 2 additions & 2 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new

### What you'll need

- [Node.js](https://nodejs.org/en/download/) version 16.14 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
- [Node.js](https://nodejs.org/en/download/) version 16.14 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.

## Generate a new site

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-basics/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"type": "generated-index",
"description": "5 minutes to learn the most important Docusaurus concepts."
}
}
}
14 changes: 7 additions & 7 deletions docs/tutorial-basics/congratulations.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://

## What's next?

- Read the [official documentation](https://docusaurus.io/)
- Modify your site configuration with [`docusaurus.config.js`](https://docusaurus.io/docs/api/docusaurus-config)
- Add navbar and footer items with [`themeConfig`](https://docusaurus.io/docs/api/themes/configuration)
- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
- Add a [search bar](https://docusaurus.io/docs/search)
- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)
- Get involved in the [Docusaurus Community](https://docusaurus.io/community/support)
- Read the [official documentation](https://docusaurus.io/)
- Modify your site configuration with [`docusaurus.config.js`](https://docusaurus.io/docs/api/docusaurus-config)
- Add navbar and footer items with [`themeConfig`](https://docusaurus.io/docs/api/themes/configuration)
- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
- Add a [search bar](https://docusaurus.io/docs/search)
- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)
- Get involved in the [Docusaurus Community](https://docusaurus.io/community/support)
16 changes: 8 additions & 8 deletions docs/tutorial-basics/create-a-blog-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Create a file at `blog/2021-02-28-greetings.md`:
slug: greetings
title: Greetings!
authors:
- name: Joel Marcey
title: Co-creator of Docusaurus 1
url: https://github.com/JoelMarcey
image_url: https://github.com/JoelMarcey.png
- name: Sébastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
- name: Joel Marcey
title: Co-creator of Docusaurus 1
url: https://github.com/JoelMarcey
image_url: https://github.com/JoelMarcey.png
- name: Sébastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
tags: [greetings]
---

Expand Down
28 changes: 14 additions & 14 deletions docs/tutorial-basics/create-a-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ sidebar_position: 2

Documents are **groups of pages** connected through:

- a **sidebar**
- **previous/next navigation**
- **versioning**
- a **sidebar**
- **previous/next navigation**
- **versioning**

## Create your first Doc

Expand Down Expand Up @@ -43,15 +43,15 @@ It is also possible to create your sidebar explicitly in `sidebars.js`:

```js title="sidebars.js"
module.exports = {
tutorialSidebar: [
'intro',
// highlight-next-line
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
};
tutorialSidebar: [
'intro',
// highlight-next-line
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
}
```
22 changes: 11 additions & 11 deletions docs/tutorial-basics/create-a-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ sidebar_position: 1

Add **Markdown or React** files to `src/pages` to create a **standalone page**:

- `src/pages/index.js``localhost:3000/`
- `src/pages/foo.md``localhost:3000/foo`
- `src/pages/foo/bar.js``localhost:3000/foo/bar`
- `src/pages/index.js``localhost:3000/`
- `src/pages/foo.md``localhost:3000/foo`
- `src/pages/foo/bar.js``localhost:3000/foo/bar`

## Create your first React Page

Create a file at `src/pages/my-react-page.js`:

```jsx title="src/pages/my-react-page.js"
import React from 'react';
import Layout from '@theme/Layout';
import React from 'react'
import Layout from '@theme/Layout'

export default function MyReactPage() {
return (
<Layout>
<h1>My React page</h1>
<p>This is a React page</p>
</Layout>
);
return (
<Layout>
<h1>My React page</h1>
<p>This is a React page</p>
</Layout>
)
}
```

Expand Down
33 changes: 17 additions & 16 deletions docs/tutorial-basics/markdown-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Markdown code blocks are supported with Syntax highlighting.

```jsx title="src/components/HelloDocusaurus.js"
function HelloDocusaurus() {
return <h1>Hello, Docusaurus!</h1>;
return <h1>Hello, Docusaurus!</h1>
}
```

Expand Down Expand Up @@ -129,21 +129,22 @@ This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !
This is <Highlight color="#1877F2">Facebook blue</Highlight> !
```

export const Highlight = ({children, color}) => (
<span
style={{
backgroundColor: color,
borderRadius: '20px',
color: '#fff',
padding: '10px',
cursor: 'pointer',
}}
onClick={() => {
alert(`You clicked the color ${color} with label ${children}`);
}}>
{children}
</span>
);
export const Highlight = ({ children, color }) => (
<span
style={{
backgroundColor: color,
borderRadius: '20px',
color: '#fff',
padding: '10px',
cursor: 'pointer',
}}
onClick={() => {
alert(`You clicked the color ${color} with label ${children}`)
}}
>
{children}
</span>
)

This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-extras/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"link": {
"type": "generated-index"
}
}
}
28 changes: 14 additions & 14 deletions docs/tutorial-extras/manage-docs-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json

Your docs now have 2 versions:

- `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs
- `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs**
- `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs
- `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs**

## Add a Version Dropdown

Expand All @@ -29,18 +29,18 @@ Modify the `docusaurus.config.js` file:

```js title="docusaurus.config.js"
module.exports = {
themeConfig: {
navbar: {
items: [
// highlight-start
{
type: 'docsVersionDropdown',
themeConfig: {
navbar: {
items: [
// highlight-start
{
type: 'docsVersionDropdown',
},
// highlight-end
],
},
// highlight-end
],
},
},
};
}
```

The docs version dropdown appears in your navbar:
Expand All @@ -51,5 +51,5 @@ The docs version dropdown appears in your navbar:

It is possible to edit versioned docs in their respective folder:

- `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello`
- `docs/hello.md` updates `http://localhost:3000/docs/next/hello`
- `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello`
- `docs/hello.md` updates `http://localhost:3000/docs/next/hello`
30 changes: 15 additions & 15 deletions docs/tutorial-extras/translate-your-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Modify `docusaurus.config.js` to add support for the `fr` locale:

```js title="docusaurus.config.js"
module.exports = {
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
},
};
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
},
}
```

## Translate a doc
Expand Down Expand Up @@ -55,18 +55,18 @@ Modify the `docusaurus.config.js` file:

```js title="docusaurus.config.js"
module.exports = {
themeConfig: {
navbar: {
items: [
// highlight-start
{
type: 'localeDropdown',
themeConfig: {
navbar: {
items: [
// highlight-start
{
type: 'localeDropdown',
},
// highlight-end
],
},
// highlight-end
],
},
},
};
}
```

The locale dropdown now appears in your navbar:
Expand Down
Loading

0 comments on commit 5dcd455

Please sign in to comment.