Skip to content

Commit

Permalink
docs: Get netlify build working.
Browse files Browse the repository at this point in the history
  • Loading branch information
treshugart committed Sep 20, 2017
1 parent 76b11e1 commit 9c4bf83
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.9.0
8.4.0
14 changes: 10 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
],
"devDependencies": {
"@skatejs/bore": "4.0.0",
"@skatejs/renderer-preact": "0.0.1",
"@skatejs/ssr": "0.12.2",
"@skatejs/val": "0.3.1",
"babel-cli": "^6.26.0",
Expand All @@ -53,6 +54,7 @@
"jest-cli": "^21.0.2",
"lint-staged": "4.0.2",
"nodemon": "1.11.0",
"preact": "^8.2.5",
"rollup": "0.47.4",
"rollup-plugin-babel": "3.0.2",
"rollup-plugin-uglify": "2.0.1",
Expand Down
18 changes: 0 additions & 18 deletions rollup.config.js

This file was deleted.

22 changes: 13 additions & 9 deletions site/components/_.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
/** @jsx h */

import val from "@skatejs/val";
import hljs from "highlight.js";
import { Component, define, h as preactH, props } from "../../src";
import withPreact from '@skatejs/renderer-preact/umd';
import val from '@skatejs/val';
import hljs from 'highlight.js';
import { h as preactH } from 'preact';

const fs = require("fs");
import { define, props, withComponent } from '../..';

const fs = require('fs');

export const Component = withComponent(withPreact());
export const h = val(preactH);

function format(src) {
// For some reason we can't do this after formatting so it loses syntax
// highlighting.
src = src.replace(/</gm, "&lt;").replace(/>/gm, "&gt;");
src = src.replace(/</gm, '&lt;').replace(/>/gm, '&gt;');

// Remove leading newlines and only allow up to two newlines in code.
src = src.split("\n").filter((v, i, a) => a[i - 1] || v.trim().length);
src = src.split('\n').filter((v, i, a) => a[i - 1] || v.trim().length);

// Get the initial indent so we can remove it from subsequent lines.
const indent = src[0].match(/^\s*/)[0].length;
Expand All @@ -23,15 +27,15 @@ function format(src) {
src = src.map(s => s.substring(indent));

// Re-instate newline formatting.
return hljs.highlightAuto(src.join("\n")).value;
return hljs.highlightAuto(src.join('\n')).value;
}

export const Code = define(
class Code extends Component {
static props = {
lang: { ...props.string, ...{ default: "js" } },
lang: { ...props.string, ...{ default: 'js' } },
src: props.string,
theme: { ...props.string, ...{ default: "monokai" } }
theme: { ...props.string, ...{ default: 'monokai' } }
};
renderCallback({ lang, src, theme }) {
return (
Expand Down
4 changes: 2 additions & 2 deletions site/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx h */

import { Component, define } from "../src";
import { Code, Heading, Hero, Layout, h } from "./components/_";
import { define } from "../src";
import { Code, Component, Heading, Hero, Layout, h } from "./components/_";

export default define(
class Index extends Component {
Expand Down

0 comments on commit 9c4bf83

Please sign in to comment.