Compare commits
No commits in common. "gitea-modifications" and "master" have entirely different histories.
gitea-modi
...
master
1 changed files with 1 additions and 5 deletions
|
@ -29,8 +29,6 @@ Arguments:
|
||||||
Options:
|
Options:
|
||||||
-d --debug Print debug messages.
|
-d --debug Print debug messages.
|
||||||
|
|
||||||
-f --fragment Output HTML fragment insted of full page.
|
|
||||||
|
|
||||||
-s --style <file,...> Comma separated stylesheet(s) to embed into the output
|
-s --style <file,...> Comma separated stylesheet(s) to embed into the output
|
||||||
HTML. The stylesheet may be a path to a CSS file,
|
HTML. The stylesheet may be a path to a CSS file,
|
||||||
"@base" for the base ipynb2html style, or "@default"
|
"@base" for the base ipynb2html style, or "@default"
|
||||||
|
@ -58,7 +56,6 @@ function arrify <T> (obj: T | T[]): T[] {
|
||||||
function parseCliArgs (argv: string[]) {
|
function parseCliArgs (argv: string[]) {
|
||||||
const opts = minimist(argv, minimistOptions({
|
const opts = minimist(argv, minimistOptions({
|
||||||
debug: { alias: 'd', type: 'boolean' },
|
debug: { alias: 'd', type: 'boolean' },
|
||||||
fragment: { alias: 'f', type: 'boolean' },
|
|
||||||
style: { alias: 's', type: 'string', default: '@default' },
|
style: { alias: 's', type: 'string', default: '@default' },
|
||||||
version: { alias: 'V', type: 'boolean' },
|
version: { alias: 'V', type: 'boolean' },
|
||||||
help: { alias: 'h', type: 'boolean' },
|
help: { alias: 'h', type: 'boolean' },
|
||||||
|
@ -93,7 +90,6 @@ function parseCliArgs (argv: string[]) {
|
||||||
return {
|
return {
|
||||||
styles: arrify(opts.style).join(',').split(/,\s*/),
|
styles: arrify(opts.style).join(',').split(/,\s*/),
|
||||||
debug: opts.debug as boolean,
|
debug: opts.debug as boolean,
|
||||||
fragment: opts.fragment as boolean,
|
|
||||||
input: input === '-' ? 0 : input, // 0 = stdin
|
input: input === '-' ? 0 : input, // 0 = stdin
|
||||||
output,
|
output,
|
||||||
}
|
}
|
||||||
|
@ -120,7 +116,7 @@ export default (argv: string[]): void => {
|
||||||
const renderNotebook = ipynb2html.createRenderer(new Document())
|
const renderNotebook = ipynb2html.createRenderer(new Document())
|
||||||
const contents = renderNotebook(notebook).outerHTML
|
const contents = renderNotebook(notebook).outerHTML
|
||||||
|
|
||||||
const html = opts.fragment ? contents : renderPage({ contents, title, style })
|
const html = renderPage({ contents, title, style })
|
||||||
|
|
||||||
if (opts.output) {
|
if (opts.output) {
|
||||||
fs.writeFileSync(opts.output, html)
|
fs.writeFileSync(opts.output, html)
|
||||||
|
|
Loading…
Reference in a new issue