pelican-plugins / render-math

Pelican plugin that renders mathematics via the MathJax JavaScript engine
Other
30 stars 7 forks source link

Is there any configuration I need in pelican-config.py? #4

Closed dclong closed 4 years ago

dclong commented 4 years ago

I install the Python module but the math equations are not rendered.

moorepants commented 4 years ago

You still have to add the plugin name in the configuration file in the plugins variable. Did you do that?

dclong commented 4 years ago

I added the plugin name as below but it says the plugin cannot be loaded.

PLUGINS = ["render_math"]

Do I need to keep a plugins directory and specify a path to the plugins directory?

moorepants commented 4 years ago

Do I need to keep a plugins directory and specify a path to the plugins directory?

No.

What you have should work. So maybe there is a bug.

dclong commented 4 years ago

I notice that if I have plugins directory and have the old render-math repo cloned into it, and specify "render-math" in PLUGINS, things work.

justinmayer commented 4 years ago

@dclong: What version of Pelican are you using? If you are on the Pelican 4.2 release version, that could explain the problem. Pip-installing plugins is only supported on the to-be-released next version of Pelican, so you would need to install the current Pelican master branch in order for the install instructions as written to function as expected.

dclong commented 4 years ago

@justinmayer, Thank you very much! Installing from the current Pelican master branch resolves the issue. You guys are awesome!

moorepants commented 4 years ago

If this plugin is already released on PyPi, then it should have an install_requires version specifier in the setup.py to prevent installs in unsupported Pelican versions. That would solve the issue of users pip installing the plugin and finding it doesn't work. It does look like it has been released prematurely: https://pypi.org/project/pelican-render-math/

moorepants commented 4 years ago

This is the relevant line in the source tarball on PyPi:

install_requires = \
['pelican>=4.2,<5.0', 'typogrify>=2.0.7,<3.0.0']

which sounds like it is incorrect if Pelican 4.2 is not supported.

justinmayer commented 4 years ago

Well, for the moment, it is as correct as it can be. I intended for the release window to be much shorter, such that the above value would be quickly changed to match the new Pelican release version number, but that unfortunately did not happen as soon as I expected. We are, however, getting close to release, so I suspect the most sensible course of action is to wait a bit longer and adjust this value post-release.

justinmayer commented 4 years ago

This issue should be rectified as of Pelican 4.5 and Render Math 1.0.1+.