mob
icon = 'file.dmi'
var
example = 0 //comment
proc/Test()
while(1)
example++
if(example >= 5)
world << "string"
break
^ like the style formatting you see above. How can I get that for my own webpages?
I'm wondering how i can get the dm code style formatting on my own website
mob ^ like the style formatting you see above. How can I get that for my own webpages? |
![]() Dec 17 2012, 7:08 pm
|
|
You could use something like Rainbow for syntax highlighting.
|
Nevermind me I misread that. But if you were to use DMCGi you could use Lummox JR's syntax highlighter |
LordAndrew wrote:
You could use something like Rainbow for syntax highlighting. Thanks for the link / tip. Has anyone created a template for DM already? |
FIREking wrote:
A.T.H.K wrote: If you have installed BYOND globally using make install and you have apache running all you have to do is add it to the default file (if you are on apache2) Which is located in /etc/apache2/sites-available Under the <document> tag you must add Options Indexes FollowSymLinks MultiViews ExecCGI Do not copy and paste that add the .dmb and index.dmb to the current text same goes with the Options Indexes text it'll most likely just be missing ExecCGI Here is my default file so you can have a quick see at what I've done http://pastebin.com/m5kEPpPe |
If you want DM syntax highlighting on your site, I think you should install GeSHi, the Generic Syntax Highlighter. It's written entirely in PHP, with CSS output, so you don't have to worry about using Javascript. The GeSHi package comes with language files supporting over 200 programming languages right out of the box, and it's all free! It's also pretty easy to add and customize new languages. It's under constant active development, so it won't be buggy like those Javascript implementations.
It has a complete documentation on all the features. It's very flexible, so you can decide things like whether or not you want to show line numbers. A long while ago I made a DM Language File for GeSHi, based on the documentation, so you can try it out if you want. To my knowledge, it hasn't been tested, so I can't say if it works or not. The language files are essentially just PHP templates, so the format is pretty simple. GeSHi is also relatively easy to implement for phpBB forums, MediaWiki Wikis, and others. For MediaWiki, you can use an extension such as this one. In fact, even Wikipedia uses a GeSHi extension. Basically, GeSHi comes with all the hard work already done for you, so I can't really think of a good reason to use something else. I hope this is helpful. |
Multiverse7 wrote:
If you want DM syntax highlighting on your site, I think you should install GeSHi, the Generic Syntax Highlighter. It's written entirely in PHP, with CSS output, so you don't have to worry about using Javascript. The GeSHi package comes with language files supporting over 200 programming languages right out of the box, and it's all free! It's also pretty easy to add and customize new languages. It's under constant active development, so it won't be buggy like those Javascript implementations. This is more up my alley, as I do also plan to be hosting a private MediaWiki as well. Thanks for all the info. |
Multiverse7 wrote:
A long while ago I made a DM Language File for GeSHi, based on the documentation, so you can try it out if you want. To my knowledge, it hasn't been tested, so I can't say if it works or not. The language files are essentially just PHP templates, so the format is pretty simple. I think you forgot the keyword step. |
Hmm, I've got geshi up and running, and it seems to be parsing, but there's no color. All characters just come out black. No matter what language I specify.
For example: <?php gives me <pre class="php" style="font-family:monospace;">$foo = 45; |
Well, I got it to work with mediawiki. I haven't tried anywhere else on my site, but I don't need it anywhere else. The language file you made is almost right, but it has some weird tab / space situation going on which you can verify with langcheck.php in contrib folder of geshi installation. To fix it, I used notepad++ and removed all white space, then I replaced the entire comment section of your source because the documentation says you must. Then I used the <source> tag instead of the <syntaxhighlight> tag.
Your lang doesn't really change the color for comments or strings, but I'm still investigating that. Also, a fresh install for me produced some other issues with GeSHi. The font size was messed up. GeSHi automatically makes a wiki page in your wiki called MediaWiki:Geshi.css and you add this code there, to fix the font-size. /* CSS placed here will be applied to GeSHi syntax highlighting */ Edit: Updated code to include tab-size, which was by default 7 spaces instead of 4. |
Got the colors and highlights working, and here's the lang file.
http://pastebin.com/JUwbvhif Edit: link was updated. |
Super Saiyan X wrote:
Add step to the keywords, FIREking. Okay, please inform me what this "step" keyword is, because I'm obviously missing out on something. It doesn't seem to be highlighted in either Dream Maker or the BYOND site. I also can't find any sign of it in the reference or guide. I would assume is has nothing at all to do with any of the stepping procs related to movement. Anyway, I'm glad you actually got that to work! I have been busy these past few days, so I haven't been online much for a while. I also couldn't test out GeSHi, since I can't seem to get a virtual server up and running. Strangely, something seems to be blocking my access to my own localhost! It's all very annoying. PHP basically just exists too far on the other side of the networking fence, which is a big obstacle to testing. PHP runs server side, just like DM does. The difference between them is that DM comes with a fully functioning IDE right out of the box, while PHP just leaves you out in the cold, to set up your own server before you can even begin coding with it. Well, I just think that's awesome to see that highlighted DM code in a wiki (and a website outside this one)! By the looks of it, I'm guessing you set up a whole wiki devoted to the development of your game. That's what I call devoted. I think your game has the potential to really become a legend! As for the language file, we now need to fix some bugs. In fact, I think I already see one in that picture you posted. When brackets are placed inside of double quotes like that, the contents of them, and the brackets themselves, should be highlighted a kind of dark teal color. I may have left out that color at the time, since it was only a draft, and I wasn't sure how to approach the problem. This might be a bit tricky to implement. Checking the GeSHi documentation, I believe a solution can be found in one of the last few sections of chapter 4. Specifically, either Using Regular Expressions, Contextual Highlighting and Strict Mode, or Special Parser Settings (Experimental). I'm really not sure which should be used for this type of thing. There's probably more than one way this can be done. This implementation will have to replace the existing string hightlighting method, otherwise it might cause a conflict. Also, in case you didn't notice, I believe I made all the symbols/operators bold and the comments italic. I thought they might stand out better that way, but it's not the same as in Dream Maker. Here is a simple test you can try highlighting on your site, to check for bugs in the language file: arg |
Multiverse7 wrote:
Super Saiyan X wrote: The step he's referring to is utilized in for(), like so: mob It only highlights itself in Dream Maker if used within for(). |
That's interesting. I just don't think I have ever seen step used in a for() loop like that. I guess it's good for counting by a certain number.
|
Multiverse7 wrote:
Anyway, I'm glad you actually got that to work! I have been busy these past few days, so I haven't been online much for a while. I also couldn't test out GeSHi, since I can't seem to get a virtual server up and running. Strangely, something seems to be blocking my access to my own localhost! It's all very annoying. PHP basically just exists too far on the other side of the networking fence, which is a big obstacle to testing. PHP runs server side, just like DM does. The difference between them is that DM comes with a fully functioning IDE right out of the box, while PHP just leaves you out in the cold, to set up your own server before you can even begin coding with it. Its a lot easier to show my artist a wiki article to explain how something is supposed to work as opposed to a note pad file filled with loads of black text that doesn't keep any formatting what so ever. I can also change specifications on the fly and update documents on the go, which is really handle. Its really the ultimate tool for creating a Game Design Document, and keeping everyone on the same page on how things are supposed to work, not only in design, but also in code, and even in pixel art. Let me know if you figure out how to get the dark teal in teal string bracket thing working. That would be really nice to have! A lot of the GeSHi stuff is kinda greek to me. I get the gist of it, but I don't really know enough to do something advanced like that. BTW, Amazon's AWS offers a free micro for a year. You can run Ubuntu 12 on it for free, if you're into that type of stuff. We use AWS for everything! |