tool to convert java code to HTML for wiki

Discussion in 'Java' started by usenetjb, Jan 7, 2006.

  1. usenetjb

    usenetjb Guest

    anyone know of a tool that will take java code and format it into html.
    think wiki for developers, so they need to be able to read the code
    snippets in a readable format in the wiki (mediawiki)

    thx
    usenetjb, Jan 7, 2006
    #1
    1. Advertising

  2. usenetjb

    Roedy Green Guest

    On Sat, 07 Jan 2006 03:29:55 GMT, usenetjb
    <> wrote, quoted or indirectly
    quoted someone who said :

    >anyone know of a tool that will take java code and format it into html.
    >think wiki for developers, so they need to be able to read the code
    >snippets in a readable format in the wiki (mediawiki)


    I do all the time. I render small bits of Java into HTML and longer
    files into compressed serialised token files rendered by an Applet
    that scrolls them.

    See http://mindprod.com/jgloss/jdisplay.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Jan 7, 2006
    #2
    1. Advertising

  3. Andrey Kuznetsov, Jan 7, 2006
    #3
  4. usenetjb

    Hal Rosser Guest

    "usenetjb" <> wrote in message
    news:Xns9743DAB4C6EE2usenetjb@207.115.17.102...
    > anyone know of a tool that will take java code and format it into html.
    > think wiki for developers, so they need to be able to read the code
    > snippets in a readable format in the wiki (mediawiki)
    >
    > thx


    Just cut and paste the code into the html page - and put <pre> tags around
    the code.
    wouldn't that work?
    Hal Rosser, Jan 7, 2006
    #4
  5. Hal Rosser wrote:
    > "usenetjb" <> wrote in message
    > news:Xns9743DAB4C6EE2usenetjb@207.115.17.102...
    >
    >>anyone know of a tool that will take java code and format it into html.
    >>think wiki for developers, so they need to be able to read the code
    >>snippets in a readable format in the wiki (mediawiki)

    ....
    > Just cut and paste the code into the html page - and put <pre> tags around
    > the code.
    > wouldn't that work?


    Sure would. E.G.

    <html>
    <body>
    <pre>
    ....the source code..
    </pre>
    </body>
    </html>

    ...Would be a valid page containing source code that would
    retain the tabs, spacing and line breaks of the original.

    Of course, Roedy does some nice transforms on the source to
    highlight a variety of aspects of the code (keywords, method
    exits, ..) more like an IDE would.

    --
    Andrew Thompson
    physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
    Andrew Thompson, Jan 7, 2006
    #5
  6. "Hal Rosser" <> writes:

    > Just cut and paste the code into the html page - and put <pre> tags around
    > the code.
    > wouldn't that work?


    Not quite. You also need to replace some < with &lt;.
    Torkel Franzen, Jan 7, 2006
    #6
  7. Torkel Franzen wrote:

    > "Hal Rosser" <> writes:
    >
    >
    >>Just cut and paste the code into the html page - and put <pre> tags around
    >>the code.
    >>wouldn't that work?

    >
    >
    > Not quite. You also need to replace some < with &lt;.


    Oh yeah.. good point.

    --
    Andrew Thompson
    physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
    Andrew Thompson, Jan 7, 2006
    #7
  8. usenetjb

    Roedy Green Guest

    On 07 Jan 2006 07:40:57 +0100, Torkel Franzen <>
    wrote, quoted or indirectly quoted someone who said :

    >
    > Not quite. You also need to replace some < with &lt;.


    I have a class to do that. see
    http://mindprod.com/products1.html#ENTITIES

    I can convert < to &lt; or vice versa.

    I can also strip out <tags>
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Jan 7, 2006
    #8
  9. usenetjb

    usenetjb Guest

    usenetjb <> wrote in
    news:Xns9743DAB4C6EE2usenetjb@207.115.17.102:

    > anyone know of a tool that will take java code and format it into html.
    > think wiki for developers, so they need to be able to read the code
    > snippets in a readable format in the wiki (mediawiki)
    >
    > thx


    http://www.palfrader.org/code2html/code2html.html
    usenetjb, Jan 7, 2006
    #9
  10. Hal Rosser wrote:
    > "usenetjb" <> wrote in message
    > news:Xns9743DAB4C6EE2usenetjb@207.115.17.102...
    >
    >>anyone know of a tool that will take java code and format it into html.
    >>think wiki for developers, so they need to be able to read the code
    >>snippets in a readable format in the wiki (mediawiki)
    >>
    >>thx

    >
    >
    > Just cut and paste the code into the html page - and put <pre> tags around
    > the code.
    > wouldn't that work?
    >
    >


    even simpler, in MediaWiki, just start each line with a space, then
    everything is treated as code and formatted appropriately...
    Andrew McDonagh, Jan 8, 2006
    #10
  11. usenetjb

    Googmeister Guest

    usenetjb wrote:
    > anyone know of a tool that will take java code and format it into html.
    > think wiki for developers, so they need to be able to read the code
    > snippets in a readable format in the wiki (mediawiki)


    Check out GNU source highlight.
    http://www.gnu.org/software/src-highlite/source-highlight.html
    Googmeister, Jan 8, 2006
    #11
  12. Hal Rosser wrote:
    > "usenetjb" <> wrote in message
    > news:Xns9743DAB4C6EE2usenetjb@207.115.17.102...
    >
    >>anyone know of a tool that will take java code and format it into html.
    >>think wiki for developers, so they need to be able to read the code
    >>snippets in a readable format in the wiki (mediawiki)
    >>
    >>thx

    >
    >
    > Just cut and paste the code into the html page - and put <pre> tags around
    > the code.
    > wouldn't that work?


    Use the wiki <verbatim> </verbatim> tags,
    that will escape funny stuff ('<','>','&', etc.)
    Thomas Schodt, Jan 9, 2006
    #12
  13. Thomas Schodt wrote:

    > Use the wiki <verbatim> </verbatim> tags,
    > that will escape funny stuff ('<','>','&', etc.)


    Except OFC you can't have "</verbatim>" in the text...
    Thomas Schodt, Jan 10, 2006
    #13
  14. usenetjb

    Cram TeXeD Guest

    On Sat, 07 Jan 2006 06:53:20 GMT, < Andrew Thompson > dit :

    >Torkel Franzen wrote:

    /.../
    >> Not quite. You also need to replace some < with &lt;.


    No, you don't need so: use <nowiki> tag instead.

    8:0) Cram TeXeD
    --
    "Des astronautes ont rencontré Dieu, et Elle est noire"
    Cram TeXeD, Jan 12, 2006
    #14
  15. usenetjb

    togotutor

    Joined:
    Apr 12, 2011
    Messages:
    1
    togotutor, Apr 12, 2011
    #15
  16. usenetjb

    vbnandu86

    Joined:
    Jun 19, 2012
    Messages:
    1
    vbnandu86, Jun 19, 2012
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chris
    Replies:
    4
    Views:
    886
    chris
    May 17, 2004
  2. Eric @ Zomething

    Python Wiki & wiki Hosting?

    Eric @ Zomething, Jun 5, 2004, in forum: Python
    Replies:
    2
    Views:
    531
  3. Eric S. Johansson

    Re: Python Wiki & wiki Hosting?

    Eric S. Johansson, Jun 6, 2004, in forum: Python
    Replies:
    6
    Views:
    500
    Paul Boddie
    Jun 8, 2004
  4. Mahrt, Dallas

    RE: Python Wiki & wiki Hosting?

    Mahrt, Dallas, Jun 7, 2004, in forum: Python
    Replies:
    0
    Views:
    420
    Mahrt, Dallas
    Jun 7, 2004
  5. Royan
    Replies:
    8
    Views:
    749
    Patricia Shanahan
    Feb 15, 2008
Loading...

Share This Page