Author Topic: Code blocks  (Read 7404 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12726
  • London, England
Re: Code blocks
« Reply #30 on: April 23, 2013, 09:05:19 AM »
It might be the use of the <pre> tag enclosing the code block which could be causing the browser to include additional spaces found in the HTML markup.

As a workaround for my site (example), I avoided using the <pre> tag and instead used non-breaking space characters (&nbsp;) to replace spaces in the code - this seemed to solve the issue in FF (though of course IE still copies the line numbers).

TheMaster

  • Guest
Re: Code blocks
« Reply #31 on: April 23, 2013, 09:15:50 PM »
...

Try searching the '.NET' forum for 'GetObjects<T>', and you'll not find anything, even though there are plenty of posts with code that contains that string.

Oh, yes; the code is heavily reformatted by GeSHi and that would make searches a problem. Here's a "how long is a string question" for you; Are there a lot of instances (in .NET, I guess) where a user could be doing a search like that or would they mostly search `GetObjects' instead?  ...Actually, I can see that happening quite a bit now that I think about it.

I know this isn't the answer your looking for, and I'm not trying to belittle the thought either, but I think that we will have to force the age-old "ask better questions" stance and force people to use better subject lines and whatnot.

Thanks also for your efforts.

I found that the search issue I mentioned above isn't limited to GeSHi-fication of code blocks, it also affects regular text.  It appears that the search is done against the raw HTML, so the following search term will find "GetObjects<T>", but not in code blocks:

Code - Text: [Select]
  1. GetObjects&lt;T&gt

I suppose that the search term could be encoded to make it work for regular content, but the actual issue for me is searching for something in posted code.

I guess it boils down to priorities (syntax colorization verses searchable code).  For me, unsearchable code is a deal-breaker.

Jeff H

  • Needs a day job
  • Posts: 6117
Re: Code blocks
« Reply #32 on: April 23, 2013, 09:39:30 PM »
Another option would be to quit using generics. :ugly:

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Code blocks
« Reply #33 on: April 23, 2013, 09:44:27 PM »

I know you're joking, but to satisfy my reflex reaction ..

bite your tongue Jeff :)
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

TheMaster

  • Guest
Re: Code blocks
« Reply #34 on: April 23, 2013, 10:11:50 PM »
Another option would be to quit using generics. :ugly:

 :lol:

JohnK

  • Administrator
  • Seagull
  • Posts: 10170
Re: Code blocks
« Reply #35 on: April 24, 2013, 08:19:09 AM »
Thanks also for your efforts.

I found that the search issue I mentioned above isn't limited to GeSHi-fication of code blocks, it also affects regular text.  It appears that the search is done against the raw HTML, so the following search term will find "GetObjects<T>", but not in code blocks:

Code - Text: [Select]
  1. GetObjects&lt;T&gt

I suppose that the search term could be encoded to make it work for regular content, but the actual issue for me is searching for something in posted code.

I guess it boils down to priorities (syntax colorization verses searchable code).  For me, unsearchable code is a deal-breaker.

:) ..thanks.

I agree, unsearchable things in a forum/wiki almost defeats the whole point. I will dig around in the forum admin settings area (while I still have the rights) and see if I can't find anything but I wouldn't count on anything. I suspect this is a SMF issue so snooping around their forums for fixes and whatnot may get us further.  I will get back to you in a bit.

> syntax colorization verses ...
Check out some AutoLisp code and click on a function (IF, AND, COND, etc).  I created a help doc that can be used as well.  The colors are nice, but the "links to help" was one of the real features I thought was neat. [-i.e. I have a text editor for colors.]
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10170
Re: Code blocks
« Reply #36 on: April 24, 2013, 08:40:47 AM »
...
I will get back to you in a bit.

There is the ability to build an "search index" (from the database itself) and use it with the searches. I did a 5 minute read on this index feature and it sounds like this index can be HUGE. We'll have to ask Mark about the HD space, migrating, updating, and whatnot on his end. He has to maintain this server not me.
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

Mark

  • Custom Title
  • Seagull
  • Posts: 28725
Re: Code blocks
« Reply #37 on: April 24, 2013, 09:00:56 AM »
I was reading the same thing a few days ago. Space shouldn't be a problem. I'm not sure it will index the code blocks though. That's something that needs looked at.
TheSwamp.org  (serving the CAD community since 2003)

ribarm

  • Gator
  • Posts: 2829
  • Marko Ribar, architect
Re: Code blocks
« Reply #38 on: August 23, 2022, 03:18:20 AM »
I just want to revive this topic...
That code=cadlisp-7 seems to me now very old and IMHO needs some restoration... If you look at newly available programs like Notepad ++, or VLIDE, or BLADE, or Code Extension, or... , they all have very much better built-in tools for displaying colored code samples... Can some of those engines be used in improving that GeShi style... I've simply implemented some functions from Auto/Brics CAD by using (atoms-family) function... Yes it is for Notepad++, but for my eyes, it looks decent (especially with (vl*-xxx) functions)... If it could be used in some sort of a way, here is XML, but I don't know... I am just thinking loud - isn't www web design connected with software freebies and vs versa...
Anyway, this is now revived and so I had that feeling way long bogging my mind for a long time already...

Bye, M.R.
« Last Edit: August 23, 2022, 07:36:16 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube