GIDForums  

Go Back   GIDForums > Site Info and Feedback > GIDNetwork™ > GIDForums™
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 08-Sep-2005, 22:08
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 754
admin will become famous soon enough

Suggest design and layout for C/CPP/JAVA bbcodes


I am re-writing the markup for the custom C/CPP/JAVA syntax highlighting bbcodes as I post this.

I am considering incorporating some suggestions already submitted (& some changes I would personally like to see) about displaying these codes and now is a good time to include your suggestion(s), if you have any.
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #2  
Old 08-Sep-2005, 23:40
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,243
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Could you post a list of the changes you have in mind? Then we can see if any of our suggestions are already planned, and kickstart our brains for other things we forgot about?
__________________

Age is unimportant -- except in cheese
  #3  
Old 09-Sep-2005, 01:14
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 754
admin will become famous soon enough
OK...

Let's make a decision about this idea first: I was thinking of displaying the same background colour for ALL code highlighting. ALL as in CODE / C / CPP / JAVA / PHP / HTML / CSS markup or codes.

Only the border colours will be unique for each language.
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #4  
Old 09-Sep-2005, 07:14
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough
Suggestion for comparison. Let me know if I missed any obvious ones...
  1. Background Color
  2. Titlebar Color
  3. Comments
  4. Reserved Words
  5. String Literals
  6. Numeric Constants
  7. Built in Datatypes and/or Attributes


Code:
// testing one two /* testing three four # just more tests /* now it should close */ <!-- comparisons really --> smilies ;) while ( "this" == getline(cin, buf) ); #define THAT 8 <form name="form1" id="form1" method="post" action=""> <p>A standard form:</p> h3 { font-family: 'Times New Roman', Times, serif; font-size: 1.15em; color: #DCDCDC } .aname div.bname{ color: #00FFCC } /* non terminated test text will not display

CPP / C++ / C Code:
// testing one two
/* testing three four

# just more tests
/*  now it should close */
<!--  comparisons really  -->

smilies ;)

while ( "this" == getline(cin, buf) );
#define THAT 8

<form name="form1" id="form1" method="post" action="">
  <p>A standard form:</p>

h3 {  
  font-family: 'Times New Roman', Times, serif;  
  font-size: 1.15em;  
  color: #DCDCDC
  }

.aname
div.bname{
  color: #00FFCC
}
/* non terminated
test text will not display

CPP / C++ / C Code:
// testing one two
/* testing three four

# just more tests
/*  now it should close */
<!--  comparisons really  -->

smilies ;)

while ( "this" == getline(cin, buf) );
#define THAT 8

<form name="form1" id="form1" method="post" action="">
  <p>A standard form:</p>

h3 {  
  font-family: 'Times New Roman', Times, serif;  
  font-size: 1.15em;  
  color: #DCDCDC
  }

.aname
div.bname{
  color: #00FFCC
}
/* non terminated
test text will not display

JAVA Code:
// testing one two
/* testing three four

# just more tests
/*  now it should close */
<!--  comparisons really  -->

smilies ;)

while ( "this" == getline(cin, buf) );
#define THAT 8

<form name="form1" id="form1" method="post" action="">
  <p>A standard form:</p>

h3 {  
  font-family: 'Times New Roman', Times, serif;  
  font-size: 1.15em;  
  color: #DCDCDC
  }

.aname
div.bname{
  color: #00FFCC
}
/* non terminated
test text will not display

Python Code:
// It sure would be nice if this worked ;)

PHP Code:

// testing one two
/* testing three four

# just more tests
/*  now it should close */
<!--  comparisons really  -->

smilies ;)

while ( "this" == getline(cin, buf) );
#define THAT 8

<form name="form1" id="form1" method="post" action="">
  <p>A standard form:</p>

h3 {  
  font-family: 'Times New Roman', Times, serif;  
  font-size: 1.15em;  
  color: #DCDCDC
  }

.aname
div.bname{
  color: #00FFCC
}



HTML Code:
// testing one two /* testing three four # just more tests /* now it should close */ <!-- comparisons really --> smilies ;) while ( "this" == getline(cin, buf) ); #define THAT 8 <form name="form1" id="form1" method="post" action=""> <p>A standard form:</p> h3 { font-family: 'Times New Roman', Times, serif; font-size: 1.15em; color: #DCDCDC } .aname div.bname{ color: #00FFCC } <!-- non terminated test text will not display

CSS Code:
// testing one two
/* testing three four

# just more tests
/*  now it should close */
<!--  comparisons really  -->

smilies ;)

while ( "this" == getline(cin, buf) );
#define THAT 8

<form name="form1" id="form1" method="post" action="">
  <p>A standard form:</p>

h3 {  
  font-family: 'Times New Roman', Times, serif;  
  font-size: 1.15em;  
  color: #DCDCDC
  }

.aname
div.bname{
  color: #00FFCC
}

Interestingly enough, I was just doing this as comparison tests but found out a few interesting things.
  • Broken c-style comment has various effects
  • No python markup (ok ok, I know there isn't one yet)
  • PHP seems to be an "internal" highlighter ???

SUMMARY:

I wanted to get a visual comparison on the same page. If anyone wants to suggest a good test case for each highlighter feel free to add your input. I know not all my suggestions for what should be marked up will not be what is actually marked up (numeric constants for example) but I would like a discussion on what people feel should be considered. I do think we should come up with a simple test case that addresses what will actually be handled by the highlighter as well as attempts to break the highlighter.

OPINION:

As a relatively new programmer that usually has multiple languages in my editor I would like people to consider some common colors. I looked at a few different editors and as WaltP stated in one of the old posts,

"Just what is standard anyhow?"

Perhaps it would be beneficial to create a GIDhighlight Standard of sorts.

(for the curious, I am looking at my editor with a c++, html, css, php and text files as part of the same project)

Well, that is my opinion on the subject. I apologise for the length of the post, it became my own testbed...

Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #5  
Old 09-Sep-2005, 10:35
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 754
admin will become famous soon enough
Very interesting Mark... incidentally, the very reason I decided to re-write some parts of the bbcode script yesterday is revealed in your example / test codes. This bit: /* non terminated
test text will not display
-- one down

With this latest version of the script, I will be able to add syntax highlighting for just about any programming language within minutes. Once we are done with the forum upgrade, I will gladly add Python to the mix... and even syntax highlighting for C#, JavaScript, MySQL if anyone wants it enabled.

Since it has become very easy for me to add languages to the mix, I will probably no longer use the PHP's highlight_string function to syntax highlight example PHP scripts.

The latest version of the bbcode script that I worked on yesterday and today is not uploaded yet and it probably won't be until I upgrade the forum script sometime this month.

Those of you with access to the "test" site will probably see it in a few days...
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #6  
Old 09-Sep-2005, 14:25
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,243
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by admin
OK...

Let's make a decision about this idea first: I was thinking of displaying the same background colour for ALL code highlighting. ALL as in CODE / C / CPP / JAVA / PHP / HTML / CSS markup or codes.

Only the border colours will be unique for each language.
I have abolutely no problem with one background color for all.
__________________

Age is unimportant -- except in cheese
  #7  
Old 09-Sep-2005, 21:56
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,543
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice
One color is fine w/ me. I'd like to say that, regarding comments, I personally don't like italic style used in the HTML block. The grey color is difficult to read against the "bright" white background.

I'd like to recommend using the pale yellow of the C/C++ block for a background, since nearly every color contrasts w/ it (except yellow, duh :-P). Or the contrasting colors used in the PHP block.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
 
 

Recent GIDBlogHalfway done! by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:06.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.