Skip to content

Commit 14b0a5f

Browse files
committed
update documentation
1 parent aaea635 commit 14b0a5f

25 files changed

+10064
-275
lines changed

documentation/.eslintrc.js

Lines changed: 0 additions & 60 deletions
This file was deleted.

documentation/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,3 @@
1818
npm-debug.log*
1919
yarn-debug.log*
2020
yarn-error.log*
21-
22-
# ESLint
23-
.eslintcache

documentation/.prettierignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

documentation/.prettierrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

documentation/.stylelintrc.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

documentation/docusaurus.config.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*
7-
* @format
8-
*/
9-
1+
/** @type {import('@docusaurus/types').DocusaurusConfig} */
102
module.exports = {
113
title: 'React Native Boilerplate',
124
tagline: 'Ready to use react native architecture based on Separation of Concerns.',
135
url: 'https://thecodingmachine.github.io',
146
baseUrl: '/react-native-boilerplate/',
157
onBrokenLinks: 'warn',
8+
onBrokenMarkdownLinks: 'warn',
169
favicon: 'img/favicon.png',
1710
organizationName: 'thecodingmachine',
1811
projectName: 'react-native-boilerplate',

documentation/package.json

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,24 @@
99
"swizzle": "docusaurus swizzle",
1010
"deploy": "docusaurus deploy",
1111
"serve": "docusaurus serve",
12+
"write-translations": "docusaurus write-translations",
13+
"write-heading-ids": "docusaurus write-heading-ids",
1214
"ci": "yarn lint && yarn prettier:diff",
1315
"lint": "eslint --cache \"**/*.js\" && stylelint \"**/*.css\"",
1416
"prettier": "prettier --config .prettierrc --write \"**/*.{js,md}\"",
1517
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,md}\""
1618
},
1719
"dependencies": {
18-
"@docusaurus/core": "2.0.0-alpha.72",
19-
"@docusaurus/preset-classic": "2.0.0-alpha.72",
20+
"@docusaurus/core": "2.0.0-alpha.73",
21+
"@docusaurus/preset-classic": "2.0.0-alpha.73",
2022
"@mdx-js/react": "^1.6.21",
2123
"clsx": "^1.1.1",
2224
"react": "^17.0.1",
2325
"react-dom": "^17.0.1"
2426
},
25-
"devDependencies": {
26-
"babel-eslint": "^10.0.3",
27-
"eslint": "^6.7.1",
28-
"eslint-config-airbnb": "^18.0.1",
29-
"eslint-config-prettier": "^6.7.0",
30-
"eslint-plugin-header": "^3.0.0",
31-
"eslint-plugin-import": "^2.21.2",
32-
"eslint-plugin-jsx-a11y": "^6.2.3",
33-
"eslint-plugin-react": "^7.20.0",
34-
"eslint-plugin-react-hooks": "^4.0.4",
35-
"prettier": "^2.0.2",
36-
"stylelint": "^13.2.1"
37-
},
3827
"browserslist": {
3928
"production": [
40-
">0.2%",
29+
">0.5%",
4130
"not dead",
4231
"not op_mini all"
4332
],

documentation/sidebars.js

Lines changed: 20 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,26 @@
11
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*
7-
* @format
8-
*/
9-
const fs = require('fs')
10-
11-
const autoGenerated = (root = 'docs', path = root) => fs.readdirSync(path).filter(x => x !== 'assets').reduce((acc, item) => {
12-
if (fs.lstatSync(`${path}/${item}`).isDirectory()) {
13-
const listOfFilesInDirectory = autoGenerated(root, `${path}/${item}`)
14-
return {
15-
...acc,
16-
...listOfFilesInDirectory || {}
17-
}
18-
}
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
196
20-
const actualPath = path.split(`${root}/`)[1] || 'others'
21-
const olderValues = actualPath !== 'others' ? (acc[path.split(`${root}/`)[1]] || []) : (acc.others || [])
7+
The sidebars can be generated from the filesystem, or explicitly defined here.
228
23-
return {
24-
...acc,
25-
[actualPath]: [
26-
...olderValues,
27-
`${path.split(`${root}/`).slice(1)}/${item}`.replace(/\.[^.]*$/, ''),
28-
]
29-
}
30-
}, {})
9+
Create as many sidebars as you want.
10+
*/
3111

3212
module.exports = {
33-
docs: Object.entries(autoGenerated()).reduce((acc, [key, value]) => {
34-
if (key !== 'others') {
35-
return [
36-
...acc,
37-
{
38-
type: 'category',
39-
label: key.replace(/^[^_]*_/, ''),
40-
items: value,
41-
},
42-
]
43-
}
44-
return [
45-
...acc,
46-
...value.map(item=> ({type: 'doc', id: item.split('/').pop()}))
47-
]
48-
}, [])
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+
*/
4926
};
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import React from 'react';
2+
import clsx from 'clsx';
3+
import styles from './HomepageDependencies.module.css';
4+
5+
const DependencyList = [
6+
{
7+
title: 'Redux',
8+
Svg: require('../../static/img/dependencies/redux.svg').default,
9+
},
10+
{
11+
title: 'React-Navigation',
12+
Svg: require('../../static/img/dependencies/react-navigation.svg').default,
13+
},
14+
{
15+
title: 'Flipper',
16+
path: '../../static/img/dependencies/flipper.png',
17+
},
18+
{
19+
title: 'Prettier',
20+
Svg: require('../../static/img/dependencies/prettier.svg').default,
21+
},
22+
{
23+
title: 'Eslint',
24+
Svg: require('../../static/img/dependencies/eslint.svg').default,
25+
},
26+
{
27+
title: 'I18next',
28+
Svg: require('../../static/img/dependencies/i18next.svg').default,
29+
},
30+
];
31+
32+
function Dependency({Svg, path, title}) {
33+
return (
34+
<div className={clsx('col col--2')}>
35+
<div className="text--center">
36+
{ path && <img className={styles.dependencySvg} src={path} alt={title}/> }
37+
{ Svg && <Svg className={styles.dependencySvg} alt={title} />}
38+
</div>
39+
<div className="text--center padding-horiz--md">
40+
<p className="text--bold text--secondary">{title}</p>
41+
</div>
42+
</div>
43+
);
44+
}
45+
46+
export default function HomepageFeatures() {
47+
return (
48+
<>
49+
<h1 className="text--center text--primary">Based on solid libraries</h1>
50+
<section className={styles.dependencies}>
51+
<div className="container">
52+
<div className="row">
53+
{DependencyList.map((props, idx) => (
54+
<Dependency key={idx} {...props} />
55+
))}
56+
</div>
57+
</div>
58+
</section>
59+
</>
60+
61+
);
62+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* stylelint-disable docusaurus/copyright-header */
2+
3+
.dependencies {
4+
display: flex;
5+
align-items: center;
6+
padding: 2rem 0;
7+
width: 100%;
8+
}
9+
10+
.dependencySvg {
11+
height: 100px;
12+
width: 100px;
13+
}

0 commit comments

Comments
 (0)