From a2138c12d68e5f5d438cc81037c4e92bea7910ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Au=C3=9F?= Date: Fri, 3 Apr 2015 00:03:06 +0200 Subject: [PATCH] Update version to v0.7.0 Move mvn clean into Makefile clean target update gitignore in calibre-plugin module Update Readme of Calibre-Plugin including example --- .idea/workspace.xml | 320 +++++++++--------- calibre-plugin/.gitignore | Bin 2177 -> 2204 bytes calibre-plugin/README.md | 41 ++- calibre-plugin/calibre-plugin.iml | 21 +- calibre-plugin/src/Makefile | 3 +- .../latexformulas_input/__init__.py | 12 +- latex2mobi-converter/latex2mobi-converter.iml | 9 + latex2mobi-converter/pom.xml | 2 +- 8 files changed, 228 insertions(+), 180 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 792822e..b24f65d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,8 +1,14 @@ - - + + + + + + + + @@ -26,79 +32,61 @@ - - - - - - - - - + + - - - - - + + - - + + - - + + - - - - - + + - - - + + + + + + + + + - - - - - - + + - - + + - - + + - - - - - - - - - + + @@ -116,9 +104,13 @@ @@ -203,7 +195,8 @@ - + + @@ -228,11 +221,7 @@ @@ -242,17 +231,13 @@ - - + @@ -361,12 +289,14 @@ - - + + - + + + @@ -724,6 +654,12 @@ + + + + + true + @@ -876,7 +812,8 @@ 1427895426213 - - - - - - + + + + + - - - - - - + + + + + - - - + + + - + + - + + + - + + + + @@ -969,24 +925,21 @@ - + - - + + - - - - - + + @@ -1000,7 +953,6 @@ - @@ -1008,7 +960,6 @@ - @@ -1016,20 +967,66 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1048,7 +1045,7 @@ - No facets are configured + Django - latex2mobi-converter + calibre-plugin diff --git a/calibre-plugin/.gitignore b/calibre-plugin/.gitignore index bb73b237d05fde3659c28afefd6b90f22dfab76f..0cfab2291645ca9101462e1a72a875142ba8a794 100644 GIT binary patch delta 38 tcmZn^oFgc#tPoI?pOu^Rf delta 11 ScmbOu*eEzrSZ$+YGzS0`<^x{< diff --git a/calibre-plugin/README.md b/calibre-plugin/README.md index 3848a59..274f2b4 100644 --- a/calibre-plugin/README.md +++ b/calibre-plugin/README.md @@ -19,7 +19,7 @@ https://github.com/Sevyls/latex-formulas-mobi-converter/releases/download/v0.6.0 3. Accept the security question for installing a plugin 4. Done. -## Required Configuration +## Required Running Configuration ### With Plugin configuration @@ -33,10 +33,33 @@ https://github.com/Sevyls/latex-formulas-mobi-converter/releases/download/v0.6.0 1. Set the system variable `JAVA_HOME` to your Java installation 2. Add your pandoc executable to the system's `PATH` variable +## Example: Converting a .tex-file into .Mobi -# Build +1. Import a .tex file into Calibre by dragging it into your library or opening it with your file chooser (choose "All files *.*"!) +2. Select the book in your Calibre library and right-click it, then choose "Convert books" -> "Convert individually" +3. Make sure your input format is **TEX** +4. Choose your output format, in our example "MOBI" +5. Choose "MOBI Output" from the icon bar on the left side +6. In "Kindle options" set the "MOBI file type" to **new** (important, the old format generator of Calibre will ignore any CSS stylesheet!) +7. Hit "OK" for converting your TeX file to a MOBI-eBook. -This project comes with a simple Makefile. + +### Supported conversion into the following output formats: + +* MOBI (only the **"new"** Format (KF8, Kindle Format 8), check your MOBI-Output conversion options! +* AZW3 + +### Tested, but unsupported output formats: + +* EPUB +* PDF + +In general output is optimized for Kindle Devices only - don't expect correct styles and layouts in unsupported formats, but maybe it is useful for you too. + + +## Build + +This project comes with a simple Makefile for building the project. It depends on the underlying Java/Maven Project "latex2mobi". ## Requirements @@ -48,8 +71,16 @@ For producing a standalone zip file, run ``make build-zip`` This will build a latex2mobi jar with Maven and zips it into ``calibre-plugin/build`` -For debugging purposes run ``make install`` and ``make debug-gui`` to start Calibre in debug mode. +For debugging purposes build a zip file first like above, then run ``make install`` and ``make debug-gui`` to start Calibre in debug mode. + +Note: Calibre executables must be in the PATH variable: + +* Mac OS X: ``export PATH=$PATH:/Applications/calibre.app/Contents/MacOS/`` +* Linux: find calibre-customize on your installation and add this to your PATH variable +* Windows: Do some GUI stuff... and add the Windows path for the directory containing "calibre-customize" -Note: Calibre binaries must be in the PATH variable +## Download calibre source code +For development purposes I added a make target to download the Calibre source code from GitHub. +Run ``make download-calibre-sources`` for downloading (only) the latest version of Calibre's sources. diff --git a/calibre-plugin/calibre-plugin.iml b/calibre-plugin/calibre-plugin.iml index b36d71a..01ec680 100644 --- a/calibre-plugin/calibre-plugin.iml +++ b/calibre-plugin/calibre-plugin.iml @@ -1,9 +1,28 @@ + + + + + + - + + + + + + + + + \ No newline at end of file diff --git a/calibre-plugin/src/Makefile b/calibre-plugin/src/Makefile index d2259b4..b5783df 100644 --- a/calibre-plugin/src/Makefile +++ b/calibre-plugin/src/Makefile @@ -24,10 +24,9 @@ clean: rm -rf ../calibre-src rm -rf ../build rm -f calibre_plugins/latexformulas_input/latex2mobi-converter.jar + mvn clean -f "../../latex2mobi-converter/pom.xml" -q build-zip: - cd ../../latex2mobi-converter - mvn clean -f "../../latex2mobi-converter/pom.xml" -q mvn package -f "../../latex2mobi-converter/pom.xml" -q cp ../../latex2mobi-converter/target/latex2mobi-converter-?.?.?.jar calibre_plugins/latexformulas_input/latex2mobi-converter.jar mkdir -p ../build diff --git a/calibre-plugin/src/calibre_plugins/latexformulas_input/__init__.py b/calibre-plugin/src/calibre_plugins/latexformulas_input/__init__.py index 4032114..ea6cab8 100644 --- a/calibre-plugin/src/calibre_plugins/latexformulas_input/__init__.py +++ b/calibre-plugin/src/calibre_plugins/latexformulas_input/__init__.py @@ -16,7 +16,7 @@ class LaTexFormulasInputPlugin(InputFormatPlugin): description = 'TODO Description' supported_platforms = ['windows', 'osx', 'linux'] author = 'Michael Auß' - version = (0, 6, 0) + version = (0, 7, 0) minimum_calibre_version = (2, 19, 0) file_types = set(['tex']) @@ -71,17 +71,9 @@ def save_settings(self, config_widget): def apply_settings(self): from calibre_plugins.latexformulas_input.config import prefs - # In an actual non trivial plugin, you would probably need to - # do something based on the settings in prefs print('java_exec: ' + prefs['java_exec']) print('pandoc_exec: ' + prefs['pandoc_exec']) - # TODO GUI Configuration? - # def gui_configuration_widget(self, parent, get_option_by_name, - # get_option_help, db, book_id=None): - # from calibre_plugins.latexformulas_input.latexformulas_input import PluginWidget - # - # return PluginWidget(parent, get_option_by_name, get_option_help, db, book_id) def customization_help(self, gui=False): return 'TODO customization_help' @@ -91,7 +83,7 @@ def convert(self, stream, options, file_ext, log, accelerators): dest_dir = os.getcwdu() # note: temp dir from calibre process log.debug('dest_dir: ' + dest_dir) - mi = None # TODO + mi = None # call latex2mobi with markup output only from subprocess import check_output, STDOUT, CalledProcessError diff --git a/latex2mobi-converter/latex2mobi-converter.iml b/latex2mobi-converter/latex2mobi-converter.iml index 83bda5a..b8cd51b 100644 --- a/latex2mobi-converter/latex2mobi-converter.iml +++ b/latex2mobi-converter/latex2mobi-converter.iml @@ -1,5 +1,14 @@ + + + + + file://$MODULE_DIR$/src/main/resources/application-context.xml + + + + diff --git a/latex2mobi-converter/pom.xml b/latex2mobi-converter/pom.xml index 7f3f3d0..2179a88 100644 --- a/latex2mobi-converter/pom.xml +++ b/latex2mobi-converter/pom.xml @@ -6,7 +6,7 @@ Latex to Mobi Formula Converter - Bachelor Thesis at.ac.tuwien.ims latex2mobi-converter - 0.6.0 + 0.7.0 MIT License