On my previous post to this i wanted to add some vb and tsql code, and have it appear like T-SQL or VB with similar syntax highlighting
So if you run wordpress here is how you do it
download the “WordPress:CodeHighlighingPlugin” from ideathinking http://ideathinking.com/wiki/index.php/WordPress:CodeHighlighterPlugin
Follow their install instructions
And here is where my tip comes in
to add custom tag button so they appear in your Visual editing toolbar as your posting, locate the following js file
wp-includes\js\quicktags-dev.js
wp-includes\js\quicktags.js
within the dev js file add the tag buttons of your choice, i personally added tsql and vb like so
Starting at line ~123
#Important note: replace the <_pre and <_/pre with the correct syntax (ie remove the _), i merely used it here in order the site would render the text rather than run through the highlighting engine
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
edButtons[edButtons.length] = new edButton('ed_code_plugin_vb' ,'vb' ,'<_pre lang="vb">' ,'<_/pre>' ,'c' ); edButtons[edButtons.length] = new edButton('ed_code_plugin_sql' ,'sql' ,'<_pre lang="sql">' ,'<_/pre>' ,'c' ); |
now you need to put it all on one line and copy paste into a similar location in the quicktags.js