-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixes: import this package in Typescript
- Loading branch information
Showing
16 changed files
with
56 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env node | ||
import commander from 'commander' | ||
import fs from 'fs' | ||
import { Converter } from './converter' | ||
|
||
commander.program.version('0.0.12', '-v, --version', 'output the current version') | ||
commander.program | ||
.requiredOption('-s, --source <files_or_dirs...>', 'specify the input markdown files or directories') | ||
.addOption(new commander.Option('-d, --destination <path>', 'specify the output directory').default('./output', './output')) | ||
.addOption(new commander.Option('-l, --layout <html_file>', 'specify the layout file').default('', '""')) | ||
.addOption(new commander.Option('-b, --hardBreak', 'use hard break instead of soft break')) | ||
.parse(process.argv) | ||
|
||
const options = commander.program.opts() | ||
|
||
const dest: string = options.destination === '' ? './output' : options.destination | ||
const layout: string | null = options.layout !== '' ? fs.readFileSync(options.layout, { encoding: 'utf-8' }) : null | ||
const hardBreak: boolean = options.hardBreak | ||
|
||
const converter = new Converter(layout, hardBreak) | ||
|
||
converter.convertFiles(options.source, dest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1 @@ | ||
#!/usr/bin/env node | ||
import commander from 'commander' | ||
import fs from 'fs' | ||
import { Convert } from './converter' | ||
|
||
commander.program.version('0.0.11', '-v, --version', 'output the current version') | ||
commander.program | ||
.requiredOption('-s, --source <files_or_dirs...>', 'specify the input markdown files or directories') | ||
.addOption(new commander.Option('-d, --destination <path>', 'specify the output directory').default('./output', './output')) | ||
.addOption(new commander.Option('-l, --layout <html_file>', 'specify the layout file').default('', '""')) | ||
.addOption(new commander.Option('-b, --hardBreak', 'use hard break instead of soft break')) | ||
.parse(process.argv) | ||
|
||
const options = commander.program.opts() | ||
|
||
const dest: string = options.destination === '' ? './output' : options.destination | ||
const layout: string | null = options.layout !== '' ? fs.readFileSync(options.layout, { encoding: 'utf-8' }) : null | ||
const hardBreak: boolean = options.hardBreak | ||
|
||
const converter = new Convert(layout, hardBreak) | ||
|
||
converter.convertFiles(options.source, dest) | ||
export {Converter} from './converter' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters