getnikola / plugins

Extra plugins for Nikola
https://plugins.getnikola.com/
MIT License
59 stars 95 forks source link

Plugin sphinx_roles and rest_html5 don't work together #190

Closed h4ckninja closed 7 years ago

h4ckninja commented 7 years ago

I'm trying to move to HTML5 output, but I make use of the sphinx_roles plugin. When I leave the compiler on 'rest', sphinx_roles works just fine. When I move the 'rest_html5', sphinx breaks.

I thought it might be this line in the sphinx plugin:

from nikola.plugins.compile.rest import add_node

and I changed it to:

from nikola.plugins.rest_html5.rest_html5 import add_node

However, that didn't work either. I'd like to make use of both of these plugins.

ralsina commented 7 years ago

"didn't work" how? Can you post error messages?

Kwpolska commented 7 years ago

You need to have the built-in reST compiler enabled and set for an extension for reST plugins to work. Please make sure rest is in your COMPILERS and POSTS/PAGES lists.

h4ckninja commented 7 years ago

So there's no way to utilize the rest_html5 parser with plugins? I don't want the html4 parser, that's why I removed it from my COMPILERS list.

Kwpolska commented 7 years ago

You can use rest_html5 with the plugins. Just do this:

COMPILERS = {
    'rest': ('.rst4',),
    'rest_html5': ('.rst', '.txt'),
}

POSTS = (
    ("posts/*.rst4", "posts", "post.tmpl"),
    ("posts/*.rst", "posts", "post.tmpl"),
    ("posts/*.txt", "posts", "post.tmpl"),
)

# NOTE: if you want to use the Nikola-provided reST extensions, you need to
#       keep the original `rest` compiler in COMPILERS *and* POSTS/PAGES,
#       otherwise they will not get loaded.
h4ckninja commented 7 years ago

I was missing a comma at the end. Thanks.