Professional Web Applications Themes

XML/HTML display code for Ruby - Ruby

Alright so I know that RDoc does syntax highlighting on ruby code if you view each code block, and I know that you can use the top frames to switch around between files, but has anyone written a pretty print ruby to html converter that does nice things like link all the in project functions? That way if you call a function inside one method it will jump you to that method, or if you require a library it will jump you to that library, etc? This would be kind of nice in RDoc, but mostly it would be nice ...

  1. #1

    Default XML/HTML display code for Ruby

    Alright so I know that RDoc does syntax highlighting on ruby code if you
    view each code block, and I know that you can use the top frames to
    switch around between files, but has anyone written a pretty print ruby
    to html converter that does nice things like link all the in project
    functions? That way if you call a function inside one method it will
    jump you to that method, or if you require a library it will jump you to
    that library, etc? This would be kind of nice in RDoc, but mostly it
    would be nice for a good way to read code others have written. I know I
    have seen similar stuff used on say the C code for the linux kernel, but
    it would be a nice way to peruse code in say rubyforge or RAA.

    On another, similar note, what pretty print to printer packages exist
    that do syntax highlighting of ruby? I gather enscript should have a
    module for it, not quite sure how to use that, I'm used to using a2ps,
    and haven't notice a highlighter for that thus far. Suggestions?

    Charles Comstock
    Charles Guest

  2. #2

    Default Re: XML/HTML display code for Ruby

    On Wed, 11 Feb 2004 16:03:37 -0600, Charles Comstock wrote:
     

    IIRC enscript cannot (yet) color Ruby code.. thats what rubyforge is using
    in viewcvs. However VIM can hilight Ruby code.. and maybe be used in
    conjunction with a2ps?

    BTW: It would be really nice with a syntax hiliter that could understand
    the HEREDOC sections in Ruby code. For instance a "EOHTML" heredoc, could be
    interpreted as HTML. Similar with EOXML, EORUBY, EOTEXT.

    Long time out in the future I plan to make a syntax hiliter myself for
    AEditor.. but first I must finish my regexp-engine subproject.

    --
    Simon Strandgaard


    Simon Guest

  3. #3

    Default Re: XML/HTML display code for Ruby

    Simon Strandgaard <dk> wrote in message news:<dk>... 

    It isn't a syntax hiliter for display but... Emacs has the mmm-mode
    project which turns on different major modes within the same buffer
    based upon start-end region regexps.
    Alan Guest

  4. #4

    Default Re: XML/HTML display code for Ruby

    Simon Strandgaard wrote: 
    >
    >
    > IIRC enscript cannot (yet) color Ruby code.. thats what rubyforge is using
    > in viewcvs. However VIM can hilight Ruby code.. and maybe be used in
    > conjunction with a2ps?
    >
    > BTW: It would be really nice with a syntax hiliter that could understand
    > the HEREDOC sections in Ruby code. For instance a "EOHTML" heredoc, could be
    > interpreted as HTML. Similar with EOXML, EORUBY, EOTEXT.
    >
    > Long time out in the future I plan to make a syntax hiliter myself for
    > AEditor.. but first I must finish my regexp-engine subproject.
    >
    > --
    > Simon Strandgaard
    >
    >[/ref]

    I'm not exactly familiar with the syntax for highlighting in a2ps, but I
    don't think you could use the vim hilighting in conjunction with it. If
    vim marked up the code it would be more likely that a2ps would try to
    print these additional control codes then use them as highlighting
    suggestions. That's my experience with a2ps anyway.

    Charles Comstock
    Charles Guest

  5. #5

    Default Re: XML/HTML display code for Ruby

    What I do is to convert my ruby(or any) scripts into html using vim,
    --------------
    ARGV.each do |f|
    `vim -f +"syn on" +"colorscheme elflord" +"set number" +"run! syntax/2html.vim" +"wq" +"q" #{f}`
    end
    --------------
    then I print the html through any browser capable to print in color.
    so I think vim could help ...

    -ronnie


     
    >>
    >>
    >>
    >>[/ref]
    >
    > I'm not exactly familiar with the syntax for highlighting in a2ps, but
    > I don't think you could use the vim hilighting in conjunction with
    > it. If vim marked up the code it would be more likely that a2ps
    > would try to print these additional control codes then use them as
    > highlighting suggestions. That's my experience with a2ps anyway.
    >
    > Charles Comstock[/ref]





    Bermejo, Guest

  6. #6

    Default Re: XML/HTML display code for Ruby

    On Thu, 12 Feb 2004 23:15:06 +0900, Jim Weirich wrote:
     
    >>
    >> Seems like it would be easier to use code2html:
    >> http://www.palfrader.org/code2html/[/ref]
    >
    > source2html is also an option ...
    > http://onestepback.org/software/source2html[/ref]

    source-highlight also has support for Ruby and can produce XHTML:
    http://www.gnu.org/software/src-highlite/source-highlight.html

    Tim Guest

Similar Threads

  1. Replies: 0
    Last Post: November 1st, 05:21 PM
  2. Replies: 1
    Last Post: October 29th, 07:52 PM
  3. formatting ruby code in html
    By paul vudmaska in forum Ruby
    Replies: 3
    Last Post: September 25th, 08:17 PM
  4. how to display variables within using echo command within html code
    By Bartosz Wegrzyn in forum PHP Development
    Replies: 4
    Last Post: July 22nd, 11:31 PM
  5. [PHP] Display HTML/PHP code on a web page
    By Chris Shiflett in forum PHP Development
    Replies: 5
    Last Post: July 17th, 12:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139