diff --git a/.travis.yml b/.travis.yml index ad5d1c2..30e45ee 100755 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ install: - pip install qtpy - pip install qtawesome - pip install coveralls - - pip install pypandoc + - pip install 'pypandoc>=0.9.7' - pip install pandocfilters - pip install pytest - pip install 'pytest-qt>=1.2.1' diff --git a/README.md b/README.md index c3f8758..4232190 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,9 @@ issue: python setup.py install --user -when in the main directory. It requires PySide, and pypandoc, which will be -installed if not present. **Be warned, PySide is a huge install**. Go walk -outside for a bit. +when in the main directory. It requires PySide, pandoc (version >= 1.13.2 for +math support) and pypandoc, which will be installed if not present. **Be +warned, PySide is a huge install**. Go walk outside for a bit. To get you started, look at the file `example/example.md`. diff --git a/noteorganiser/assets/style/bootstrap-blog.html b/noteorganiser/assets/style/bootstrap-blog.html index 0c273c4..0483969 100644 --- a/noteorganiser/assets/style/bootstrap-blog.html +++ b/noteorganiser/assets/style/bootstrap-blog.html @@ -1,4 +1,4 @@ - +
diff --git a/noteorganiser/frames.py b/noteorganiser/frames.py old mode 100644 new mode 100755 index edcb325..9942b80 --- a/noteorganiser/frames.py +++ b/noteorganiser/frames.py @@ -13,6 +13,7 @@ import io import traceback # For failure display import time # for sleep +from distutils.version import LooseVersion from PySide import QtGui from PySide import QtCore @@ -669,6 +670,20 @@ def convert(self, path, tags): if self.info.use_TOC: extra_args.append('--toc') + # use KaTex + if hasattr(pa, 'get_pandoc_version'): + version = LooseVersion(pa.get_pandoc_version()) + if version < LooseVersion('1.13.2'): + self.log.warning("Pandoc version %s " % pa.get_pandoc_version(), + "has no support for KaTeX. Please install" + " at least version 1.13.2 for math support.") + else: # pragma: no cover + extra_args.append('--katex') + else: # pragma: no cover + self.log.warning("Pypandoc version is below 0.9.7, and does not " + "allow to check for Pandoc version. Please " + "update it with pip.") + # Apply pandoc to this markdown file, from pypandoc thin wrapper, and # recover the html html = pa.convert(temp_path, 'html', encoding='utf-8', diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index debbab2..b50fb80 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ url='https://github.com/baudren/NoteOrganiser', packages=PACKAGES, scripts=['noteorganiser/NoteOrganiser.py'], - install_requires=['pypandoc', 'six', 'PySide>=1.2.2', 'qtawesome', + install_requires=['pypandoc>=0.9.7', 'six', 'PySide>=1.2.2', 'qtawesome', 'qtpy', 'pygments'], data_files=ASSETS, )