Skip to content

Conversation

krother
Copy link

@krother krother commented Jun 6, 2016

Improved the setup documentation when rendering Python code with Pygments and CodeHilite. Added a link to the Pygments CSS files and emphasized that not installing pygments does not cause an error message.

Improved the setup documentation when rendering Python code with Pygments and CodeHilite. Added a link to the Pygments CSS files and emphasized that not installing pygments does not cause an error message.
@mitya57
Copy link
Collaborator

mitya57 commented Jun 6, 2016

I don't like the idea of linking to third-party CSS. Instead, one can get the CSS using Pygments API:

from pygments.formatters import HtmlFormatter
HtmlFormatter().get_style_defs('.codehilite')

@krother
Copy link
Author

krother commented Jun 6, 2016

I agree - that would introduce another dependency. I would find it useful though to include the above sniplet in the documentation for the extension.

@waylan
Copy link
Member

waylan commented Jun 6, 2016

I have been aware of and intending to link to the third party CSS for some time now. Those CSS files have been generated from calling the Pygments API. But I think @mitya57's concern is valid. I would prefer to leave the note in place and link to the CSS files from there. As a note, it is more like an "aside" and not part of the main body. Or maybe it should be in a "see also" style note.

In any event, the current documentation is lacking. Back when I first drafted it, Pygments documentation was different than it is today and we linked to instructions on how to generate the CSS from Pygment's API. Today, I don't even know where Pygments documents that. Even if we find it, what's to stop them from moving it again. We should just document it ourselves.

Thanks for kickstarting this @krother.

@krother
Copy link
Author

krother commented Jun 6, 2016

Let me know how I can help with this. I am using Python and Markdown daily for writing things. Your library is a key component that glues my blog server together.

@waylan waylan merged commit 4bf178e into Python-Markdown:master Jun 6, 2016
@waylan
Copy link
Member

waylan commented Jun 6, 2016

I made some additional changes in f3f7687. That should address any concerns raised here. Thanks again.

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.

3 participants