summaryrefslogtreecommitdiffstats
path: root/lib/generators
diff options
context:
space:
mode:
Diffstat (limited to 'lib/generators')
-rw-r--r--lib/generators/base.js29
-rw-r--r--lib/generators/index.js10
-rw-r--r--lib/generators/json.js47
-rw-r--r--lib/generators/website/index.js22
-rw-r--r--lib/generators/website/theme.js6
5 files changed, 0 insertions, 114 deletions
diff --git a/lib/generators/base.js b/lib/generators/base.js
deleted file mode 100644
index 0fc0be9..0000000
--- a/lib/generators/base.js
+++ /dev/null
@@ -1,29 +0,0 @@
-
-function Generator(output, type) {
- this.output = output;
- this.book = output.book;
- this.type = type;
-}
-
-// Prepare the generation
-Generator.prototype.prepare = function() {
-
-};
-
-// Copy an asset file (non-parsable), ex: images, etc
-Generator.prototype.writeAsset = function(filename) {
-
-};
-
-// Write a page (parsable file), ex: markdown, etc
-Generator.prototype.writePage = function(page) {
-
-};
-
-// Finish the generation
-Generator.prototype.finish = function() {
-
-};
-
-
-module.exports = Generator;
diff --git a/lib/generators/index.js b/lib/generators/index.js
deleted file mode 100644
index dcb2ffe..0000000
--- a/lib/generators/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-var _ = require('lodash');
-//var EbookGenerator = require('./ebook');
-
-module.exports = {
- json: require('./json'),
- /*website: require('./website'),
- pdf: _.partialRight(EbookGenerator, 'pdf'),
- mobi: _.partialRight(EbookGenerator, 'mobi'),
- epub: _.partialRight(EbookGenerator, 'epub')*/
-};
diff --git a/lib/generators/json.js b/lib/generators/json.js
deleted file mode 100644
index 5ba2d16..0000000
--- a/lib/generators/json.js
+++ /dev/null
@@ -1,47 +0,0 @@
-var util = require('util');
-var Generator = require('./base');
-var gitbook = require('../gitbook');
-
-function JSONGenerator() {
- Generator.apply(this, arguments);
-}
-util.inherits(JSONGenerator, Generator);
-
-// Write a page (parsable file)
-JSONGenerator.prototype.writePage = function(page) {
- var that = this;
-
- // Parse the page
- return page.parse()
-
- // Write as json
- .then(function() {
- var json = {
- gitbook: {
- version: gitbook.version
- },
- path: page.path,
- sections: page.content
- };
-
- return that.output.writeFile(
- page.withExtension('.json'),
- JSON.stringify(json, null, 4)
- );
- });
-};
-
-// At the end of generation, generate README.json for multilingual books
-JSONGenerator.prototype.finish = function() {
- if (!this.book.isMultilingual()) return;
-
- // Copy README.json from main book
- var mainLanguage = this.book.langs.getDefault().id;
- return this.output.copyFile(
- this.output.resolve(mainLanguage, 'README.json'),
- 'README.json'
- );
-};
-
-
-module.exports = JSONGenerator;
diff --git a/lib/generators/website/index.js b/lib/generators/website/index.js
deleted file mode 100644
index 67c80b6..0000000
--- a/lib/generators/website/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-var util = require('util');
-var Generator = require('../base');
-
-function WebsiteGenerator() {
- Generator.apply(this, arguments);
-}
-util.inherits(WebsiteGenerator, Generator);
-
-// Copy an asset file
-WebsiteGenerator.prototype.writeAsset = function(filename) {
- return this.output.copyFile(
- this.book.resolve(filename),
- filename
- );
-};
-
-// Write a page (parsable file)
-WebsiteGenerator.prototype.writePage = function(page) {
-
-};
-
-module.exports = WebsiteGenerator;
diff --git a/lib/generators/website/theme.js b/lib/generators/website/theme.js
deleted file mode 100644
index 1cc2891..0000000
--- a/lib/generators/website/theme.js
+++ /dev/null
@@ -1,6 +0,0 @@
-
-function Theme() {
-
-}
-
-module.exports = Theme;