YAFLogo

guest
  • guest
  • Guest Topic Starter
18 years ago
Is there any resource available to upgrade the code tag? I mean to have keywords highlighted, comments dimmed and other code features...
Sponsor
wtilton
  • wtilton
  • 70.2% (Friendly)
  • YAF Developer
18 years ago

Is there any resource available to upgrade the code tag? I mean to have keywords highlighted, comments dimmed and other code features...

Omid wrote:

Not as part of YAF. I think there are other things out there, but that's a hefty app you're talking about.

guest
  • guest
  • Guest Topic Starter
18 years ago
Well thanx. I already knew that yaf is not supporting this while it's a very common feature in many bulletin systems. I just meant to ask if there is a resource(dll etc) available to do so or should I start getting involved in Regex and other string stuff to implement it on my own.
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
18 years ago

Is there any resource available to upgrade the code tag? I mean to have keywords highlighted, comments dimmed and other code features...

Omid wrote:

What are you looking for? YAF already supports a lot of syntax highlighting features on the

 tag.

C# code:
[code=c#]
if ((int)whatever > 5000)
{
  for (int i=0;i<10000;i++)
    // proper comment
    Console.WriteLine("blah " + i.ToString());
}

sql code:


    /* comment... */
    SELECT * FROM doggybag WHERE food = 'OLD'
guest
  • guest
  • Guest Topic Starter
18 years ago
hey! I was exactly looking for this!

I've developed the yaf 1.0.1 vastly so hadn't opportunity to see if the latest yaf(.net2) had this feature. Thanx Jaben I'll be searching the latest source to find and place the necessary parts in my version.

Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
18 years ago

hey! I was exactly looking for this!

I've developed the yaf 1.0.1 vastly so hadn't opportunity to see if the latest yaf(.net2) had this feature. Thanx Jaben I'll be searching the latest source to find and place the necessary parts in my version.

Omid wrote:

It should be in v1.0.1.

Just use the code specifier:


  [ code=<language type>]code[ /code]

  e.g.:

  [ code=c#]my C# code[ /code]
guest
  • guest
  • Guest Topic Starter
18 years ago
Yes, but it works strangely...

look at the result in my version:

UserPostedImage

but it's ok here:

		static public string DecodeHTML( string text )
		{
			return System.Web.HttpContext.Current.Server.HtmlDecode( text );
		}
guest
  • guest
  • Guest Topic Starter
18 years ago
Ok it's fixed. Thanks a lot.
Neven
18 years ago

hey! I was exactly looking for this!

I've developed the yaf 1.0.1 vastly so hadn't opportunity to see if the latest yaf(.net2) had this feature. Thanx Jaben I'll be searching the latest source to find and place the necessary parts in my version.

Jaben wrote:

It should be in v1.0.1.

Just use the code specifier:


  [ code=<language type>]code[ /code]

  e.g.:

  [ code=c#]my C# code[ /code]

Omid wrote:

While we're at it -

In file \defs\DefFiles.txt

http://www.textpad.com/add-ons/syna2g.html 

I wanted to apply some other def for html.

However, def files on that site, and the others in \defs\ directory are not of the same structure...

How far can one go with defs on YAF?

- can I change colors and sytles (I believe not, just askin':lol:) from def file?


... But trust me on the sunscreen!

-----

There not bugs(in YAF)...it's either un-defined features or exceptions to expected behavior!!

test2005 wrote:

Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
18 years ago

While we're at it -

In file \defs\DefFiles.txt

http://www.textpad.com/add-ons/syna2g.html 

I wanted to apply some other def for html.

However, def files on that site, and the others in \defs\ directory are not of the same structure...

How far can one go with defs on YAF?

- can I change colors and sytles (I believe not, just askin':lol:) from def file?

Neven wrote:

I noticed that too, Neven. I didn't write this code, but it looks like it's a "lite" version of the syntax highlighting code. Anyone is welcome to take a look at it inside the Highlighter.cs file in /classes.

The code looks well written -- but language parsing is always something that's a bit more advanced.

Of course, if someone found something better then the current code, I wouldn't necessarily be against implementing it.

ehsan
  • ehsan
  • 51.8% (Neutral)
  • YAF Forumling
14 years ago
:?:

Is it be possible to have syntax highlighting when we are using "TinyMCE(HTML)" editor? If yes, please mention how can I define [code] tag?

Thanks,

Ehsan