Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KaTeX #72

Open
wants to merge 10 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion noteorganiser/assets/style/bootstrap-blog.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>
<head>
<meta charset="utf-8">
Expand Down
15 changes: 15 additions & 0 deletions noteorganiser/frames.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)