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

Passing options to Pygments #31

Closed
koraktor opened this issue May 4, 2009 · 7 comments
Closed

Passing options to Pygments #31

koraktor opened this issue May 4, 2009 · 7 comments

Comments

@koraktor
Copy link
Contributor

koraktor commented May 4, 2009

Right now only linenos can be passed to Pygments. I built a small patch for the highlight tag allowing general passing of options to Pygments. This can be used e.g. for startinline for PHP code.

http://github.com/koraktor/jekyll/commit/dd12900dd59b2a6526040fc7d1400f35a8a73fe8

@qrush
Copy link
Contributor

qrush commented May 8, 2009

Could you give an example of how this works?

@koraktor
Copy link
Contributor Author

koraktor commented May 8, 2009

For example using startinline will cause PHP code to get highlighted without the need for <?php ?>.

<% highlight php linenos startinline %>
$inline = true;
echo "This is inline PHP code.";
<% endhighlight %>

will result in highlighted PHP code and line numbers.

There are several other options, most of them are boolean. So the value defaults to true if an option is set. But you can also use e.g. encoding=utf-8 or tabsize=2.

@dcreager
Copy link

+1

Solid! I was about to start a patch that would let me set linenostart in my highlighted code, but this looks like it would do exactly what I need.

@mojombo
Copy link
Contributor

mojombo commented Jan 14, 2010

This patch looks good. As a feature addition it will go into 1.1.

@koraktor
Copy link
Contributor Author

koraktor commented Feb 3, 2010

The changes now reside in koraktor/jekyll@pygments-options.

@mojombo
Copy link
Contributor

mojombo commented Jun 22, 2010

Changed my mind. This is merged in master and going in the next release.

@madhur
Copy link

madhur commented Feb 29, 2012

Has this been included in latest Jekyll release ? I am wondering because the issue status stays "Pending"

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants