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

pelican3.7.0 #39

Merged
merged 3 commits into from
Sep 26, 2017
Merged

Conversation

jerryasher
Copy link

I believe this will fix #38 reported by @szhorvat.

I'm a bit of a noob to python, git, github, pelican, mathjax, but it seems to work and the unittest seem to work:

$ python test_math.py
Traceback (most recent call last):
  File "test_math.py", line 3, in <module>
    from .render_math import parse_tex_macros, _parse_macro, _filter_duplicates
ValueError: Attempted relative import in non-package
(py2) Dell15:~/d/workspace/upstream.pelican/pelican_plugin-render_math (pelican3.7.0)
$ python test_math.py
...WARNING: macros where defined more than once, the last definition is used
Macro circ defined in
/home/user/example1.tex, line 1
/home/user/example2.tex, line 1

.WARNING: macros where defined more than once, the last definition is used
Macro circ defined in
/home/user/example.tex, line 1
/home/user/example.tex, line 2

.
----------------------------------------------------------------------
Ran 5 tests in 0.000s

OK

To get the unit tests to run in Python 2.7, I did have to make one change, which is not included here, to the import statement in render_math.py, removing the "." relative import.

this is, I temporarily changed

try:
    from . pelican_mathjax_markdown_extension import PelicanMathJaxExtension
except ImportError as e:
    PelicanMathJaxExtension = None

to

try:
    from pelican_mathjax_markdown_extension import PelicanMathJaxExtension
except ImportError as e:
    PelicanMathJaxExtension = None

@szhorvat
Copy link

szhorvat commented Jan 12, 2017

Yes, it does appear to fix the problem. I tried it.

There's still the (separate) _get_summary deprecation in Pelican 3.7, but that's unrelated.

@jerryasher
Copy link
Author

@szhorvat I think this new version of the patch/pull request should remove the deprecation issue, which I fixed, tested, added, committed, then squashed the two commits together.

I am absolutely certain you use this plugin more than I, so if you could test it and make sure it works that would be great.

@szhorvat
Copy link

I tried it again. It appears to work fine both with Pelican 3.7.1 and 3.6.3. Thank you for the fix!

@szhorvat
Copy link

Actually, I just noticed a problem. With the

RELATIVE_URLS=False

setting, the usual script that enables MathJax doesn't get inserted into the output. This was not a problem with 3.6.3.

@szhorvat
Copy link

To be more precise, it doesn't get inserted only on the summary pages. The blog post pages are fine. This is not due to the change you made, it doesn't work without that change either. I guess I should open a new bug for this.

@szhorvat
Copy link

I opened #40 for this other problem.

@DEKHTIARJonathan
Copy link

Thanks a lot for the PR!

@barrysteyn barrysteyn merged commit 4aa206e into barrysteyn:master Sep 26, 2017
@jerryasher jerryasher deleted the pelican3.7.0 branch September 26, 2017 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compatibility with Pelican 3.7.0
4 participants