Skip to content

Commit e90500d

Browse files
committed
➕ docs
1 parent ecc90c6 commit e90500d

Some content is hidden

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

59 files changed

+2196510
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ android/keystores/debug.keystore
5858

5959
# generated by bob
6060
lib/
61+
62+
/docs/node_modules
63+
/docs/.next

docs/csv/big.csv

Lines changed: 1094353 additions & 0 deletions
Large diffs are not rendered by default.

docs/csv/malformed.csv

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
site lon lat max min precip snow snowdepth
2+
1V4 -72.02 44.42 13 -5 0.01 -99 -99
3+
BTV -73.15 44.47 14 -9 0.00 0.0 7 52
4+
MVL -72.62 44.54 11 -7 0.00 -99 -99
5+
MPV -72.56 44.20 12 -4 0.00 -99 -99
6+
MSS -74.85 44.93 4 -150.00 -99 -99
7+
PBG -73.47 44.65 15 -12 0.00 -99 -99
8+
RUT -72.95 43.53 18 -2 -99 -99 -99
9+
SLK -74.20 "44.39 7 -12 0.00 -99 -99
10+
VSF -72.50 43.34 20 -1 0.04 -99 -99

docs/csv/normal.csv

Lines changed: 1136 additions & 0 deletions
Large diffs are not rendered by default.

docs/deploy.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Deploy
2+
3+
Set `const isProduction = true` in `next.config.js`
4+
5+
# Fix npm publish
6+
7+
npm config set registry https://registry.npmjs.org

docs/next.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const isProduction = false // true
2+
3+
module.exports = {
4+
webpack: (config) => {
5+
config.module.rules.push(
6+
{
7+
test: /\.md$/,
8+
use: 'raw-loader'
9+
}
10+
)
11+
return config
12+
},
13+
exportPathMap: function () {
14+
return {
15+
'/': { page: '/' },
16+
'/demo': { page: '/demo' },
17+
'/docs': { page: '/docs' }
18+
}
19+
},
20+
assetPrefix: isProduction ? 'https://react-papaparse.js.org' : ''
21+
}

docs/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "react-native-csv-docs",
3+
"version": "3.11.0",
4+
"description": "react-native-csv-docs docs.",
5+
"main": "index.js",
6+
"scripts": {
7+
"prettier": "prettier --write './pages/*.js' './src/*/*/*.js' './src/*/*/*/*.js' --config ../.prettierrc",
8+
"test": "echo \"Error: no test specified\" && exit 1",
9+
"dev": "next",
10+
"build": "next build && next export",
11+
"start": "next start"
12+
},
13+
"keywords": [],
14+
"author": "Bunlong <bunlong.van@gmail.com>",
15+
"license": "MIT",
16+
"dependencies": {
17+
"next": "^9.2.0",
18+
"raw-loader": "^4.0.0",
19+
"react": "^16.12.0",
20+
"react-dom": "^16.12.0",
21+
"react-papaparse": "^3.11.0",
22+
"react-tabs": "^3.1.0"
23+
},
24+
"devDependencies": {
25+
"prettier": "^2.1.2"
26+
}
27+
}

docs/pages/_app.js

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
import React from 'react';
2+
import Head from 'next/head';
3+
import App from 'next/app';
4+
5+
import 'react-tabs/style/react-tabs.css';
6+
7+
class CustomApp extends App {
8+
// Only uncomment this method if you have blocking data requirements for
9+
// every single page in your application. This disables the ability to
10+
// perform automatic static optimization, causing every page in your app to
11+
// be server-side rendered.
12+
//
13+
// static async getInitialProps(appContext) {
14+
// // calls page's `getInitialProps` and fills `appProps.pageProps`
15+
// const appProps = await App.getInitialProps(appContext);
16+
//
17+
// return { ...appProps }
18+
// }
19+
20+
render() {
21+
const { Component, pageProps } = this.props;
22+
const pageName = this.props.router.route.substr(1);
23+
let title = '';
24+
if (pageName === '') {
25+
title = 'react-native-csv';
26+
} else if (pageName === 'demo') {
27+
title = 'Demo';
28+
} else if (pageName === 'docs') {
29+
title = 'Documentation';
30+
}
31+
return (
32+
<div>
33+
<Head>
34+
<title> {`${title} - Powerful CSV Parser for React`}</title>
35+
<link rel="shortcut icon" type="image/x-icon" href="" />
36+
<meta name="theme-color" content="#ffffff" />
37+
<meta name="apple-mobile-web-app-capable" content="yes" />
38+
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
39+
<meta name="apple-mobile-web-app-title" content="react-native-csv" />
40+
<link rel="apple-touch-icon" href="" />
41+
<link rel="shortcut icon" type="image/x-icon" href="" />
42+
43+
<link
44+
rel="stylesheet"
45+
href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"
46+
/>
47+
<link
48+
rel="stylesheet"
49+
href="//fonts.googleapis.com/css?family=Arvo|Source+Sans+Pro:400,400italic,700|Lato:300,400"
50+
/>
51+
<link rel="stylesheet" href="/static/css/unsemantic.css" />
52+
<link rel="stylesheet" href="/static/css/common.css" />
53+
<link rel="stylesheet" href="/static/css/prism.css" />
54+
55+
{pageName === '' ? (
56+
<link rel="stylesheet" href="/static/css/home.css" />
57+
) : (
58+
''
59+
)}
60+
{pageName === 'demo' ? (
61+
<link rel="stylesheet" href="/static/css/demo.css" />
62+
) : (
63+
''
64+
)}
65+
66+
<meta property="og:url" content="https://react-native-csv.github.io" />
67+
<meta property="og:type" content="website" />
68+
<meta property="og:title" content="react-native-csv" />
69+
<meta
70+
property="og:description"
71+
content="The fastest in-browser CSV (or delimited text) parser for React."
72+
/>
73+
<meta
74+
property="og:image"
75+
content="/static/images/react-native-csv.png"
76+
/>
77+
78+
<meta name="twitter:card" content="summary_large_image" />
79+
<meta name="twitter:site" content="@bunlongvan" />
80+
<meta name="twitter:creator" content="@bunlongvan" />
81+
<meta name="twitter:title" content="react-native-csv" />
82+
<meta
83+
name="twitter:description"
84+
content="The fastest in-browser CSV (or delimited text) parser for React."
85+
/>
86+
<meta
87+
name="twitter:image"
88+
content="https://react-native-csv.github.io/static/images/react-native-csv.png"
89+
/>
90+
91+
<link
92+
rel="shortcut icon"
93+
href="/static/favicon.ico"
94+
type="image/x-icon"
95+
/>
96+
<link
97+
rel="icon"
98+
href="/static/favicon-32.png"
99+
sizes="32x32"
100+
type="image/png"
101+
/>
102+
<link
103+
rel="apple-touch-icon-precomposed"
104+
href="/static/favicon-152.png"
105+
type="image/png"
106+
sizes="152x152"
107+
/>
108+
<link
109+
rel="apple-touch-icon-precomposed"
110+
href="/static/favicon-120.png"
111+
type="image/png"
112+
sizes="120x120"
113+
/>
114+
<link
115+
rel="icon"
116+
href="/static/favicon-96.png"
117+
sizes="96x96"
118+
type="image/png"
119+
/>
120+
</Head>
121+
<div>
122+
<Component {...pageProps} />
123+
</div>
124+
<footer>
125+
<div className="footer-main">
126+
<div className="grid-container">
127+
<div className="grid-40 text-center">
128+
<div className="logo" />
129+
<br />
130+
<br />
131+
react-native-csv by{' '}
132+
<a href="https://github.com/bunlong">Bunlong</a>
133+
<br />
134+
&copy; 2018-2020
135+
</div>
136+
137+
<div className="grid-15 mobile-grid-50 links">
138+
<h5>Learn</h5>
139+
<a href="/demo">Demo</a>
140+
<a href="/docs">Documentation</a>
141+
</div>
142+
143+
<div className="grid-15 mobile-grid-50 links">
144+
<h5>Project</h5>
145+
<a
146+
href="https://github.com/Bunlong/react-native-csv"
147+
target="_blank"
148+
>
149+
react-native-csv
150+
</a>
151+
</div>
152+
</div>
153+
</div>
154+
</footer>
155+
<script type="text/javascript" src="/static/js/prism.js" />
156+
</div>
157+
);
158+
}
159+
}
160+
161+
export default CustomApp;

docs/pages/demo.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React, { Component } from 'react';
2+
import dynamic from 'next/dynamic';
3+
4+
const DynamicComponentWithNoSSR = dynamic(
5+
() => import('../src/components/screens/Demo'),
6+
{ ssr: false },
7+
);
8+
9+
export default class Demo extends Component {
10+
render() {
11+
return (
12+
<>
13+
<DynamicComponentWithNoSSR />
14+
</>
15+
);
16+
}
17+
}

docs/pages/docs.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
3+
import Navbar from '../src/components/screens/docs/Navbar';
4+
import Documentation from '../src/components/screens/docs/Documentation';
5+
import CSVToJSON from '../src/components/screens/docs/CSVToJSON';
6+
import JSONToCSV from '../src/components/screens/docs/JSONToCSV';
7+
import Config from '../src/components/screens/docs/Config';
8+
import Result from '../src/components/screens/docs/Result';
9+
import Extra from '../src/components/screens/docs/Extra';
10+
11+
const Docs = () => {
12+
return (
13+
<main>
14+
<Navbar />
15+
<Documentation />
16+
<main>
17+
<CSVToJSON />
18+
<JSONToCSV />
19+
<Config />
20+
<Result />
21+
<Extra />
22+
</main>
23+
</main>
24+
);
25+
};
26+
27+
export default Docs;

docs/pages/index.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import React from 'react';
2+
import Welcome from '../src/components/screens/indexes/Welcome';
3+
import Navbar from '../src/components/screens/indexes/Navbar';
4+
import Feature from '../src/components/screens/indexes/Feature';
5+
import Framework from '../src/components/screens/indexes/Framework';
6+
import Love from '../src/components/screens/indexes/Love';
7+
import CSVParsing from '../src/components/screens/indexes/CSVParsing';
8+
import Delimiter from '../src/components/screens/indexes/Delimiter';
9+
import LocalFile from '../src/components/screens/indexes/LocalFile';
10+
import RemoteFile from '../src/components/screens/indexes/RemoteFile';
11+
import Stream from '../src/components/screens/indexes/Stream';
12+
import Worker from '../src/components/screens/indexes/Worker';
13+
import Header from '../src/components/screens/indexes/Header';
14+
import TypeConversion from '../src/components/screens/indexes/TypeConversion';
15+
import Comment from '../src/components/screens/indexes/Comment';
16+
import Error from '../src/components/screens/indexes/Error';
17+
import Unparse from '../src/components/screens/indexes/Unparse';
18+
import Download from '../src/components/screens/indexes/Download';
19+
20+
const Index = () => {
21+
return (
22+
<>
23+
<Welcome />
24+
<main>
25+
<Navbar />
26+
<Feature />
27+
<Framework />
28+
<Love />
29+
<CSVParsing />
30+
<Delimiter />
31+
<LocalFile />
32+
<RemoteFile />
33+
<Stream />
34+
<Worker />
35+
<Header />
36+
<TypeConversion />
37+
<Comment />
38+
<Error />
39+
<Unparse />
40+
<Download />
41+
</main>
42+
</>
43+
);
44+
};
45+
46+
export default Index;

0 commit comments

Comments
 (0)