mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 15:17:23 +02:00
Add Prettier Formatting (#258)
* Add Prettier formatting to source files and example files, and check that Prettier formatting is maintained on PRs * Remove trailing-comma as we are using Node 6 on Circle * Use latest Node 6 LTS version in Circle * Remove unused test
This commit is contained in:
parent
0cead4b6f9
commit
65421db62e
50 changed files with 1376 additions and 1350 deletions
|
@ -5,14 +5,14 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require("react");
|
||||
const React = require('react');
|
||||
|
||||
const CompLibrary = require("../../core/CompLibrary.js");
|
||||
const CompLibrary = require('../../core/CompLibrary.js');
|
||||
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
|
||||
const Container = CompLibrary.Container;
|
||||
const GridBlock = CompLibrary.GridBlock;
|
||||
|
||||
const siteConfig = require(process.cwd() + "/siteConfig.js");
|
||||
const siteConfig = require(process.cwd() + '/siteConfig.js');
|
||||
|
||||
class Button extends React.Component {
|
||||
render() {
|
||||
|
@ -27,7 +27,7 @@ class Button extends React.Component {
|
|||
}
|
||||
|
||||
Button.defaultProps = {
|
||||
target: "_self"
|
||||
target: '_self',
|
||||
};
|
||||
|
||||
class HomeSplash extends React.Component {
|
||||
|
@ -37,14 +37,12 @@ class HomeSplash extends React.Component {
|
|||
<div className="homeSplashFade">
|
||||
<div className="wrapper homeWrapper">
|
||||
<div className="projectLogo">
|
||||
<img src={siteConfig.baseUrl + "img/docusaurus.svg"} />
|
||||
<img src={siteConfig.baseUrl + 'img/docusaurus.svg'} />
|
||||
</div>
|
||||
<div className="inner">
|
||||
<h2 className="projectTitle">
|
||||
{siteConfig.title}
|
||||
<small>
|
||||
{siteConfig.tagline}
|
||||
</small>
|
||||
<small>{siteConfig.tagline}</small>
|
||||
</h2>
|
||||
<div className="section promoSection">
|
||||
<div className="promoRow">
|
||||
|
@ -53,21 +51,19 @@ class HomeSplash extends React.Component {
|
|||
<Button
|
||||
href={
|
||||
siteConfig.baseUrl +
|
||||
"docs/" +
|
||||
'docs/' +
|
||||
this.props.language +
|
||||
"/doc1.html"
|
||||
}
|
||||
>
|
||||
'/doc1.html'
|
||||
}>
|
||||
Example Link
|
||||
</Button>
|
||||
<Button
|
||||
href={
|
||||
siteConfig.baseUrl +
|
||||
"docs/" +
|
||||
'docs/' +
|
||||
this.props.language +
|
||||
"/doc2.html"
|
||||
}
|
||||
>
|
||||
'/doc2.html'
|
||||
}>
|
||||
Example Link 2
|
||||
</Button>
|
||||
</div>
|
||||
|
@ -83,7 +79,7 @@ class HomeSplash extends React.Component {
|
|||
|
||||
class Index extends React.Component {
|
||||
render() {
|
||||
let language = this.props.language || "en";
|
||||
let language = this.props.language || 'en';
|
||||
const showcase = siteConfig.users
|
||||
.filter(user => {
|
||||
return user.pinned;
|
||||
|
@ -100,22 +96,22 @@ class Index extends React.Component {
|
|||
<div>
|
||||
<HomeSplash language={language} />
|
||||
<div className="mainContainer">
|
||||
<Container padding={["bottom", "top"]}>
|
||||
<Container padding={['bottom', 'top']}>
|
||||
<GridBlock
|
||||
align="center"
|
||||
contents={[
|
||||
{
|
||||
content: "This is the content of my feature",
|
||||
image: siteConfig.baseUrl + "img/docusaurus.svg",
|
||||
imageAlign: "top",
|
||||
title: "Feature One"
|
||||
content: 'This is the content of my feature',
|
||||
image: siteConfig.baseUrl + 'img/docusaurus.svg',
|
||||
imageAlign: 'top',
|
||||
title: 'Feature One',
|
||||
},
|
||||
{
|
||||
content: "The content of my second feature",
|
||||
image: siteConfig.baseUrl + "img/docusaurus.svg",
|
||||
imageAlign: "top",
|
||||
title: "Feature Two"
|
||||
}
|
||||
content: 'The content of my second feature',
|
||||
image: siteConfig.baseUrl + 'img/docusaurus.svg',
|
||||
imageAlign: 'top',
|
||||
title: 'Feature Two',
|
||||
},
|
||||
]}
|
||||
layout="fourColumn"
|
||||
/>
|
||||
|
@ -123,67 +119,61 @@ class Index extends React.Component {
|
|||
|
||||
<div
|
||||
className="productShowcaseSection paddingBottom"
|
||||
style={{ textAlign: "center" }}
|
||||
>
|
||||
style={{textAlign: 'center'}}>
|
||||
<h2>Feature Callout</h2>
|
||||
<MarkdownBlock>These are features of this project</MarkdownBlock>
|
||||
</div>
|
||||
|
||||
<Container padding={["bottom", "top"]} background="light">
|
||||
<Container padding={['bottom', 'top']} background="light">
|
||||
<GridBlock
|
||||
contents={[
|
||||
{
|
||||
content: "Talk about learning how to use this",
|
||||
image: siteConfig.baseUrl + "img/docusaurus.svg",
|
||||
imageAlign: "right",
|
||||
title: "Learn How"
|
||||
}
|
||||
content: 'Talk about learning how to use this',
|
||||
image: siteConfig.baseUrl + 'img/docusaurus.svg',
|
||||
imageAlign: 'right',
|
||||
title: 'Learn How',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Container>
|
||||
|
||||
<Container padding={["bottom", "top"]} id="try">
|
||||
<Container padding={['bottom', 'top']} id="try">
|
||||
<GridBlock
|
||||
contents={[
|
||||
{
|
||||
content: "Talk about trying this out",
|
||||
image: siteConfig.baseUrl + "img/docusaurus.svg",
|
||||
imageAlign: "left",
|
||||
title: "Try it Out"
|
||||
}
|
||||
content: 'Talk about trying this out',
|
||||
image: siteConfig.baseUrl + 'img/docusaurus.svg',
|
||||
imageAlign: 'left',
|
||||
title: 'Try it Out',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Container>
|
||||
|
||||
<Container padding={["bottom", "top"]} background="dark">
|
||||
<Container padding={['bottom', 'top']} background="dark">
|
||||
<GridBlock
|
||||
contents={[
|
||||
{
|
||||
content:
|
||||
"This is another description of how this project is useful",
|
||||
image: siteConfig.baseUrl + "img/docusaurus.svg",
|
||||
imageAlign: "right",
|
||||
title: "Description"
|
||||
}
|
||||
'This is another description of how this project is useful',
|
||||
image: siteConfig.baseUrl + 'img/docusaurus.svg',
|
||||
imageAlign: 'right',
|
||||
title: 'Description',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Container>
|
||||
|
||||
<div className="productShowcaseSection paddingBottom">
|
||||
<h2>
|
||||
{"Who's Using This?"}
|
||||
</h2>
|
||||
<h2>{"Who's Using This?"}</h2>
|
||||
<p>This project is used by all these people</p>
|
||||
<div className="logos">
|
||||
{showcase}
|
||||
</div>
|
||||
<div className="logos">{showcase}</div>
|
||||
<div className="more-users">
|
||||
<a
|
||||
className="button"
|
||||
href={
|
||||
siteConfig.baseUrl + this.props.language + "/" + "users.html"
|
||||
}
|
||||
>
|
||||
siteConfig.baseUrl + this.props.language + '/' + 'users.html'
|
||||
}>
|
||||
More {siteConfig.title} Users
|
||||
</a>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue