def main(filein, fileout, verbose=True): text = tools.readFile(filein, verbose) if verbose: print('# <markdown2zim>: Converting to zim...') newtext = Zim2Markdown(file=filein).convert(text) tools.saveFile(fileout, newtext, verbose) return
def main(filein,fileout,verbose=True): text=tools.readFile(filein,verbose) if verbose: print('# <markdown2zim>: Converting to zim...') newtext=Markdown2Zim().convert(text) tools.saveFile(fileout,newtext,verbose) return
def main(filein,fileout,tag,syntax='markdown',verbose=True): '''Extract tagged texts from file. filein ''' text=tools.readFile(filein,verbose) if verbose: print('# <tagextract>: Extracting tagged lines...') tagfinder=TagFinder(syntax) newtext=tagfinder.extractTag(text,tag) headersym='# ' if syntax=='markdown' else '=====' header='Summary of tag: %s' %tag header='%s %s %s' %(headersym, header, headersym) newtext=header+'\n\n'+newtext tools.saveFile(fileout,newtext,verbose) return