Skip to content

Commit a16eb5c

Browse files
jbadangreg-a-smith
authored andcommitted
chore: update docs pages with preamble, update nav (#341)
* updating with home page and new nav * move title to readme * cleanup list hang a bit more * Fixed left nav scrolling issue * Refactored the left nav to group and sort nav items
1 parent 18153ed commit a16eb5c

File tree

12 files changed

+458
-175
lines changed

12 files changed

+458
-175
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
*.snap
66
*.svg
77
*.sh
8+
*.md
89
node_modules/**

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
/build
1111
/lib
1212

13+
# Readme copy for github pages site
14+
/src/_playground/documentation/Home/README.md
15+
1316
# misc
1417
.DS_Store
1518
.env.local

README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Fundamental React
2+
13
[![npm version](https://badge.fury.io/js/fundamental-react.svg)](//www.npmjs.com/package/fundamental-react)
24
[![Build Status](https://travis-ci.org/SAP/fundamental-react.svg?branch=master)](https://travis-ci.org/SAP/fundamental-react)
35
[![Coverage Status](https://coveralls.io/repos/github/SAP/fundamental-react/badge.svg?branch=master)](https://coveralls.io/github/SAP/fundamental-react?branch=master)
@@ -19,7 +21,7 @@ You will need to install [Node and Node Package Manager](https://www.npmjs.com/g
1921

2022
## Getting Started
2123

22-
For an existing react application, follow the steps bellow:
24+
For an existing react application, follow the steps below:
2325

2426
1. Install fundamental-react
2527

@@ -34,29 +36,22 @@ For an existing react application, follow the steps bellow:
3436
```
3537
3638
1. Import components as needed. See [Component Documentation](https://sap.github.io/fundamental-react/) for examples and API details.
37-
```javascript
38-
import { Alert } from 'fundamental-react/lib/Alert/Alert';
39-
```
40-
41-
or
42-
43-
```javascript
44-
import { Alert } from 'fundamental-react';
45-
```
46-
39+
```javascript
40+
import { Alert } from 'fundamental-react/lib/Alert/Alert';
41+
```
42+
or
43+
```javascript
44+
import { Alert } from 'fundamental-react';
45+
```
4746
48-
note: Importing from `lib`
49-
```javascript
50-
import { Alert } from 'fundamental-react/lib/Alert/Alert;'
51-
```
52-
is recommended. Doing so will bring in only the component you are using instead of the whole library, which will reduce your bundle size significantly.
47+
> **NOTE:** Importing from `lib` is recommended. Doing so will bring in only the component you are using instead of the whole library, which will reduce your bundle size significantly.
5348
5449
5550
## Versioning
5651
57-
The `fundamental-react` library follows [Semantic Versioning](https://semver.org/). These components strictly adhere to the [MAJOR].[MINOR].[PATCH] numbering system (also known as [BREAKING].[FEATURE].[FIX]).
52+
The `fundamental-react` library follows [Semantic Versioning](https://semver.org/). These components strictly adhere to the `[MAJOR].[MINOR].[PATCH]` numbering system (also known as `[BREAKING].[FEATURE].[FIX]`).
5853
59-
Merges to the `master` branch will be published as a prerelease. Prereleases will include an **rc** version (_e.g._ [MAJOR].[MINOR].[PATCH]-rc.[RC]).
54+
Merges to the `master` branch will be published as a prerelease. Prereleases will include an **rc** version (_e.g._ `[MAJOR].[MINOR].[PATCH]-rc.[RC]`).
6055
6156
## Known Issues
6257
@@ -68,7 +63,7 @@ If you encounter an issue or want to request a feature, you can [create an issue
6863
6964
## Contributing
7065
71-
If you want to contribute, please check the [Contribution Guidelines](./.github/CONTRIBUTING.md). Also see our [Developer Guide to Getting Started](https://github.com/SAP/fundamental-react/wiki/Developer-Guide).
66+
If you want to contribute, please check the [Contribution Guidelines](https://github.com/SAP/fundamental-react/blob/master/.github/CONTRIBUTING.md). Also see our [Developer Guide to Getting Started](https://github.com/SAP/fundamental-react/wiki/Developer-Guide).
7267
7368
## License
7469

package-lock.json

Lines changed: 67 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"fs-extra": "7.0.0",
8989
"gh-pages": "^2.0.1",
9090
"github-api": "^3.0.0",
91+
"group-array": "^0.3.3",
9192
"html-webpack-plugin": "4.0.0-alpha.2",
9293
"identity-obj-proxy": "3.0.0",
9394
"jest": "23.6.0",

scripts/build.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
4747
process.exit(1);
4848
}
4949

50+
fs.copyFile('README.md', 'src/_playground/documentation/Home/README.md', (err) => {
51+
if (err) throw err;
52+
});
53+
5054
// Process CLI arguments
5155
const argv = process.argv.slice(2);
5256
const writeStatsJson = argv.indexOf('--stats') !== -1;

scripts/start.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
4242
process.exit(1);
4343
}
4444

45+
fs.copyFile('README.md', 'src/_playground/documentation/Home/README.md', (err) => {
46+
if (err) throw err;
47+
});
48+
4549
// Tools like Cloud9 rely on this.
4650
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
4751
const HOST = process.env.HOST || '0.0.0.0';

src/_playground/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import './App.scss';
22
import '@babel/polyfill';
3-
import Routes from './Routes';
3+
import { Routes } from './Routes';
44
import React, { Component } from 'react';
55

66
class App extends Component {

src/_playground/App.scss

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,26 @@ $fd-fonts-path: '../../node_modules/fiori-fundamentals/dist/fonts/';
3131
}
3232

3333
.frDocs-Nav {
34-
list-style: none;
3534
border-top: 2px solid #dbe7f3;
3635
height: 90%;
3736
overflow: auto;
3837

38+
.frDocs-Nav__list {
39+
list-style: none;
40+
}
41+
3942
.frDocs-Nav__headers {
4043
color: #424e5a;
4144
padding: 15px 20px;
4245
display: block;
46+
font-weight: 700;
47+
font-size: 1.25rem;
4348
}
4449

4550
.frDocs-Nav__item {
4651
display: block;
4752
color: #21262c;
48-
font-size: 0.875rem;
53+
font-size: 1rem;
4954
position: relative;
5055
padding: 13px 40px;
5156
}
@@ -69,17 +74,17 @@ $fd-fonts-path: '../../node_modules/fiori-fundamentals/dist/fonts/';
6974
padding-bottom: 2rem;
7075
background-color: white;
7176
margin-right: auto;
72-
margin-left: auto;
77+
margin-left: 12px;
7378
padding-left: 1rem;
7479
padding-right: 1rem;
7580

76-
.frDocs-Content__header {
81+
.frDocs-Content__header, h1 {
7782
margin: 12px 0;
7883
margin-top: 2rem;
7984
font-size: 2.2rem;
8085
}
8186

82-
.frDocs-Content__description {
87+
.frDocs-Content__description, p {
8388
margin-bottom: 1.5rem;
8489
font-size: 1rem;
8590
font-weight: 300;
@@ -108,6 +113,35 @@ $fd-fonts-path: '../../node_modules/fiori-fundamentals/dist/fonts/';
108113
transition: background-color .25s;
109114
}
110115

116+
.frDocs-markdown {
117+
118+
ol, ul {
119+
padding-left: 2rem;
120+
}
121+
122+
pre {
123+
margin: 25px 0px;
124+
background-color: #fff !important;
125+
white-space: pre-wrap;
126+
white-space: -moz-pre-wrap;
127+
white-space: -pre-wrap;
128+
white-space: -o-pre-wrap;
129+
word-wrap: break-word;
130+
display: flex;
131+
padding: 1rem;
132+
font-size: 13px;
133+
line-height: 1.42857143;
134+
color: #333;
135+
word-break: break-all;
136+
border: 1px solid #ccc;
137+
border-radius: 4px;
138+
139+
code {
140+
display: block;
141+
}
142+
}
143+
}
144+
111145
.frDocs-Content__separator {
112146
display: block;
113147
margin: 2rem 0;

0 commit comments

Comments
 (0)