On Wed, Apr 16, 2014 at 9:14 PM, T P <[email protected]> wrote:
> I've only been using Leo for a few days, and spent most of today figuring
> out how to get the new Viewrendered2 plugin to use stylesheets while
> displaying reStructuredText (and Markdown) nodes. So here's a brief summary
> to make this easier for others.

Thanks for this summary.

I have been able to get vr2 working on math examples, such as:

    @language rest

    .. math::

      α_t(i) = P(O_1, O_2, … O_t, q_t = S_i λ

This renders beautifully when exported.

But I have not been able to get syntax coloring working.  Given::

@language python

g.cls()
import sys

The generated rst is::

render_helper <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tra
nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10:
http://docutils.sourceforge.net/"; />
<title>Sherlock test</title>
<style type="text/css">

/*
:Author: Edward K. Ream
:Contact: [email protected]

Personal stylesheet for use with viewrendered2.py plugin for Leo.
*/
@import url(vr2_style.css); /*copy of skeeterstyle.py */
@import url(pygments_default.css);

</style>
</head>
<body>
<div class="document" id="sherlock-test">
<h1 class="title">Sherlock test</h1>

<pre class="code python literal-block">
<span class="name">g</span><span class="operator">.</span><span
class="name">cls</span><span class="punctuation">()</spa
n>
<span class="keyword namespace">import</span> <span class="name
namespace">sys</span>
</pre>
</div>
</body>
</html>

But the class names in the <span> elements do not match the class
names in pygments_default.css so no coloring happens.

BTW, roughly the same output is produced if I used the docutils ..
code::python directive.

I don't recall ever getting syntax coloring to work properly, either
with vr or vr2.

Can anyone suggest what I should be doing?

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to