summaryrefslogtreecommitdiffstats
path: root/packages/gitbook/src/parse/readmeFromDocument.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gitbook/src/parse/readmeFromDocument.js')
-rw-r--r--packages/gitbook/src/parse/readmeFromDocument.js21
1 files changed, 0 insertions, 21 deletions
diff --git a/packages/gitbook/src/parse/readmeFromDocument.js b/packages/gitbook/src/parse/readmeFromDocument.js
deleted file mode 100644
index a1f67b8..0000000
--- a/packages/gitbook/src/parse/readmeFromDocument.js
+++ /dev/null
@@ -1,21 +0,0 @@
-const { BLOCKS } = require('markup-it');
-const Readme = require('../models/readme');
-
-/**
- * Parse a readme from a document.
- * @param {Document} document
- * @return {Readme} readme
- */
-function readmeFromDocument(document) {
- const { nodes } = document;
-
- const first = nodes.first();
- const second = nodes.get(1);
-
- return Readme.create({
- title: first && first.type == BLOCKS.HEADING_1 ? first.text : '',
- description: second && second.type == BLOCKS.PARAGRAPH ? second.text : ''
- });
-}
-
-module.exports = readmeFromDocument;