Highlighting source code for posting to blogger and forum

Hi! Sorry for my English, I'm from Russia. I had a question about the syntax highlighting of source code and paste it in my blog. And also on this forum. I looked https://gist.github.com but there is no backlight as in the IDE. In http://pastebin.com/ not Processing it is nothing like a "Copy as HTML" in the Processing IDE.

Are there any other tools to help you insert the code illuminated in the blog in the same form as in the IDE Processing and even put line numbers at the beginning?

And even tried to insert examples light made on Processing in the article using the resources http://hascanvas.com/ and http://www.openprocessing.org/ but in the end only the blogger does not prohibit the use of "iframe", are there any other blogging platform where you can insert in article nicely formatted code Processing and examples of his work with js and iframe?

Answers

  • Thank you for the link in Markdown! But I did not make out with him and not found a convenient tool for easy posting in bloogger. Now I use Windows Live Writer and Windows 8.1, but I did not find it convenient plug-ins to work with the Processing. And other handy tools for simple work with blogger for Windows 8.1 yet to find. But it still needs to have the ability to embed iframe c examples of openprocessing...

  • I am not sure I fully understood, but the 2.1 PDE still has the "Copy as HTML" menu item, so you can paste the output (perhaps needs to be pasted in view source mode of your blogging platform).

    Otherwise, there are syntax highlighters in JavaScript available around, including the one used in this forum. You can use a regular Java one, in general. Might need some changes to accept the list of Processing keywords.

  • edited November 2013

    Sorry, probably in my poor English. I wanted to do pasting the code into the blog illuminated as in the IDE:

    ProcessingIDE

    "Copy As HTML does not preserve the layout and get a "spaghetti code":

    CopyAsHTML

    Gist not highlights keywords in the desired color:

    GistGithub

    Windows Live Writer + Plugin (Java syntax) highlights not all the words and not always correct, but gives numbering as Gist:

    java-syntax

    I'm looking for a tool which would give a simple way to post code in blogger with numbering and illuminated, something like gist.github + copy_as_html

  • edited November 2013

    Side note: "illuminated" is not a synonym of "syntax highlighted".

    The Copy as HTML is probably the closest of what you need, but for some reason, your platform doesn't respect the <pre> tag. It looks like it manages auto-line break only on empty lines.

    Note that to insert it in an existing page, you will need to replace <html><body> with <div> and </body></html> with </div>

  • Yes , thank you. I used the wrong " term" to refer to " syntax highlighting " . In my language differently constructed proposals and it can change the meaning of words from context and intonation. So I still can not properly write a sentence in English , but basically understand what is written , and I can translate .

    Yes , I want to show the code in the blog based on " keywords " it is language as is done in Processing IDE, thus add line numbers in gits, but if a copy of the HTML IDE, then later with the hard work and have to make a lot of edits hands. And I would like to avoid this routine.

    blogger

    I think I found something here . Indents not spoil blogger and Windows Live Writer when switching tabs editing records . Editor | Preview | Source Code. And the problem can be avoided if you just publish an article without watching the local machine. In principle, it is better than nothing.

    windows live writer

    Unfortunately, I have not found a stable and developed a blogging platform with support iframe, and scripts in blogger from google . You can certainly try to deploy their own, but as long as it is for me the complexity and excessive costs that distract from the task itself - write articles about processing in Russian .

    I want to be able to bring in a note with interactive examples openprocessing or http://hascanvas.com/

    openprocessing

  • edited November 2013

    I post on google Blogger, what I use is jEdit and code2html to produce html, which I post in html mode. You can then edit the code in compose mode if you are careful.

    But you would probably be better off using Markdown, and Github pages it is very flexible. You see some examples of code snippets in many Github projects.

    Here we seem to need to use html pre for code

     
    void setup(100, 100, P2D)
    

    On github Markdown you just use the following (for java line 1 begins line 3 ends)

    ```java
    void setup(100, 100, P2D)
    ```
    
Sign In or Register to comment.