SilveiraNeto
Member
Posted 2 years ago #
I have trieded all plugins I found for show or show hightlighted source code in a post. No one worked propelly.
I have a huge necessity to write posts with source codes. I have many posts stuckeds because I can't write source codes in my posts, mostly Python and C.
I tried
<pre> and tags but the when I post the code loses it's identation. I tried some plugins that promised to show code but none worked.
I beg you, what I have to do? There's a easy way to do that? :(`
First, plan on turning off the WYSIWYG editor if you're going to use any of the code format plugins. (Users -> Your Profile, uncheck the Use VRE box).
Now, try them again. I use and like iG:Syntax Hiliter, still works well with 2.1.1.
SilveiraNeto
Member
Posted 2 years ago #
I tried the iG:Syntax Hiliter, looks fine but with me was a mess. Just a image could describe. :P Thanks for the tip, I will try right now.
SilveiraNeto
Member
Posted 2 years ago #
I did this by whis way:
1) Turned off the WYSIWYG editor, but no identation.
2) I did the identation manually by putting spaces like this
The post:
http://www.eupodiatamatando.com/2007/03/01/mostrando-as-horas-em-c/
A huge work, but works.
I put code in my posts. I just use the HTML entity for certain characters. I don't do C or Python (my tutes are XHTML and CSS), but I replace things like < with & lt; and that usually takes care of it. I make notations that it's code by placing it in a div with a border around it. It's not much extra work at all.
And I just copy/paste and toss ig:syntax hiliter tags. Indentation is preserved. Color coded. I even turned on the option line numbers. Example of a post with several different code samples.