I would like to display code - How to do this?
Updated on Sat, 2014-10-18 18:11 by testadmin. Originally created by jeromel on 2006-12-26 21:44.
Under:
unlike the use of <pre></pre> which would display
Code can be displayed in filtered HTML or full HTML. To display code, you have two solutions:
- Use the regular <pre></pre> HTML tags
- Use the <code></code> tag
Using the second, Drupal will format your code using the VIM-color module. Note that the <code> syntax can recognize code automatically from the first line like in
<code type="perl"> #!/usr/local/bin/perl use DBI; print "Hello world\n"; </code>
which will be displayed as
#!/usr/local/bin/perl use DBI; print "Hello world\n";
WARNING: Note that switching between enable rich-text and normal mode while using <code> may scramble your formating. This was also noted in ... create a cross-reference to another page.
»
- Printer-friendly version
- Login or register to post comments