librelist archives

« back to archive

Syntax highlighting

Syntax highlighting

From:
Matthew Turk
Date:
2012-09-26 @ 21:43
Hi there,

I was wondering if there's a way to enable syntax-highlighting in
blohg for ..code directives?

Thanks!

-Matt

Re: [blohg] Syntax highlighting

From:
Rafael Martins
Date:
2012-09-26 @ 22:03
Hi Matt,

On Wed, Sep 26, 2012 at 6:43 PM, Matthew Turk <matthewturk@gmail.com> wrote:
> Hi there,
>
> I was wondering if there's a way to enable syntax-highlighting in
> blohg for ..code directives?

Yeah, but I recommend using the `sourcecode` directive, that is based
on pygments:

http://docs.blohg.org/en/0.11.1/write/#directive-code

> Thanks!
>
> -Matt



-- 
Rafael Goncalves Martins
http://rafaelmartins.eng.br/

Re: [blohg] Syntax highlighting

From:
Matthew Turk
Date:
2012-09-26 @ 23:48
Hi Rafael,

On Wed, Sep 26, 2012 at 6:03 PM, Rafael Martins
<rafael@rafaelmartins.eng.br> wrote:
> Hi Matt,
>
> On Wed, Sep 26, 2012 at 6:43 PM, Matthew Turk <matthewturk@gmail.com> wrote:
>> Hi there,
>>
>> I was wondering if there's a way to enable syntax-highlighting in
>> blohg for ..code directives?
>
> Yeah, but I recommend using the `sourcecode` directive, that is based
> on pygments:
>
> http://docs.blohg.org/en/0.11.1/write/#directive-code

Ah, thanks -- I missed that.  The context for this is that IPython
notebooks (ipython.org) can be converted directly to ReST now (with
nbconvert.github.com) but that uses the code directive.  I'll see if I
can post-process it or something ...  :)

-Matt

>
>> Thanks!
>>
>> -Matt
>
>
>
> --
> Rafael Goncalves Martins
> http://rafaelmartins.eng.br/

Re: [blohg] Syntax highlighting

From:
Rafael Martins
Date:
2012-09-27 @ 01:11
On Wed, Sep 26, 2012 at 8:48 PM, Matthew Turk <matthewturk@gmail.com> wrote:
> Hi Rafael,
>
> On Wed, Sep 26, 2012 at 6:03 PM, Rafael Martins
> <rafael@rafaelmartins.eng.br> wrote:
>> Hi Matt,
>>
>> On Wed, Sep 26, 2012 at 6:43 PM, Matthew Turk <matthewturk@gmail.com> wrote:
>>> Hi there,
>>>
>>> I was wondering if there's a way to enable syntax-highlighting in
>>> blohg for ..code directives?
>>
>> Yeah, but I recommend using the `sourcecode` directive, that is based
>> on pygments:
>>
>> http://docs.blohg.org/en/0.11.1/write/#directive-code
>
> Ah, thanks -- I missed that.  The context for this is that IPython
> notebooks (ipython.org) can be converted directly to ReST now (with
> nbconvert.github.com) but that uses the code directive.  I'll see if I
> can post-process it or something ...  :)

well, you can use the `code` directive. you'll just need to include
the js manually, as shown in the docs. you can include the js in the
templates if most of your blog posts are using syntax highlight, to
make things easier.

> -Matt
>
>>
>>> Thanks!
>>>
>>> -Matt
>>
>>
>>
>> --
>> Rafael Goncalves Martins
>> http://rafaelmartins.eng.br/

Best regards,

-- 
Rafael Goncalves Martins
http://rafaelmartins.eng.br/