import spawnPandoc from "./spawn-pandoc" ; import { shell } from "electron" ; export default function pdf ( path ) { const pdfPath = path . replace ( /\.md/ , '.pdf' ) ; const additional = `--pdf-engine=xelatex -V -VCJKoptions=BoldFont="Hei" -VCJKmainfont="Hei"` ; spawnPandoc ( `-s ${ path } -o ${ pdfPath } ${ additional }` , { } , ( err , stdout , stdrr ) => { if ( err ) { console . error ( err ) ; return ; } console . info ( stdout ) ; console . info ( stdrr ) ; shell . openPath ( pdfPath ) . then ( ( ) => { } ) ; return stdout . trim ( ) ; } ) ; }