Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AI code-tag, and icode-tag
#1
So I'm wondering if it would be possible to make a syntax highlighter for the AI language ([code=ai]). If you are looking for a lexer function you can take a look at my data changer which has one. Maybe I could write it myself, if I knew what the plugin that handles the syntax highlighting is.

I was also wondering if it would be possible to implement something like an inline code tag ([icode=language]), which wouldn't create an ugly box in the middle of the post when you have to post a single line of code. It should have the same visual style as ".geshicode_b", and be an inline pre tag (unsure exactly how it would look, but it should work nicely).

Another thing that would be nice is if the editor recognised the ampersand, and replaced it with & (for some reason it does this when you write &, but not when you write [. I have no idea why) whenever it appeared in the editor. This would make writing posts like this one a lot easier.

Also why don't we already have an inline inv tag ([iinv])? It should simply be the same tag but a span instead of a div. It would be so "useful".


Age ratings for movies and games (and similar) have never been a good idea.
One can learn a lot from reinventing wheels.
An unsound argument is not the same as an invalid one.
volatile in C++ does not mean thread-safe.
Do not make APIs unnecessarily asynchronous.
Make C++ operator > again
Trump is an idiot.
Reply
Thanks given by:
#2
(12-18-2013, 11:01 PM)Someone else Wrote:  So I'm wondering if it would be possible to make a syntax highlighter for the AI language ([code=ai]). If you are looking for a lexer function you can take a look at my data changer which has one. Maybe I could write it myself, if I knew what the plugin that handles the syntax highlighting is.
Shoot me a list of tags and I'll implement it. Also, if you feel like it, define which tag is which color (because your program is pretty much the only one handling AI-scripts).

(12-18-2013, 11:01 PM)Someone else Wrote:  I was also wondering if it would be possible to implement something like an inline code tag ([icode=language]), which wouldn't create an ugly box in the middle of the post when you have to post a single line of code.
Possible: yes. Will I do it? Right now, no, maybe later.

(12-18-2013, 11:01 PM)Someone else Wrote:  Another thing that would be nice is if the editor recognised the ampersand, and replaced it with & whenever it appeared in the editor. This would make writing posts like this one a lot easier.
Where does this appear to be a problem? I can't quite seem to follow you :p

(12-18-2013, 11:01 PM)Someone else Wrote:  
Also why don't we already have an inline inv tag ([iinv])? It should simply be the same tag but a span instead of a div. It would be so "useful".
That is because there NEEDS to be some sort of downside if you want to post something but not let it be viewable. Having an inline-tag would diminish that and people would notice this even less. Hence, not going to add that one.
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by:
#3
(12-19-2013, 07:11 AM)Blue Phoenix Wrote:  Shoot me a list of tags and I'll implement it. Also, if you feel like it, define which tag is which color (because your program is pretty much the only one handling AI-scripts).
Will do in a few days I think (when I'm done with school).

(12-19-2013, 07:11 AM)Blue Phoenix Wrote:  Possible: yes. Will I do it? Right now, no, maybe later.
I'll hope for later then.

(12-19-2013, 07:11 AM)Blue Phoenix Wrote:  Where does this appear to be a problem? I can't quite seem to follow you :p
It happens when you write out stuff like:
"In order to use the code tag you start off with '[code=language]' where language specifies the language the text should be highlighted according to (CPP, AI, DC), and then you end the tag by using its counterpart '[/code]'"

If you aren't careful you end up with stuff like:
"In order to use the code tag you start off with '
    LANGUAGE-Code:
' where language specifies the language the text should be highlighted according to (CPP, AI, DC), and then you end the tag by using its counterpart '
'"

The way I've been working around this is by using HTML characters ([ for [ for example). It works but whenever I click preview post or someone responds it messes up the layout, and in order to fix that I have to copy my post before I click preview, EVERY SINGLE TIME :horrified:

(12-19-2013, 07:11 AM)Blue Phoenix Wrote:  That is because there NEEDS to be some sort of downside if you want to post something but not let it be viewable. Having an inline-tag would diminish that and people would notice this even less. Hence, not going to add that one.
Aww :(

Edit: Forgot to do it before I posted :(
Age ratings for movies and games (and similar) have never been a good idea.
One can learn a lot from reinventing wheels.
An unsound argument is not the same as an invalid one.
volatile in C++ does not mean thread-safe.
Do not make APIs unnecessarily asynchronous.
Make C++ operator > again
Trump is an idiot.
Reply
Thanks given by:
#4
AI-highlighter: DONE! :D

(12-19-2013, 09:58 AM)Someone else Wrote:  
(12-19-2013, 07:11 AM)Blue Phoenix Wrote:  Possible: yes. Will I do it? Right now, no, maybe later.
I'll hope for later then.
Haven't forgotten about it so far :p
However, I'm wondering if you need a syntax highlighting for it as well or just some sort of monospaced black font on white bg.


(12-19-2013, 09:58 AM)Someone else Wrote:  
(12-19-2013, 07:11 AM)Blue Phoenix Wrote:  Where does this appear to be a problem? I can't quite seem to follow you :p
It happens when you write out stuff like:
"In order to use the code tag you start off with '[code=language]' where language specifies the language the text should be highlighted according to (CPP, AI, DC), and then you end the tag by using its counterpart '[/code]'"

If you aren't careful you end up with stuff like:
"In order to use the code tag you start off with '
    LANGUAGE-Code:
' where language specifies the language the text should be highlighted according to (CPP, AI, DC), and then you end the tag by using its counterpart '
'"

The way I've been working around this is by using HTML characters ([ for [ for example). It works but whenever I click preview post or someone responds it messes up the layout, and in order to fix that I have to copy my post before I click preview, EVERY SINGLE TIME :horrified:
Oh, that's been around for a while, yeah :p
I usually go around and slap blind bb-code inside the actual tag:
Code:
blablabla mentioning the [[b][/b]code] environment etc
Then again, if you don't have a closing tag, it'll usually just render out fine. Just don't use more closing quote-tags than opening (no idea if it was that constellation but it was related to quotes), it'll magically hide your post's content :p
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by: Som1Lse
#5
Quote:The thread you are posting in is older than two months. You might be warned for gravedigging.
Classic me.


So, apart from that, here's something that might be of your interest:
for(int i = 0; i < 2; i++) i--;

Hover over it to receive infos about the language used.

Usage: [codei=language]asdf[/codei]
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by:
#6
As it turns out, I forgot to uncomment a line which made this whole inline-code unusable for anybody but me :p

Sorry about that and have fun
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by: A-Man
#7
Sorry for gravedigging, but would it be possible to allow using these inline code tags without necessarily mentioning a language? [codei]code[/codei].
Syntax highlighting can only go highlighting numbers and generic special symbols. Maybe also go with a Stack Overflow-like delimiters for it (a pair of "`"s). It would be great.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)