Skip to content
Browse files

more improvements

  • Loading branch information...
1 parent 51bd6ae commit 0581ac2278364d82042035725ff0328cc829cd48 @hallaathrad hallaathrad committed
Showing with 76 additions and 93 deletions.
  1. +1 −1 .babelrc
  2. +17 −0 .eslintrc
  3. +39 −0 .travis.yml
  4. +2 −1 create_structure.js
  5. +1 −0 css/gatsby.css
  6. +0 −41 html.js
  7. +12 −11 package.json
  8. +2 −4 templates/_template.jsx
  9. +2 −10 templates/lang/_template.jsx
  10. +0 −25 utils/typography.js
View
2 .babelrc
@@ -1,3 +1,3 @@
{
- "stage": 0
+ "stage": 2
}
View
17 .eslintrc
@@ -0,0 +1,17 @@
+{
+ "extends": "eslint-config-airbnb",
+ "rules": {
+ "indent": [2, 2, {"SwitchCase": 1}],
+ "no-console": [0],
+ "func-names": [0],
+ "semi": [2, "never"],
+ "no-extra-semi": [2],
+ "space-before-function-paren": [2, "always"],
+ "no-else-return": [0],
+ "space-infix-ops": [0],
+ "react/prefer-es6-class": [0],
+ },
+ "globals": {
+ "__PREFIX_LINKS__": true,
+ },
+}
View
39 .travis.yml
@@ -0,0 +1,39 @@
+# back to language cpp to try to bypass osx node failure
+language: cpp
+sudo: false
+env:
+ - export NODE_VERSION="0.10"
+ - export NODE_VERSION="0.12"
+ - export NODE_VERSION="4"
+ - export NODE_VERSION="5"
+os:
+ - linux
+ - osx
+# pre-install to bring in the correct version of node via nvm
+before_install:
+ - git submodule update --init --recursive
+ - git clone https://github.com/creationix/nvm.git ./.nvm
+ - source ./.nvm/nvm.sh
+ - nvm install $NODE_VERSION
+ - nvm use $NODE_VERSION
+ - npm config set python `which python`
+ - if [ $TRAVIS_OS_NAME == "linux" ]; then
+ export CC="gcc-4.8";
+ export CXX="g++-4.8";
+ export LINK="gcc-4.8";
+ export LINKXX="g++-4.8";
+ fi
+ - gcc --version
+ - g++ --version
+# node 4 depends on gcc 4.8
+addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ packages:
+ - g++-4.8
+ - gcc-4.8
+# script needed to test, because defaults don't work on osx
+script:
+ - npm install
+ - npm run lint
View
3 create_structure.js
@@ -52,7 +52,7 @@ fs.readdir('./wiki-master', function (err, files) {
});
// Get non-english files
- var extra = folderList.reduce((thisList, langSubFolder) => {
+ var nonEnglishFileList = folderList.reduce((thisList, langSubFolder) => {
var langDir = langSubFolder.match(/^\w{2}/)[0] + '/',
langFiles = fs.readdirSync('./wiki-master/' + langSubFolder);
@@ -92,6 +92,7 @@ fs.readdir('./wiki-master', function (err, files) {
// Create folders and copy *.md files
createFolders(fileList);
+ createFolders(nonEnglishFileList);
// Copy language templates and templates files to each language
try {
View
1 css/gatsby.css
@@ -22,6 +22,7 @@ body,html {
}
a{
text-decoration: none;
+ color:#006400;
}
a:hover {
text-decoration: underline;
View
41 html.js
@@ -2,8 +2,6 @@ import React from 'react';
import DocumentTitle from 'react-document-title';
import { link } from 'gatsby-helpers';
-import typography from './utils/typography';
-const { TypographyStyle } = typography;
module.exports = React.createClass({
propTypes () {
@@ -30,45 +28,6 @@ module.exports = React.createClass({
<meta name='viewport' content='user-scalable=no width=device-width, initial-scale=1.0 maximum-scale=1.0'/>
<title>{title}</title>
<link rel="shortcut icon" href={this.props.favicon}/>
- <TypographyStyle/>
- <style dangerouslySetInnerHTML={{__html:
- `
- a {
- color: #006400;
- }
- pre {
- background: #fff;
- padding: 1.5rem;
- }
- .demo1-ball {
- border-radius: 99px;
- background-color: white;
- width: 50px;
- height: 50px;
- border: 3px solid white;
- position: absolute;
- background-size: 50px;
- }
- .ball-0 {
- background-image: url(${link("/some-react-code/0.jpg")});
- }
- .ball-1 {
- background-image: url(${link("/some-react-code/1.jpg")});
- }
- .ball-2 {
- background-image: url(${link("/some-react-code/2.jpg")});
- }
- .ball-3 {
- background-image: url(${link("/some-react-code/3.jpg")});
- }
- .ball-4 {
- background-image: url(${link("/some-react-code/4.jpg")});
- }
- .ball-5 {
- background-image: url(${link("/some-react-code/5.jpg")});
- }
- `
- }} />
</head>
<body className="landing-page">
<div id="react-mount" dangerouslySetInnerHTML={{__html: this.props.body}} />
View
23 package.json
@@ -2,9 +2,10 @@
"name": "wiki-generator",
"version": "1.0.0",
"description": "Wiki Pages Generator for Free Code Camp",
- "main": "index.js",
+ "main": "n/a",
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "test": "echo \"Error: no test specified\" && exit 1",
+ "lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public ."
},
"repository": {
"type": "git",
@@ -17,25 +18,25 @@
"homepage": "https://github.com/FreeCodeCamp/wiki-generator#readme",
"license": "(BSD-3-Clause AND CC-BY-SA-4.0)",
"dependencies": {
- "chroma-js": "0.7.2",
- "color-pairs-picker": "^1.3.5",
+ "babel-plugin-react-transform": "^1.1.1",
"fs-extra": "^0.26.5",
"lodash": "^4.5.1",
- "mkdirp": "^0.5.1",
- "promise": "^7.0.4",
+ "mkdirp": "^0.5.1",
+ "promise": "^7.0.4",
"react": "^0.14.7",
"react-document-title": "^2.0.1",
"react-dom": "^0.14.7",
"react-motion": "^0.1.0",
"react-responsive-grid": "^0.3.1",
"react-router": "^2.0.0",
- "typography": "^0.7.0",
+ "react-transform-catch-errors": "^1.0.2",
+ "react-transform-hmr": "^1.0.2",
+ "redbox-react": "^1.2.2",
"underscore.string": "^3.2.2"
},
"devDependencies": {
- "babel-plugin-react-transform": "^1.1.1",
- "react-transform-catch-errors": "^1.0.2",
- "react-transform-hmr": "^1.0.2",
- "redbox-react": "^1.2.2"
+ "eslint": "^1.10.3",
+ "eslint-config-airbnb": "^5.0.1",
+ "eslint-plugin-react": "^3.16.1"
}
}
View
6 templates/_template.jsx
@@ -1,10 +1,8 @@
import React from 'react';
import { Link, State, Navigation } from 'react-router';
-import { Container, Grid, Breakpoint, Span } from 'react-responsive-grid';
-import colorPairsPicker from 'color-pairs-picker';
-import chroma from 'chroma-js';
+import { Breakpoint } from 'react-responsive-grid';
import includes from 'underscore.string/include';
-import { link, templateChildrenPages } from 'gatsby-helpers';
+import { link } from 'gatsby-helpers';
// Style code
import 'css/github.css';
View
12 templates/lang/_template.jsx
@@ -1,12 +1,10 @@
import React from 'react';
import { Link, State, Navigation } from 'react-router';
-import { Container, Grid, Breakpoint, Span } from 'react-responsive-grid';
+import { Breakpoint } from 'react-responsive-grid';
import find from 'lodash/find';
import { link } from 'gatsby-helpers';
import pageList from './_pages.yaml';
-import typography from 'utils/typography';
-
// Style code
import 'css/github.css';
import 'css/gatsby.css';
@@ -42,7 +40,7 @@ module.exports = React.createClass({
order: page.data.order,
path: page.path,
}
- }).sort((a,b) => { return a.order - b.order });
+ }).sort((a,b) => a.title.localeCompare(b.title));
const docOptions = childPages.map((child) =>
<option
key={link(child.path)}
@@ -66,15 +64,9 @@ module.exports = React.createClass({
return (
<li
key={child.path}
- style={{
- marginBottom: rhythm(1/2),
- }}
>
<Link
to={link(child.path)}
- style={{
- textDecoration: 'none',
- }}
>
{isActive ? <strong>{child.title}</strong> : child.title }
</Link>
View
25 utils/typography.js
@@ -1,25 +0,0 @@
-import Typography from 'typography';
-
-const options = {
- baseFontSize: '16px',
- baseLineHeight: '24px',
- bodyFontFamily: '"Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif',
- headerFontFamily: '"Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif',
- bodyWeight: 300,
- headerWeight: 600,
- boldWeight: 600,
- modularScales: [
- {
- "scale": "minor third"
- }
- ]
-}
-
-const typography = new Typography(options)
-
-// Hot reload typography in development.
-if (process.env.NODE_ENV !== "production") {
- typography.injectStyles()
-}
-
-export default typography

0 comments on commit 0581ac2

Please sign in to comment.
Something went wrong with that request. Please try again.