I'd like my Pygmentized code with a style, and my inline code with another one.

92 views
Skip to first unread message

JanesConference

unread,
Feb 10, 2011, 12:05:55 PM2/10/11
to jekyll.rb
Hi everybody, I'm trying to setup my static site with Jekyll and
markdown.
The problem is: i want my inline code (the one I put between
backticks) formatted in a certain way, and my pygmentized highlights
in another way.
I have this .css code for inline:

code {
font-size: 0.9em;
background: #f0f0f0;
padding-left: 0.2em;
padding-right: 0.2em;
border: 1px solid #e0e0e0;
-moz-border-radius: 0.2em;
-webkit-border-radius: 0.2em;
border-radius: 0.2em;
}

and that one for pre:

pre {
font: 0.7em "Droid Sans Mono", monospace;
line-height: 1.4em;
display: block;
color: white;
background: #222222;
-moz-border-radius: 0.3em;
-webkit-border-radius: 0.3em;
border-radius: 0.3em;
padding: 0.6em;
}

The problem is that when I enter code in a post between , for example,
{% highlight bash %} and {% endhighlight %} to be pygmentized, the
code is rendered like this:

<div class="highlight">
<pre>
<code class="bash">
[...] code [...]
</code>
</pre>
</dive>

Thus, inline code style is applied to pygmentized code, and I end up
with a nasty effect I don't want.
Is there a way to exclude the <code class="something"> tag from the
highlighted snippets?

Ken Collins

unread,
Feb 16, 2011, 2:01:59 PM2/16/11
to jeky...@googlegroups.com

This is just a basic CSS question. You would write your selectors better.

div.highlight pre {
...
}

I have crazy pre/code CSS in mine. Different styles for both in pygmentize, paragraphs, etc.

https://github.com/metaskills/metaskills.net


- Ken

Krzysztof Wojciechowski

unread,
Feb 16, 2011, 2:01:06 PM2/16/11
to jeky...@googlegroups.com
You can use the following CSS:
pre code {
font-size: 1em;
background: #222;
etc (also undo the code formatting that isn't in pre)
}
Cheers,
— Kwpolska (http://kwpolska.co.cc)

> --
> You received this message because you are subscribed to the Google Groups "jekyll.rb" group.
> To post to this group, send email to jeky...@googlegroups.com.
> To unsubscribe from this group, send email to jekyll-rb+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jekyll-rb?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages