Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7de6435
commit bb46626
Showing
5 changed files
with
29 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import { parse, join } from 'path'; | ||
import { Config } from './config'; | ||
import { parse, resolve } from 'path'; | ||
|
||
/** | ||
* Derive the output file path from the source markdown file. | ||
* Derive the output file path from a source file. | ||
*/ | ||
export const getOutputFilePath = (mdFilePath: string, config: Partial<Config>) => { | ||
export const getOutputFilePath = (mdFilePath: string, extension: 'html' | 'pdf') => { | ||
const { dir, name } = parse(mdFilePath); | ||
const extension = config.as_html ? 'html' : 'pdf'; | ||
|
||
return join(dir, `${name}.${extension}`); | ||
return resolve(dir, `${name}.${extension}`); | ||
}; |
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