Sie sind nicht angemeldet.

Dienstag, 16. April 2024, 08:56 UTC+2

ShadowByte

Administrator

  • »ShadowByte« ist der Autor dieses Themas

Beiträge: 1 166

Wohnort: Essen

Beruf: Fachinformatiker (AE)

  • Nachricht senden

1

Montag, 18. Januar 2010, 11:43

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-Quelltext

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


[mysql ]Code[/mysql ]

MySQL-Abfrage(n)

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-Quelltext

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-Quelltext

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


[c ]Code[/c ]

C/C++-Quelltext

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


[php ]Code[/php ]

PHP-Quelltext

1
echo "Hallo Welt";


[code ]Code[/code ]

Quellcode

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

Covenant-Forum.de

Facebook

1010011010



Ähnliche Themen

Social Bookmarks