pixiv2html
v2.0.0
Published
Converts markuped text of pixiv novel into HTML.
Downloads
2
Maintainers
Readme
pixiv2html
Converts markuped text of pixiv novel into HTML.
Install
npm install pixiv2html
Usage
const pixiv2html = require('pixiv2html');
pixiv2html('[chapter: foo]'); //=> ['<h1>foo</h1>']
pixiv2html(`pixiv
is
[newpage]
awesome`); //=> ['<p>pixiv</p><br><p>is</p>', '<p>awesome</p>']
pixiv2html('[chapter: <bar>]', {
transforms: {
chapter: title => `<h4>${title}</h4>`
},
}); //=> ['<h4><bar></h4>']
API
This API exposes a single function such as pixiv2html = require('pixiv2html')
.
pixiv2html(text[, options])
text
: [string] Input text markuped with pixiv novel styleoptions
: [object]options.transforms
: [object] Hash of functions to customize the output of tag conversionoptions.transforms.chapter
: [function(title)]options.transforms.pixivimage
: [function(illustID, pageNumber)]options.transforms.jump
: [function(pageNumber)]
options.type
: [string] String to switch the output to'html'
or'xhtml'
. Defaults to'html'
.
- return: [string[]] Array of pages of converted HTML