PDA

View Full Version : Colored LISP in forum


Wolfgang
10-17-2005, 10:26 AM
well.. just a try.. but the single quotes (forward-only) are mixing up the PHP highlighter.


(sd-defdialog 'thread_extension
:dialog-title (sd-multi-lang-string "Thread Define" :german "Gewinde Def.")
:after-initialization
'(progn
(trace oli::sd-define-thread
oli::sd-inq-thread
oli::sd-destroy-thread
)
(setf profile nil)
)
:mutual-exclusion '( (nomi-dia nomi-dia-inch) (pitch TPI))
:variables
`(
(t-feedbacks :initial-value nil) ;; all feedbacks shown
(result :initial-value nil) ;; saved return value of sd-*-thread functions
(props :initial-value nil) ;; cylinder face properties
(a-cyl-face
:selection *sd-cylinder-seltype*
:title (sd-multi-lang-string "Cyl Face" :german "Zyl. Flaeche")
:check-function
#'(lambda (this-face)
(if (sd-cylinder-p (SD-INQ-GEO-PROPS this-face))
:ok
(values :error
(sd-multi-lang-string
"No cylindrical face selected. Thread Information is only valid for a cylindrical face."
:german "Keine Zylinderflaeche gewaehlt. Gewindedefinition nur bei zylindrischen Flaechen moeglich.")
)))
:after-input
(let (center axis start radius)
(dolist (a-fb t-feedbacks) (sd-end-point-feedback a-fb)) ;; remove old feedback

(setf props (sd-inq-geo-props a-cyl-face :dest-space :global))
(setf center (sd-cylinder-center props)) ;; really the center , also in axis direction!
(setf axis (sd-cylinder-axis-dir props))
(setf start (sd-cylinder-start-dir props)) ;; this is for rotaion,
(setf radius (sd-cylinder-radius props))

(push ;; center of cylinder
(sd-start-direction-feedback
:point center :direction axis :disc t :color 0,0,1)
t-feedbacks)

(sd-set-variable-status 't-define :enable t)
) ;; end after-input
) ;; end a-cylface
;; -------------------------------------------------------------------
;; direct testing:
:optional
:presets


I tried the HTML vb_code, too. But this made more problems.

What's the way such a higlighter is defined in our forum software? I'm a little bit familiar with generating highlighter files for different (freeware) editors. There does my interest come from..

John Scheffel
10-17-2005, 12:04 PM
What's the way such a higlighter is defined in our forum software? I'm a little bit familiar with generating highlighter files for different (freeware) editors. There does my interest come from..
Interesting attempt. I never tried color coding the LISP in the CODE tags. I never thought of trying the PHP tags, but they seem to maintain indents better.

I don't know of any way to do this with the standard vBulletin software, but since it is delivered as PHP source code the hacking possibilities are unlimited. There is an entire website devoted to vBulletin hacking which includes many tested and published customizations at www.vbulletin.org (http://www.vbulletin.org). You might be able to find what you are looking for there.

I prefer to avoid hacking the PHP code since it makes upgrading difficult, but if it is fairly simple I would be willing to consider it. We do have a few simple hacks applied to this forum already.

Wolfgang
10-18-2005, 10:52 AM
oh I used the PHP several times before (for 2..3 lines only).. but this time it was a test how far it is working.

Well, I already was looking into those support pages for vBulletin software. But since everything of vBulletin software behind the UI of my browser is new for me it will take a while. But I assume there are some ASCII files arround which define a) which vB code are allowed and b) how they will format the included text. So I think it's a more kind of advanced customization than a hack. --- or would you call it a hack of OSDM when editing sd_customize file :) :)

But it will take a while... but winter is in front of us, with long dark nights. ;)

John Scheffel
10-18-2005, 02:58 PM
But I assume there are some ASCII files arround which define a) which vB code are allowed and b) how they will format the included text. So I think it's a more kind of advanced customization than a hack. --- or would you call it a hack of OSDM when editing sd_customize file :) :)
I consider anything which requires modifying one of the PHP source files a hack. We have a couple of simple ones. They are difficult to maintain since everytime that PHP file is updated you need to recreate your modifications in the new file. Some of these files are updated in almost every patch.

Stuff that can be done from the Admin Control panel, such as modifying the templates that define the page appearance, I would call customization. It can still be a pain to maintain if the original templates are modified, but there are some tools to help and this happens less often. We have some of these as well.

The Admin panel does have options for adding and managing custom BB codes, but I have never played with it. It is documented in the vbulletin manual at:

http://www.vbulletin.com/docs/html/

If you have anything you would like to try, let me know.

I searched vbulletin.org for "lisp" and "code AND color" but could not find any examples of how to create color highlighted program code.

Wolfgang
10-23-2005, 04:42 AM
Thanks for finding out some more information, too.

That documentation decribes only how to add SIMPLE vb_tags which can be converted to HTML by just replacing the opening vb_code with it's HTML tags and same for the closing one.

For the existing PHP and HTML vb_codes the text written between opening and closing vb_tag is parsed (word by word etc.) and depending on some rules the color coding is done. This is really different from the simple vb_codes. - So some more time needed for investigation. - I hesitate to set up a complete webserver for my own incl. PHP and vBulletin stuff.

Wolfgang
10-23-2005, 04:53 AM
Just would like to see how PHP does lool like here in our forum:

/*
this php example was taken from
http://www.php-scripts.com/php_diary/example24a.phps
*/

srand(time());
for($i = 0; $i < 52; $i++)
{
$count = count($cards);
$random = (rand()%$count);
if($cards[$random] == "")
{
$i--;
}
else
{
$deck[] = $cards[$random];
$cards[$random] = "";
}
}

srand(time());
$starting_point = (rand()%51);
print("Starting point for cut cards is: $starting_point<p>");

// display shuffled cards (EXAMPLE ONLY)
for ($index = 0; $index < 52; $index++)
{
if ($starting_point == 52) { $starting_point = 0; }
print("Uncut Point: <strong>$deck[$index]</strong> ");
print("Starting Point: <strong>$deck[$starting_point]</strong><br>");
$starting_point++;
}

Wolfgang
07-03-2008, 02:32 PM
<title>ueberschrift</title>
<body>
<p>bla bla bla <b>bold</b>
</p>

-----------------------------
<?php
echo '[b]test';
?>
-----------------------------
caused on the discussions on future of this forum.... I have been searching for vBulletin information once more and stumbled about:

Advanced Syntax Highlighting - BBCode [ highlight ] (http://www.vbulletin.org/forum/showthread.php?t=93071&page=3)
1 Product XML with 2 Plugins and 2 Templates
based on GeSHi - Generic Syntax Highlighter (http://qbnz.com/highlighter/index.php), which also does support LISP!

But looking to the very last postings (http://www.vbulletin.org/forum/showthread.php?t=93071&page=6) there still seemed to be some manually detailed changes needed.... so not really ready for use.. it's a pity.

John Scheffel
01-11-2011, 10:35 AM
The post and response about how CoCreate LISP compares to AutoLISP has been moved to a new thread in the Customization forum.

Comparison of CoCreate LISP and AutoLISP