[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [eLyXer-users] Indented, color-coded Code Samples with eLyXer

From: Jack Desert
Subject: Re: [eLyXer-users] Indented, color-coded Code Samples with eLyXer
Date: Tue, 15 May 2012 15:39:57 -0400


I'm looking at the example from the user's guide--and each line is
indented the same amount. (Screenshot attached)

Do you have an example with varying indentation, something that looks like:

def coolness
  look = "indented"


On Sat, May 12, 2012 at 9:44 AM, Alex Fernandez <address@hidden> wrote:
> Hi,
> On Sat, May 12, 2012 at 3:38 PM, Jack Desert <address@hidden> wrote:
>> On Tue, May 8, 2012 at 9:45 AM, Jack Desert <address@hidden> wrote:
>> >> What's the best way to paste a code sample (Ruby, in my case) into a
>> >> LyX document and export it to html while
>> >>
>> > > A. Preserving the white space indentation
>> >>
>> > > B. Color coding the keywords so that strings, variables, and
>> >> comments are all a different color
>> Alex responded:
>> > I remember that some people sent me a sample which did this. I think
>> > your best option is to use a syntax
>> > highlighter in _javascript_ embedded into your HTML document.
>> Alex,
>> What about the case of simply getting the indenting whitespace to show
>> up in html? Does eLyXer support this? If not, what approach would you
>> recommend:
> Sure, eLyXer displays code listings in a <pre> tag.
>> A. Within a <pre> tag, replace two spaces in a row with &nbsp;&nbsp;
>> B. Within a <pre> tag, replace two spaces in a row with <div
>> class='two_space' />
>> Ideally, someone reading my code snippet online should be able to copy
>> and paste it into their own text editor and also have the indentation
>> show up properly. This suggests that solution "A" may be better.
> Yes, and eLyXer should be able to do this automatically. You can see an
> example in the user guide.
>   http://elyxer.nongnu.org/userguide.html
> Look for "Algorithm 1 Example of diff output for functionally identical HTML
> files". Then you can check out the user guide to see how it is done. But
> it's simply a listing or a code listing (two confusing features which should
> both work).
>> And finally, is this something that would benefit all users of eLyXer?
>> If so, I'd like to write an eLyXer patch. If not, I'll just build the
>> functionality into LyXBlogger.
> No need to for this particular feature, but contributors are always welcome
> :)
> Alex.

Attachment: Screen Shot 2012-05-15 at 3.37.57 PM.png
Description: PNG image

reply via email to

[Prev in Thread] Current Thread [Next in Thread]