You are not logged in.

Tuesday, April 16th 2024, 11:32am UTC+2

Dear visitor, welcome to official Covenant Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

ShadowByte

Administrator

  • "ShadowByte" started this thread

Posts: 1,166

Location: Essen

Occupation: Fachinformatiker (AE)

  • Send private message

1

Monday, January 18th 2010, 11:43am

BBCodes zur Darstellung von Quellcode

Hallo,

das Forum stellt folgende BBCodes zur Darstellung von Quellcode bereit:
immer ohne Leerzeichen innerhalb von [bbcode] und [/bbcode]
  • Java [java ]Code[/java ]
  • MySQL [mysql ]Code[/mysql ]
  • CSS [css ]Code[/css ]
  • HTML [html ]Code[/html ]
  • XML [xml ]Code[/xml ]
  • TPL (Templates) [tpl ]Code[/tpl ]
  • JS (JavaScript) [js ]Code[/js ]
  • C (C / C++) [c ]Code[/c ]
  • PHP [php ]Code[/php ]
  • Code (wird verwendet wenn kein anderer BBCode passt) [code ]Code[/code ]


Bei jedem BBCode kann eine Zeilennummer mit angegeben werden. z.B.: [ php=30 ]Code[/php ]
Das kann nützlich sein, wenn man eine Fehlermeldung mit Zeilennummernangabe hat und hier die passenden Codezeilen +-10 Zeilen posten möchte.

Beispiele:
[java ]Code[/java ]

Java source code

1
2
3
4
5
 public class HalloWelt {
     public static void main(String[] args) {
         System.out.println("Hallo Welt!");
     }
 }


[mysql ]Code[/mysql ]

MySQL queries

1
2
3
SELECT * 
FROM   `Tabelle` 
WHERE ID=1;


[css ]Code[/css ]

Cascading style sheet

1
2
3
.hot {
	font-weight: bold;
}


[html ]Code[/html ]

HTML

1
2
3
4
5
6
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="de">
   <head>
	<title>Mein Seitentitel</title>
   </head>


[xml ]Code[/xml ]

XML

1
2
3
4
5
<?xml version="1.0"?>
<!DOCTYPE data SYSTEM "http://www.woltlab.com/DTDs/options.dtd">
<data>
   <option name="myXML"></option>
</data>


[tpl ]Code[/tpl ]

Template source code

1
2
3
4
5
6
7
8
9
10
11
12
{include file="documentHeader"}
<head>
	<title>{lang}index.title{/lang} - {lang}{PAGE_TITLE}{/lang}</title>
	
	{include file='headInclude' sandbox=false}
	<link rel="alternate" type="application/rss+xml" href="index.php?format=rss2" title="{lang}index.feed{/lang} (RSS2)" />
	<link rel="alternate" type="application/atom+xml" href="index.php?format=atom" title="{lang}index.feed{/lang} (Atom)" />
</head>
<body{if $templateName|isset} id="tpl{$templateName|ucfirst}"{/if}>
{include file='header' sandbox=false}

<div id="main">


[js ]Code[/js ]

Javascript source code

1
2
3
function AjaxRequest() {
	this.xmlHttpRequest = null;
	this.response = null;


[c ]Code[/c ]

C/C++ Source code

1
2
3
4
5
6
7
#include <iostream>
#include <ostream>
 
int main() 
{
   std::cout << "Hallo Welt!" << std::endl;
}


[php ]Code[/php ]

PHP Source code

1
echo "Hallo Welt";


[code ]Code[/code ]

Source code

1
echo "Hallo Welt";
Nichts ist wahr! Alles ist erlaubt !

Covenant-Forum.de

Facebook

1010011010



Similar threads

Social bookmarks