gitbook-asciidoc
Advanced tools
Comparing version 0.2.4 to 1.0.0
@@ -0,8 +1,5 @@ | ||
var htmlParser = require('gitbook-html'); | ||
var toHTML = require('./tohtml'); | ||
var toAsciidoc = require('./toasciidoc'); | ||
module.exports = { | ||
summary: require("./summary"), | ||
glossary: require("./glossary"), | ||
langs: require("./langs"), | ||
readme: require("./readme"), | ||
page: require("./page") | ||
}; | ||
module.exports = htmlParser.createParser(toHTML, toAsciidoc); |
{ | ||
"name": "gitbook-asciidoc", | ||
"version": "0.2.4", | ||
"version": "1.0.0", | ||
"homepage": "https://www.gitbook.com", | ||
@@ -8,6 +8,5 @@ "description": "Parse AsciiDoc content for gitbook", | ||
"dependencies": { | ||
"q": "^1.1.2", | ||
"lodash": "^3.2.0", | ||
"asciidoctor.js": "1.5.3-preview.1", | ||
"cheerio": "^0.19.0" | ||
"asciidoctor.js": "1.5.5-1", | ||
"gitbook-html": "1.0.0" | ||
}, | ||
@@ -18,3 +17,3 @@ "devDependencies": { | ||
"scripts": { | ||
"test": "export TESTING=true; mocha --reporter list" | ||
"test": "export TESTING=true; mocha --reporter list --bail" | ||
}, | ||
@@ -21,0 +20,0 @@ "repository": { |
@@ -7,6 +7,10 @@ var fs = require('fs'); | ||
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/GLOSSARY.adoc'), 'utf8'); | ||
var LEXED = glossary(CONTENT); | ||
describe('Glossary parsing', function () { | ||
var LEXED; | ||
describe('Glossary parsing', function () { | ||
before(function() { | ||
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/GLOSSARY.adoc'), 'utf8'); | ||
LEXED = glossary(CONTENT); | ||
}); | ||
it('should only get heading + paragraph pairs', function() { | ||
@@ -13,0 +17,0 @@ assert.equal(LEXED.length, 5); |
var assert = require("assert"); | ||
global.assertObjectsEqual = function(o1, o2) { | ||
assert.equal(JSON.stringify(o1, null, 4), JSON.stringify(o2, null, 4)); | ||
assert.equal(JSON.stringify(o1, null, 4), JSON.stringify(o2, null, 4)); | ||
}; | ||
@@ -7,6 +7,10 @@ var fs = require('fs'); | ||
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/LANGS.adoc'), 'utf8'); | ||
var LEXED = langs(CONTENT); | ||
describe('Languages parsing', function () { | ||
var LEXED; | ||
describe('Languages parsing', function () { | ||
before(function() { | ||
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/LANGS.adoc'), 'utf8'); | ||
LEXED = langs(CONTENT); | ||
}); | ||
it('should detect paths and titles', function() { | ||
@@ -13,0 +17,0 @@ assert.equal(LEXED[0].path,'en/'); |
@@ -7,17 +7,13 @@ var fs = require('fs'); | ||
function loadPage (name, options) { | ||
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/' + name + '.adoc'), 'utf8'); | ||
return page(CONTENT, options).sections; | ||
} | ||
describe('Page parsing', function() { | ||
var LEXED; | ||
var LEXED = loadPage('PAGE'); | ||
describe('Page parsing', function() { | ||
it('should detect sections', function() { | ||
assert.equal(LEXED.length, 1); | ||
before(function() { | ||
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/PAGE.adoc'), 'utf8'); | ||
LEXED = page(CONTENT); | ||
}); | ||
it('should gen content for normal sections', function() { | ||
assert(LEXED[0].content); | ||
it('should gen content', function() { | ||
assert(LEXED.content); | ||
}); | ||
}); |
@@ -7,8 +7,10 @@ var fs = require('fs'); | ||
describe('Readme parsing', function () { | ||
var LEXED; | ||
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/README.adoc'), 'utf8'); | ||
var LEXED = readme(CONTENT); | ||
before(function() { | ||
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/README.adoc'), 'utf8'); | ||
LEXED = readme(CONTENT); | ||
}); | ||
describe('Readme parsing', function () { | ||
it('should contain a title', function() { | ||
@@ -15,0 +17,0 @@ assert(LEXED.title); |
@@ -7,34 +7,44 @@ var fs = require('fs'); | ||
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/SUMMARY.adoc'), 'utf8'); | ||
var LEXED = summary(CONTENT); | ||
describe('Summary parsing', function () { | ||
var LEXED, PART; | ||
describe('Summary parsing', function () { | ||
it('should detect chapters', function() { | ||
assert.equal(LEXED.chapters.length, 5); | ||
before(function() { | ||
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/SUMMARY.adoc'), 'utf8'); | ||
LEXED = summary(CONTENT); | ||
PART = LEXED.parts[0]; | ||
// todo: add support for parts in asciidoc | ||
}); | ||
it('should detect parts', function() { | ||
assert.equal(LEXED.parts.length, 1); | ||
}); | ||
it('should detect articles', function() { | ||
assert.equal(PART.articles.length, 5); | ||
}); | ||
it('should support articles', function() { | ||
assert.equal(LEXED.chapters[0].articles.length, 2); | ||
assert.equal(LEXED.chapters[1].articles.length, 0); | ||
assert.equal(LEXED.chapters[2].articles.length, 0); | ||
assert.equal(PART.articles[0].articles.length, 2); | ||
assert.equal(PART.articles[1].articles.length, 0); | ||
assert.equal(PART.articles[2].articles.length, 0); | ||
}); | ||
it('should detect paths and titles', function() { | ||
assert(LEXED.chapters[0].path); | ||
assert(LEXED.chapters[1].path); | ||
assert(LEXED.chapters[2].path); | ||
assert(LEXED.chapters[3].path); | ||
assert.equal(LEXED.chapters[4].path, null); | ||
assert(PART.articles[0].path); | ||
assert(PART.articles[1].path); | ||
assert(PART.articles[2].path); | ||
assert(PART.articles[3].path); | ||
assert.equal(PART.articles[4].path, null); | ||
assert(LEXED.chapters[0].title); | ||
assert(LEXED.chapters[1].title); | ||
assert(LEXED.chapters[2].title); | ||
assert(LEXED.chapters[3].title); | ||
assert(LEXED.chapters[4].title); | ||
assert(PART.articles[0].title); | ||
assert(PART.articles[1].title); | ||
assert(PART.articles[2].title); | ||
assert(PART.articles[3].title); | ||
assert(PART.articles[4].title); | ||
}); | ||
it('should normalize paths from .md', function() { | ||
assert.equal(LEXED.chapters[0].path,'chapter-1/README.adoc'); | ||
assert.equal(LEXED.chapters[1].path,'chapter-2/README.adoc'); | ||
assert.equal(LEXED.chapters[2].path,'chapter-3/README.adoc'); | ||
assert.equal(PART.articles[0].path,'chapter-1/README.adoc'); | ||
assert.equal(PART.articles[1].path,'chapter-2/README.adoc'); | ||
assert.equal(PART.articles[2].path,'chapter-3/README.adoc'); | ||
}); | ||
@@ -41,0 +51,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3
0
9569
18
179
1
+ Addedgitbook-html@1.0.0
+ Addedabab@1.0.4(transitive)
+ Addedacorn@2.7.0(transitive)
+ Addedacorn-globals@1.0.9(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedasciidoctor.js@1.5.5-1(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcheerio@0.20.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcss-select@1.2.0(transitive)
+ Addedcss-what@2.1.3(transitive)
+ Addedcssom@0.3.8(transitive)
+ Addedcssstyle@0.2.37(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedescodegen@1.14.3(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedestraverse@4.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedgitbook-html@1.0.0(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjsdom@7.2.2(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addednwmatcher@1.4.4(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedopal-npm-wrapper@0.9.2(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedparse5@1.5.1(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedpsl@1.9.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsax@1.4.1(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedsymbol-tree@3.2.4(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwebidl-conversions@2.0.1(transitive)
+ Addedwhatwg-url-compat@0.6.5(transitive)
+ Addedword-wrap@1.2.5(transitive)
+ Addedxml-name-validator@2.0.1(transitive)
+ Addedxmlhttprequest@1.7.0(transitive)
- Removedcheerio@^0.19.0
- Removedq@^1.1.2
- Removedasciidoctor.js@1.5.3-preview.1(transitive)
- Removedcheerio@0.19.0(transitive)
- Removedcss-select@1.0.0(transitive)
- Removedcss-what@1.0.0(transitive)
- Removeddomutils@1.4.3(transitive)
- Removedopal-npm-wrapper@0.1.1(transitive)
- Removedxmlhttprequest@1.6.0(transitive)
Updatedasciidoctor.js@1.5.5-1