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

Support CodeHilite lineseparator option #817

Closed
denizdogan opened this issue Apr 13, 2019 · 4 comments
Closed

Support CodeHilite lineseparator option #817

denizdogan opened this issue Apr 13, 2019 · 4 comments
Labels
duplicate The issue has been previously reported.

Comments

@denizdogan
Copy link

denizdogan commented Apr 13, 2019

Would make my day if we could configure lineseparator for CodeHilite.

The use case is a library that I've developed which, among other things, removes trailing whitespaces from its input: https://github.com/denizdogan/django-whiteless/

I use MkDocs to generate the documentation with example input and example output. Since I cannot change the lineseparator option for CodeHilite some examples look silly, because the extra newlines at the end of each input aren't included in the HTML output. For this reason, I'd like to be able to configure lineseparator to be <br>.

I've managed to configure this in my local version of Python-Markdown and was about to make a PR but couldn't quite figure out the unit test for when Pygments wasn't installed.

EDIT: Typo

@waylan
Copy link
Member

waylan commented Apr 14, 2019

I've managed to configure this in my local version of Python-Markdown

How have you done this? I'm not aware of any lineseparator setting for CodeHilite.

Or, in other words, I don't understand what you are having trouble with.

@denizdogan
Copy link
Author

@waylan My apologies, I actually meant the Pygments lineseparator option. What I've done in my local Python-Markdown is simply add a lineseparator argument to the CodeHilite constructor and then use that throughout the code in the same way as linenums.

@waylan
Copy link
Member

waylan commented Apr 15, 2019

Ah, so you have forked the extension. Then you need to install it as a separate extension (under a new name) and list that new extension in your mkdocs.yml config file. The specifics of how to do this are out-of-scope for MkDocs. For help with forking/installing a Python-Markdown extension, please take that upstream to the Python-Markdown project.

Or you can address the issue upstream with the Python-Markdown project and if, your change is added, have assess to the feature in the next release of Python-Markdown.

@waylan
Copy link
Member

waylan commented Jun 13, 2019

Hmm, Apparently in my previous response I missed that this was reported to Python-Markdown not MkDocs. Sorry about that.

In any event, there are currently a couple open issues regarding CodeHilite which contemplate expanding support to allow any and all Pygments options to be defined. I'm closing this as a duplicate of #334. See also #816 and #822.

@waylan waylan closed this as completed Jun 13, 2019
@waylan waylan added the duplicate The issue has been previously reported. label Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate The issue has been previously reported.
Projects
None yet
Development

No branches or pull requests

2 participants