Syntax Highlighted Code

Latest news covering the Elysian Shadows project, The Chaos Rift forums, and our affiliate developers and projects. News also appears in the website's new section.

Moderators: News Mods, Elysian Shadows Team

Syntax Highlighted Code

Postby dandymcgee on Sun Nov 18, 2012 1:25 pm

To post code with syntax highlighting please use the code2 tag with an appropriate language value.

A Few Examples

Code: Select all
[code2=cpp]
int main(int argc, char** argv) {
   std::cout << "Hello Elysian Shadows Forums!";
}
[/code2]

... will look like ...

int main(int argc, char** argv) {
std::cout << "Hello Elysian Shadows Forums!";
}


Code: Select all
[code2=php]
<?php echo '<p>Hello Elysian Shadows Forums!</p>'; ?>
[/code2]

... will look like ...

<?php echo '<p>Hello Elysian Shadows Forums!</p>'; ?>

There are many other languages supported, the aliases should be easy to guess.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: Syntax Highlighted Code

Postby bbguimaraes on Sun Nov 18, 2012 2:23 pm

printf("%s", "Well,");

cout << "that";

echo was

print 'a'

print 'nice';

console.log('addition,');

(print "thank"); no lisp =(

.section        .rodata
string:
.ascii "you.\0"
length:
.quad . -string

.section .text
.globl _start
_start:
movq $4, %rax
movq $1, %rbx
movq $string, %rcx
movq length, %rdx
int $0x80
movq %rax, %rbx
movq $1, %rax
int $0x80
User avatar
bbguimaraes
Chaos Rift Junior
Chaos Rift Junior
 
Posts: 324
Joined: Wed Apr 11, 2012 5:34 pm
Location: Brazil

Re: Syntax Highlighted Code

Postby dandymcgee on Sun Nov 18, 2012 5:29 pm

Hmm, it's supposed to support Lisp but apparently it's not working. Must be too many parenthesis. :|

(((((Lisp)))))
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: Syntax Highlighted Code

Postby Falco Girgis on Mon Nov 19, 2012 12:21 pm

This thread gives me such a code boner... Fuck, I need to finish this coffee and get my sorry ass back to coding something...
"So what happens if the Elysian Shadows Kickstarter fails?"
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
 
Posts: 10693
Joined: Thu May 20, 2004 3:04 pm
Location: Studio Vorbis, AL

Re: Syntax Highlighted Code

Postby Nokurn on Wed Nov 21, 2012 6:41 pm

Awesome. I've been waiting for this since I started visiting ES. It's really difficult for me to grok most languages unless there is at least some minimal amount of highlighting, so up until this point I pasted code from the forums into Sublime to analyze it. Thanks for this.
User avatar
Nokurn
Chaos Rift Regular
Chaos Rift Regular
 
Posts: 174
Joined: Mon Jan 31, 2011 2:08 pm
Location: Southern California

Re: Syntax Highlighted Code

Postby bbguimaraes on Thu Nov 22, 2012 6:45 am

Nokurn wrote:It's really difficult for me to grok most languages unless there is at least some minimal amount of highlighting, so up until this point I pasted code from the forums into Sublime to analyze it.

Not that I can't understand the code, but there is an instant and natural joy when I run :syntax on on vim.
User avatar
bbguimaraes
Chaos Rift Junior
Chaos Rift Junior
 
Posts: 324
Joined: Wed Apr 11, 2012 5:34 pm
Location: Brazil


Return to Community News

Who is online

Users browsing this forum: No registered users and 1 guest