Skip to content

Commit

Permalink
Update version to v0.7.0
Browse files Browse the repository at this point in the history
Move mvn clean into Makefile clean target
update gitignore in calibre-plugin module
Update Readme of Calibre-Plugin including example
  • Loading branch information
Sevyls committed Apr 2, 2015
1 parent 2ef87e3 commit a2138c1
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 180 deletions.
320 changes: 159 additions & 161 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file modified calibre-plugin/.gitignore
Binary file not shown.
41 changes: 36 additions & 5 deletions calibre-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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.
21 changes: 20 additions & 1 deletion calibre-plugin/calibre-plugin.iml
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$/calibre-src/src/calibre/gui2/library" />
<option name="settingsModule" value="" />
<option name="manageScript" value="" />
<option name="environment" value="&lt;map/&gt;" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/calibre-src/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/calibre-src/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/calibre-src/icons" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="jdk" jdkName="Python 2.7.6 (/usr/bin/python)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Django" />
</component>
</module>
3 changes: 1 addition & 2 deletions calibre-plugin/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 2 additions & 10 deletions calibre-plugin/src/calibre_plugins/latexformulas_input/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions latex2mobi-converter/latex2mobi-converter.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration>
<fileset id="fileset" name="Spring Application Context" removed="false">
<file>file://$MODULE_DIR$/src/main/resources/application-context.xml</file>
</fileset>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
Expand Down
2 changes: 1 addition & 1 deletion latex2mobi-converter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<name>Latex to Mobi Formula Converter - Bachelor Thesis</name>
<groupId>at.ac.tuwien.ims</groupId>
<artifactId>latex2mobi-converter</artifactId>
<version>0.6.0</version>
<version>0.7.0</version>
<licenses>
<license>
<name>MIT License</name>
Expand Down

0 comments on commit a2138c1

Please sign in to comment.