From 305b7d3c8e6db61ec8b59c12a1e3b6067b8ed4a6 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Sun, 2 Feb 2014 18:28:46 -0800 Subject: [PATCH] working on them docs --- buildpage.js | 24 +- docs/sheetsee-charts.md | 12 +- docs/{sheetsee.md => sheetsee-core.md} | 4 +- docs/sheetsee-maps.md | 8 +- docs/sheetsee-tables.md | 29 +- newReamde.md => new-readme.md | 16 +- site/assets/style.css | 10 +- site/docs/about.html | 37 ++- site/docs/basics.html | 35 +- site/docs/building.html | 35 +- site/docs/changelog.html | 35 +- site/docs/custom-charts.html | 35 +- site/docs/fork-n-go.html | 35 +- site/docs/index.html | 344 -------------------- site/docs/sheetsee-charts.html | 45 ++- site/docs/sheetsee-core.html | 123 +++++++ site/docs/sheetsee-maps.html | 41 ++- site/docs/sheetsee-tables.html | 58 +++- site/docs/sheetsee.html | 1 + site/docs/tips.html | 35 +- site/index.html | 425 ++++++------------------- template.hbs | 37 ++- 22 files changed, 694 insertions(+), 730 deletions(-) rename docs/{sheetsee.md => sheetsee-core.md} (96%) rename newReamde.md => new-readme.md (79%) delete mode 100644 site/docs/index.html create mode 100644 site/docs/sheetsee-core.html diff --git a/buildpage.js b/buildpage.js index ad072d0b..024a8080 100644 --- a/buildpage.js +++ b/buildpage.js @@ -12,11 +12,11 @@ cpr('./demos', './site/demos', function(err, files) { if (err) return console.log(err) }) -fs.readFile('./newReadme.md', function(err, file) { +fs.readFile('new-readme.md', function(err, file) { if (err) return console.log(err) var name = "index" var content = file.toString() - var html = marked(content) + var html = changeExtensions(marked(content)) applyTemplate(html, name) }) @@ -29,13 +29,20 @@ glob("docs/*.md", function (err, files) { var name = file.split('.md')[0] var filePath = "./docs/" var content = fs.readFileSync(filePath + file).toString() - var html = marked(content) + var html = changeExtensions(marked(content)) applyTemplate(html, name) }) }) function applyTemplate(html, name) { var content = {content: html} + if (name === "index") { + content.rootstyle = "" + content.rootdoc = "docs" + } else { + content.rootstyle = ".." + content.rootdoc = "" + } var file = "template.hbs" var rawTemplate = fs.readFileSync(file).toString() var template = hbs.compile(rawTemplate) @@ -45,7 +52,7 @@ function applyTemplate(html, name) { function writeFile(page, name) { if (name === "index") { - fs.writeFileSync('./site/' + name + '.html' , page) + return fs.writeFileSync('./site/' + name + '.html' , page) } mkdirp('./site/docs', function (err) { if (err) return console.error(err) @@ -53,3 +60,12 @@ function writeFile(page, name) { }) } +function changeExtensions(html, name) { + if (name === "index") { + html = html.replace('/\./\.\/', '') + } + var re = /.md$/ + var newHtml = html.replace(/\.md/g, '.html') + return newHtml +} + diff --git a/docs/sheetsee-charts.md b/docs/sheetsee-charts.md index 0957d2e3..7db5ee3a 100644 --- a/docs/sheetsee-charts.md +++ b/docs/sheetsee-charts.md @@ -1,14 +1,14 @@ -# sheetsee-charts +# Sheetsee-charts -Sheetsee provides three d3 chart options to use with your spreadsheet data: a bar chart, line chart and pie graph. You can also plug in your own custom d3 chart to sheetsee, read about that [here](custom-charts.md). +Sheetsee provides three d3 chart options to use with your spreadsheet data: a bar chart, line chart and pie graph. See a [demo](demos/demo-chart.html). You can also plug in your own custom d3 chart to sheetsee, read about that [here](custom-charts.md). ## Make a Chart -Sheetsee.js comes with a d3.js bar, pie and line chart. Each requires your data be an _array of objects_, formatted to contain "label" and "units" keys. See the section above on Your Data to learn about formatting. +Sheetsee.js comes with a d3.js bar, pie and line chart. Each requires your data be an _array of objects_, with objects containing "label" and "units" key/value pairs. See the section above on Your Data to learn about formatting. -You'll have to experiement with the charts to find the correct size your `
` will need to be to hold the chart with your data in it nicely. +Experiment with the charts to find the correct size your `
` will need to be to hold the chart with your data in it nicely. -You can also make your own d3 chart in a separate .js file, link to that and pass your data on to it. I'd love to see people building some other charts that will work with Sheetsee. +You can also make your own d3 chart in a separate .js file, link to that and pass your data on to it. Information [here](docs/custom-charts.md) on using your own chart. ### Bar Chart @@ -21,7 +21,7 @@ To create a bar chart you'll need to add a placeholder `
` in your HTML with In your CSS, give it dimensions. ```CSS -#barChart {height: 400px; max-width: 600px; background: #F8CDCD;} +barChart {height: 400px; max-width: 600px; background: #F8CDCD;} ``` In a `