Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve the docs for V5 launch #5820

Merged
merged 25 commits into from
Mar 9, 2019
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9d7c28d
MOVE guides to /guides/ && update them with more concise information
ndelangen Mar 2, 2019
91be9e8
IMPROVE webpack docs
ndelangen Mar 4, 2019
50a8670
IMPROVE default config docs
ndelangen Mar 4, 2019
d173ec5
IMPROVE cli docs
ndelangen Mar 4, 2019
0dbf67c
IMPROVE theming docs
ndelangen Mar 4, 2019
793c8ff
IMPROVE docs for standalone
ndelangen Mar 4, 2019
dc9d97a
IMMPROVE the writing stories docs
ndelangen Mar 4, 2019
ace908a
Merge branch 'next' into tech/improve-docs
ndelangen Mar 5, 2019
2111fbe
SYNC header from new site
ndelangen Mar 5, 2019
ab8aaca
IMPROVE documentation on theming (REMOVE the advanced section) & ADD …
ndelangen Mar 5, 2019
63aad4d
FIX linting
ndelangen Mar 5, 2019
77f15f2
Merge branch 'next' into tech/improve-docs
ndelangen Mar 5, 2019
5d85fd5
Merge branch 'next' into tech/improve-docs
ndelangen Mar 6, 2019
c603cfb
REMOVE unneeded dependencies
ndelangen Mar 6, 2019
49915f3
FIX missing dependency
ndelangen Mar 6, 2019
f4b6417
ADD search to all pages
ndelangen Mar 6, 2019
ab55972
ADD back port to official example
ndelangen Mar 7, 2019
ee9b056
Merge branch 'next' into tech/improve-docs
ndelangen Mar 7, 2019
de6fffc
DELETE snyk, is just slowing down, and it's our docs site, not someth…
ndelangen Mar 7, 2019
a751468
FIX lockfile
ndelangen Mar 7, 2019
3445549
Merge branch 'next' into tech/improve-docs
ndelangen Mar 7, 2019
bc5f355
FIX logo not navigating
ndelangen Mar 7, 2019
7ea689c
FIX incoreect semicolumns
ndelangen Mar 7, 2019
132daaf
Merge branch 'next' into tech/improve-docs
ndelangen Mar 8, 2019
a5ae822
Document redirects
shilman Mar 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions docs/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ module.exports = {
docSections: {
basics: [
'/basics/introduction/',
'/basics/quick-start-guide/',
'/basics/slow-start-guide/',
'/basics/guide-react/',
'/basics/guide-react-native/',
'/basics/guide-vue/',
'/basics/guide-angular/',
'/basics/guide-mithril/',
'/basics/guide-ember/',
'/basics/writing-stories/',
'/basics/exporting-storybook/',
'/basics/faq/',
'/basics/live-examples/',
],
guides: [
'/guides/quick-start-guide/',
'/guides/slow-start-guide/',
'/guides/guide-react/',
'/guides/guide-react-native/',
'/guides/guide-vue/',
'/guides/guide-angular/',
'/guides/guide-mithril/',
'/guides/guide-ember/',
'/guides/guide-riot/',
],
configurations: [
'/configurations/options-parameter/',
'/configurations/default-config/',
Expand Down
20 changes: 11 additions & 9 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
"build-storybook": "build-storybook",
"dev": "gatsby develop",
"serve": "gatsby serve",
"storybook": "start-storybook -p 9009 -s src/pages",
"snyk-protect": "snyk protect",
"prepare": "npm run snyk-protect"
"storybook": "start-storybook -p 9009 -s src/pages"
},
"dependencies": {
"@storybook/addon-actions": "5.0.0-rc.1",
Expand All @@ -28,7 +26,7 @@
"common-tags": "^1.8.0",
"gatsby": "^1.9.279",
"gatsby-link": "^1.6.45",
"gatsby-plugin-sharp": "^2.0.12",
"gatsby-plugin-sharp": "^1.6.48",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ndelangen why downgrade?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some issues, I think the gatsby-plugin-sharp v2 is for gatsby v2

"gatsby-remark-autolink-headers": "^1.4.19",
"gatsby-remark-copy-linked-files": "^1.5.37",
"gatsby-remark-images": "^1.5.67",
Expand All @@ -37,17 +35,21 @@
"gatsby-transformer-remark": "^1.7.44",
"global": "^4.3.2",
"highlight.js": "^9.14.2",
"is-builtin-module": "^3.0.0",
"lodash": "^4.17.11",
"marked": "^0.5.2",
"polished": "^3.0.3",
"prop-types": "^15.7.2",
"react": "^15.6.2",
"react": "^16.8.3",
"react-document-title": "^2.0.3",
"react-dom": "^15.6.2",
"react-dom": "^16.8.3",
"react-helmet": "^5.2.0",
"react-popper-tooltip": "^2.8.1",
"react-router": "^4.3.1",
"react-stack-grid": "^0.7.1",
"recompose": "^0.30.0",
"sitemap": "^2.1.0",
"snyk": "^1.134.2"
},
"snyk": true
"styled-components": "^4.1.3",
"validatorjs": "^3.15.1"
}
}
33 changes: 30 additions & 3 deletions docs/src/components/Docs/Container/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { window } from 'global';
import PropTypes from 'prop-types';
import React from 'react';
import React, { Component } from 'react';
import Nav from '../Nav';
import NavDropdown from '../Nav/dropdown';
import Content from '../Content';
Expand All @@ -12,9 +13,33 @@ const getEditUrl = (selectedSectionId, selectedItemId) => {
return `${gitHubRepoUrl}/blob/master/docs/src/pages/${docPath}/index.md`;
};

class Search extends Component {
componentDidMount() {
window.docsearch({
apiKey: 'a4f7f972f1d8f99a66e237e7fd2e489f',
indexName: 'storybook-js',
inputSelector: '#search',
debug: false,
});
}

render() {
return (
<div className="search">
<input
className="form-control form-control-sm"
type="search"
id="search"
placeholder="type to search"
/>
</div>
);
}
}

const Container = ({ sections, selectedItem, selectedSectionId, selectedItemId }) => (
<div id="docs-container" className="row">
<div className="nav col-sm-3 col-md-3 hidden-xs">
<div className="nav col-lg-3 col-md-3 d-none d-md-block">
<Nav
sections={sections}
selectedSection={selectedItem.section}
Expand All @@ -23,7 +48,7 @@ const Container = ({ sections, selectedItem, selectedSectionId, selectedItemId }
selectedItemId={selectedItemId}
/>
</div>
<div className="content col-xs-12 col-sm-9 col-md-9 col-lg-9">
<div className="content col-xs-12 col-sm-12 col-md-9 col-lg-9">
<div className="nav-dropdown">
<NavDropdown
sections={sections}
Expand All @@ -32,6 +57,8 @@ const Container = ({ sections, selectedItem, selectedSectionId, selectedItemId }
/>
</div>

<Search />

<Content
title={selectedItem.title}
content={selectedItem.content}
Expand Down
13 changes: 9 additions & 4 deletions docs/src/components/Docs/Container/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
}

@media only screen and (max-width: 998px) {
#docs-container .nav {
display: none;
}

#docs-container .content {
border-left: none;
margin: 15px 0;
Expand All @@ -57,3 +53,12 @@
display: block;
}
}

.search {
@media only screen and (min-width: 998px) {
position: absolute;
top: 10px;
right: 0;
width: 400px;
}
}
2 changes: 1 addition & 1 deletion docs/src/components/Docs/Content/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#docs-content .markdown h3 {
font-size: 18px;
margin: 30px 0 10px 0;
font-weight: 800;
font-weight: 500;
}

#docs-content .markdown a,
Expand Down
12 changes: 10 additions & 2 deletions docs/src/components/Docs/Nav/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,21 @@ class Nav extends React.Component {
) : (
<div>
<div>
<select value={selectedSectionId} onChange={event => this.handleHeadingChange(event)}>
<select
className="custom-select custom-select-sm"
value={selectedSectionId}
onChange={event => this.handleHeadingChange(event)}
>
{sections.map(section => this.renderHeadingOpts(section))}
</select>
</div>

<div>
<select value={selectedItemId} onChange={event => this.handleNavChange(event)}>
<select
className="custom-select custom-select-sm"
value={selectedItemId}
onChange={event => this.handleNavChange(event)}
>
{navs.map(nav => this.renderNavOpts(nav))}
</select>
</div>
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';

import Header from '../Header';
// import Header from '../Header';
import Header from '../../new-components/layout/Header';
import Container from './Container';
import Footer from '../Footer';
import './style.css';
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/Homepage/MainLinks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ class MainLinks extends React.Component {
</Link>
<ul>
<li>
<Link to="/basics/quick-start-guide/">Quick setup</Link>
<Link to="/guides/quick-start-guide/">Quick setup</Link>
</li>
<li>
<Link to="/basics/slow-start-guide/">Adding to existing project</Link>
<Link to="/guides/slow-start-guide/">Adding to existing project</Link>
</li>
<li>
<Link to="/basics/writing-stories/">Writing stories</Link>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/css/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,800';
/* @import 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,800';

body, div, p, ul, li, a {
font-family: 'Open Sans', sans-serif;
Expand All @@ -16,6 +16,6 @@ a:focus {

a:hover {
opacity: 0.7;
}
} */

.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}
28 changes: 28 additions & 0 deletions docs/src/new-components/basics/Icon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { color } from './shared/styles';
import icons from './shared/icons';

const Svg = styled.svg`
display: inline-block;
vertical-align: middle;
`;

const Path = styled.path`
fill: ${color.darkest};
`;

function Icon({ icon, ...props }) {
return (
<Svg viewBox="0 0 1024 1024" width="20px" height="20px" {...props}>
<Path d={icons[icon]} />
</Svg>
);
}

Icon.propTypes = {
icon: PropTypes.string.isRequired,
};

export default Icon;
Loading