Pma2wiki: Difference between revisions
fix nesting of <source> |
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight" |
||
| Line 9: | Line 9: | ||
* format of the table defintion 'headings' into the H2 heading format suitable for posting into MediaWiki | * format of the table defintion 'headings' into the H2 heading format suitable for posting into MediaWiki | ||
* This process creates easy to navigate and reference SQL schema files in the wiki | * This process creates easy to navigate and reference SQL schema files in the wiki | ||
* The exact tag output by this script (<sql> or < | * The exact tag output by this script (<sql> or <syntaxhighlight lang=sql>) must correlate with the MediaWiki extension you use to get syntax highlighting | ||
* In any case, you need to have a GeSHi syntax highlighting extension active in your MediaWiki installation. | * In any case, you need to have a GeSHi syntax highlighting extension active in your MediaWiki installation. | ||
* | * | ||
| Line 85: | Line 85: | ||
$pattern = '/(CREATE TABLE [^;]+;)/U'; | $pattern = '/(CREATE TABLE [^;]+;)/U'; | ||
// depends on GeSHi and which extension you have | // depends on GeSHi and which extension you have | ||
$replacement = '< | $replacement = '<syntaxhighlight lang=sql> | ||
$1 | $1 | ||
</ | </syntaxhighlight> | ||
'; | '; | ||
$content = preg_replace ($pattern, $replacement, $content); | $content = preg_replace ($pattern, $replacement, $content); | ||