Created
July 28, 2014 12:56
-
-
Save percursoaleatorio/6925a51440bae7bb509d to your computer and use it in GitHub Desktop.
Convert from docx to restructured text
This file contains hidden or 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
@echo off | |
rem nery[_at_]tecnico.ulisboa.pt v2014.01.16 [CC BY-NC-SA] | |
rem OBJETIVO: Converter de DOCX para RST utilizando o CALIBRE e o PANDOC. | |
rem Criar ficheiro de texto com o mesmo nome e extensão *.rst | |
rem PRE-REQUISITOS: | |
rem C:\Users\nery\AppData\Local\Pandoc\ | |
rem C:\Programs\Calibre\Calibre Portable\Calibre | |
rem REFERENCES | |
rem http://manual.calibre-ebook.com/cli/ebook-convert.html | |
rem http://johnmacfarlane.net/pandoc/README.html | |
rem http://digitalpublishingtoolkit.org/2013/08/docx-to-markdown-using-calibre-and-pandoc/ | |
rem Demo file | |
rem http://calibre-ebook.com/downloads/demos/demo.docx | |
@echo on | |
for %%f in (*.doc?) do ( | |
setlocal enableDelayedExpansion | |
mkdir temp | |
copy "%%f" temp | |
cd temp | |
"C:\Programs\Calibre\Calibre Portable\Calibre\ebook-convert" "%%f" output.htmlz | |
unzip output.htmlz | |
cd .. | |
pandoc -f html -t rst --output="%%~nf.rst" temp/index.html | |
rm -R temp | |
endlocal | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment