What about adding / creating / modifying a code highlighter for phpbb that displays the pasted ahk code inside [code=auto:0] tags in different colors.
just an idea. :mrgreen:
Syntaxhighlighter for AHK Code for phpbb
Started by
AGU
, Nov 09 2005 05:43 PM
12 replies to this topic
#1
-
Posted 09 November 2005 - 05:43 PM
If you use the quote-option it works already that way (beside the anoying fact that any indent is getting lost).
#2
-
Posted 09 November 2005 - 09:17 PM
Yeah, but apart from the lost indentation you have to attach the colors line by line yourself. A rarther annoying job. A highlighter would do that automatically.
Doing a little Google search revealed these two pages to me:
http://qbnz.com/highlighter/
http://sourceforge.n...ts/geshi-phpbb/
Can't it be easily adjusted to display colored Autohotkey code? Isn't here somebody onboard that knows a little bit about customizing software?
Wouldn't it be nice to read "Autohotkey" in the list of supported languages? :mrgreen:
And what does Chris think about this?
Doing a little Google search revealed these two pages to me:
http://qbnz.com/highlighter/
http://sourceforge.n...ts/geshi-phpbb/
Can't it be easily adjusted to display colored Autohotkey code? Isn't here somebody onboard that knows a little bit about customizing software?
Wouldn't it be nice to read "Autohotkey" in the list of supported languages? :mrgreen:
And what does Chris think about this?
#3
-
Posted 10 November 2005 - 12:24 AM
Will one of the moderators be so kind to change the posting title to s.th. more meaningful like "Syntaxhighlighter for AHK Code" or s.th. like this.
Thx.
Thx.
#4
-
Posted 10 November 2005 - 12:29 AM
Does this title appeal better?
#5
-
Posted 10 November 2005 - 08:15 AM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
Wow. GeSHi - Generic Syntax Highlighter (link above) that's it !
#6
-
Posted 10 November 2005 - 09:47 AM
To create a language file should not be a problem. I could mod the UltraEdit code I wrote to do it.
I only worry that it will cause more problem (since it is alpha) then having a nice look. Although I like it very much in my UltraEdit.
I only worry that it will cause more problem (since it is alpha) then having a nice look. Although I like it very much in my UltraEdit.
#7
-
Posted 10 November 2005 - 10:26 AM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
I think it is a nice gimic. But it is up to the admins to decide.
It is a nice-to-have feature, but if it is unstable/buggy/riscy/to much hassle I would forget about it. I wouldn't risc data loss.
I always copy code to my editor, having highlighning there.
It is a little bit like the emoticons. You do not really need them. But it is fun (for a lot of people).
It is a nice-to-have feature, but if it is unstable/buggy/riscy/to much hassle I would forget about it. I wouldn't risc data loss.
I always copy code to my editor, having highlighning there.
It is a little bit like the emoticons. You do not really need them. But it is fun (for a lot of people).
#8
-
Posted 10 November 2005 - 10:32 AM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
The only backdraw I see is, that you have to use tabs for indentations in your code. Personnaly I prefer spaces. But that is just my taste and I can quickly change the spaces to tabs with AutoSyntaxTidy. :)
#9
-
Posted 10 November 2005 - 10:38 AM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
It's at chapter 4 [HowTo create a GeSHI language file]
#10
-
Posted 10 November 2005 - 10:41 AM
Where have you read this? The only section where I've read about Tabs instead of spaces was about the conventions writing the language file.The only backdraw I see is, that you have to use tabs for indentations in your code.
There are several conventions that are used in language files. For ease of use and readability, your language files should obey the following rules:
* Indentation is in tabs, not spaces: Use tabs! There's no excuse for using spaces in this day and age, where almost every good editor allows you to change the tab width. Tabs also take up less space, and ensure proper alignment. When you indent, use tabs, and if your editor converts tabs to spaces, tell it not to.
The other position within the docs just proposes to use Tabs instead of spaces within your code because a tab is one char to save, but spaces need to be saved char by char as "nbsp;" They only worry about the code size. But they don't forbid spaces within the code. That's the way I understand it.
The
header is the default. If you're familiar with HTML you'll know that whitespace is rendered "as is" by aelement. The advantage for you is that if you usethe whitespace you use will appear pretty much exactly how it is in the source, and what's more GeSHi won't have to add a whole lot of
's and non-breaking spaces ( ) to your code to indent it. This saves you source code (and your valuable visitors waiting time and your bandwidth)
#11
-
Posted 11 November 2005 - 01:09 PM
I'm sorry, I must have misinterpreted the text. I hope you are right.
#12
-
Posted 11 November 2005 - 08:30 PM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
The Geshi project works well with phpBB and it have AHK support now. I suppose this forum should have been better with code highlighting.
1. copy files to
./{FORUM_ROOT}/includes/geshi.php
./{FORUM_ROOT}/includes/geshi/*.*
2. open ./{FORUM_ROOT}/includes/bbcode.php and change this function:
3. Open ./{FORUM_ROOT}/includes/message_parser.php , change this function.
Usage
1. copy files to
./{FORUM_ROOT}/includes/geshi.php
./{FORUM_ROOT}/includes/geshi/*.*
2. open ./{FORUM_ROOT}/includes/bbcode.php and change this function:
function bbcode_second_pass_code($type, $code) { $code = str_replace('\"', '"', $code); // edited by jb (nebler.org) if( !include_once( 'geshi.php' ) ) { echo 'geshi nem elerheto!'; } else { $astr_to = array('<', '>', '[', ']', '.', ':','"'); $astr_from = array('<', '>', '[', ']', '.', ':','"'); $code = str_replace($astr_from, $astr_to, $code); //itt termeszetesen azt add meg defaultnak, ami neked kell $geshi = new GeSHi( $code, $type==""?"autohotkey":$type ); $geshi->set_header_type(GESHI_HEADER_NONE); $code = $geshi->parse_code(); $code = str_replace( '', '', $code ); } $code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close'); return $code; }
3. Open ./{FORUM_ROOT}/includes/message_parser.php , change this function.
function bbcode_parse_code($stx, &$code) { // edited by jb (nebler.org) if( strlen( $stx ) > 0 ) { return "[code=$stx]' . $code . '[/code]'; } else { return '[code]' . $this->bbcode_specialchars($code) . '[/code]'; } }
Usage
.. program ..or with these parameters the default highlightning is ahk.
#13
-
Posted 30 April 2010 - 09:19 AM