python html rendering

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pierre Imbaud

    #1

    python html rendering

    Hi, Im looking for a way to display some python code
    in html: with correct indentation, possibly syntax hiliting, dealing
    correctly with multi-line comment, and... generating valid html code if
    the python code itself deals with html (hence manipulates tag litterals.
    Thanks for your help!

  • Mark Peters

    #2
    Re: python html rendering

    Hi, Im looking for a way to display some python code
    in html: with correct indentation, possibly syntax hiliting, dealing
    correctly with multi-line comment, and... generating valid html code if
    the python code itself deals with html (hence manipulates tag litterals.
    Thanks for your help!
    I haven't used it, but these seem promising:



    Hope it helps.

    Comment

    • GHUM

      #3
      Re: python html rendering

      Pierre,
      Hi, Im looking for a way to display some python code
      in html: with correct indentation, possibly syntax hiliting, dealing
      correctly with multi-line comment,
      <tongue - in - cheek - mode>
      the usual way is to create your own web-framework
      </tongue - in - cheek - mode>

      If it is just "some" Python code and you have to do it "once", just
      look at scite. Scite can colour your code, and you can export it as
      HTML.

      Harald

      Comment

      • Duncan Booth

        #4
        Re: python html rendering

        "GHUM" <haraldarminmas sa@gmail.comwro te:
        >Hi, Im looking for a way to display some python code
        >in html: with correct indentation, possibly syntax hiliting, dealing
        >correctly with multi-line comment,
        >
        ><tongue - in - cheek - mode>
        the usual way is to create your own web-framework
        ></tongue - in - cheek - mode>
        Or you could use an existing web framework: Plone has the ability to
        colour python code built-in.
        If it is just "some" Python code and you have to do it "once", just
        look at scite. Scite can colour your code, and you can export it as
        HTML.
        and if you need it more than once you can always find one of the existing
        chunks of colouring code and modify/reuse it. See Plone's
        PortalTransform s/transforms/python.py, or the MoinMoin code it was cribbed
        from.




        Comment

        • Paul Boddie

          #5
          Re: python html rendering

          Pierre Imbaud wrote:
          Hi, Im looking for a way to display some python code
          in html: with correct indentation, possibly syntax hiliting, dealing
          correctly with multi-line comment, and... generating valid html code if
          the python code itself deals with html (hence manipulates tag litterals.
          Thanks for your help!
          Take a look at Highlight [1], a program used successfully in the
          otherwise Python-based open source project ViewVC [2]. Messing around
          with IDEs (as others have suggested) just isn't necessary here.

          Paul

          [1] http://www.andre-simon.de/
          [2] http://www.viewvc.org/

          Comment

          Working...