Difference between revisions of "Dokuwiki"
From ThorstensHome
(→All) |
(→All) |
||
Line 41: | Line 41: | ||
= All = | = All = | ||
− | + | tweedleburg:/srv/www/htdocs/dokuwiki/inc # diff -rup parser.org/ parser | |
− | tweedleburg:/srv/www/htdocs/dokuwiki/inc # diff -rup parser.org/ parser | + | diff -rup parser.org//parser.php parser/parser.php |
− | diff -rup parser.org//parser.php parser/parser.php | + | --- parser.org//parser.php 2009-10-23 08:44:18.000000000 +0200 |
− | --- parser.org//parser.php 2009-10-23 08:44:18.000000000 +0200 | + | +++ parser/parser.php 2009-10-23 09:42:24.000000000 +0200 |
− | +++ parser/parser.php 2009-10-23 09:42:24.000000000 +0200 | + | @@ -221,7 +221,7 @@ class Doku_Parser_Mode_header extends Do |
− | @@ -221,7 +221,7 @@ class Doku_Parser_Mode_header extends Do | + | function preConnect() { |
− | + | //we're not picky about the closing ones, two are enough | |
− | + | $this->Lexer->addSpecialPattern( | |
− | + | - '[ \t]*={2,}[^\n]+={2,}[ \t]*(?=\n)', | |
− | - '[ \t]*={2,}[^\n]+={2,}[ \t]*(?=\n)', | + | + '[ \t]*={1,}[^\n]+={1,}[ \t]*(?=\n)', |
− | + '[ \t]*={1,}[^\n]+={1,}[ \t]*(?=\n)', | + | 'base', |
− | + | 'header' | |
− | + | ); | |
− | + | @@ -523,11 +523,11 @@ class Doku_Parser_Mode_preformatted exte | |
− | @@ -523,11 +523,11 @@ class Doku_Parser_Mode_preformatted exte | + | |
− | + | function connectTo($mode) { | |
− | + | // Has hard coded awareness of lists... | |
− | + | - $this->Lexer->addEntryPattern('\n (?![\*\-])',$mode,'preformatted'); | |
− | - $this->Lexer->addEntryPattern('\n (?![\*\-])',$mode,'preformatted'); | + | + $this->Lexer->addEntryPattern('\n (?![\*\-])',$mode,'preformatted'); |
− | + $this->Lexer->addEntryPattern('\n (?![\*\-])',$mode,'preformatted'); | + | $this->Lexer->addEntryPattern('\n\t(?![\*\-])',$mode,'preformatted'); |
− | + | ||
− | + | // How to effect a sub pattern with the Lexer! | |
− | + | - $this->Lexer->addPattern('\n ','preformatted'); | |
− | - $this->Lexer->addPattern('\n ','preformatted'); | + | + $this->Lexer->addPattern('\n ','preformatted'); |
− | + $this->Lexer->addPattern('\n ','preformatted'); | + | $this->Lexer->addPattern('\n\t','preformatted'); |
− | + | ||
− | + | } | |
− | + | @@ -545,11 +545,11 @@ class Doku_Parser_Mode_preformatted exte | |
− | @@ -545,11 +545,11 @@ class Doku_Parser_Mode_preformatted exte | + | class Doku_Parser_Mode_code extends Doku_Parser_Mode { |
− | + | ||
− | + | function connectTo($mode) { | |
− | + | - $this->Lexer->addEntryPattern('<code(?=.*</code>)',$mode,'code'); | |
− | - $this->Lexer->addEntryPattern('<code(?=.*</code>)',$mode,'code'); | + | + $this->Lexer->addEntryPattern('<pre(?=.*</pre>)',$mode,'code'); |
− | + $this->Lexer->addEntryPattern('<pre(?=.*</pre>)',$mode,'code'); | + | } |
− | + | ||
− | + | function postConnect() { | |
− | + | - $this->Lexer->addExitPattern('</code>','code'); | |
− | - $this->Lexer->addExitPattern('</code>','code'); | + | + $this->Lexer->addExitPattern('</pre>','code'); |
− | + $this->Lexer->addExitPattern('</pre>','code'); | + | } |
− | + | ||
− | + | function getSort() { | |
− | + | Only in parser: parser.php~ | |
− | Only in parser: parser.php~ | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
= See also = | = See also = | ||
* http://johbuc6.coconia.net/mediawiki2dokuwiki.php | * http://johbuc6.coconia.net/mediawiki2dokuwiki.php | ||
* http://www.dokuwiki.org/devel:parser?s[]=wiki&s[]=parser | * http://www.dokuwiki.org/devel:parser?s[]=wiki&s[]=parser |
Revision as of 09:40, 23 October 2009
This describes my patches to adapt Dokuwiki for my needs
Contents |
allow h6 headings
This is a little patch for dokuwiki to allow h6 headings.
/srv/www/htdocs/dokuwiki/inc/parser # diff -rup parser-org.php parser.php --- parser-org.php 2009-10-20 15:49:57.000000000 +0200 +++ parser.php 2009-10-20 15:48:25.000000000 +0200 @@ -223,7 +223,7 @@ class Doku_Parser_Mode_header extends Do function preConnect() { //we're not picky about the closing ones, two are enough $this->Lexer->addSpecialPattern( - '[ \t]*={2,}[^\n]+={2,}[ \t]*(?=\n)', + '[ \t]*={1,}[^\n]+={1,}[ \t]*(?=\n)', 'base', 'header' );
use mediawiki syntax in dokuwiki
Take a look at inc/parser/handler.php, function header().
preformatted
@@ -522,12 +523,13 @@ class Doku_Parser_Mode_html extends Doku class Doku_Parser_Mode_preformatted extends Doku_Parser_Mode { function connectTo($mode) { + echo "hi"; // Has hard coded awareness of lists... - $this->Lexer->addEntryPattern('\n (?![\*\-])',$mode,'preformatted'); + $this->Lexer->addEntryPattern('\n (?![\*\-])',$mode,'preformatted'); $this->Lexer->addEntryPattern('\n\t(?![\*\-])',$mode,'preformatted'); // How to effect a sub pattern with the Lexer! - $this->Lexer->addPattern('\n ','preformatted'); + $this->Lexer->addPattern('\n ','preformatted'); $this->Lexer->addPattern('\n\t','preformatted'); }
All
tweedleburg:/srv/www/htdocs/dokuwiki/inc # diff -rup parser.org/ parser diff -rup parser.org//parser.php parser/parser.php --- parser.org//parser.php 2009-10-23 08:44:18.000000000 +0200 +++ parser/parser.php 2009-10-23 09:42:24.000000000 +0200 @@ -221,7 +221,7 @@ class Doku_Parser_Mode_header extends Do function preConnect() { //we're not picky about the closing ones, two are enough $this->Lexer->addSpecialPattern( - '[ \t]*={2,}[^\n]+={2,}[ \t]*(?=\n)', + '[ \t]*={1,}[^\n]+={1,}[ \t]*(?=\n)', 'base', 'header' ); @@ -523,11 +523,11 @@ class Doku_Parser_Mode_preformatted exte function connectTo($mode) { // Has hard coded awareness of lists... - $this->Lexer->addEntryPattern('\n (?![\*\-])',$mode,'preformatted'); + $this->Lexer->addEntryPattern('\n (?![\*\-])',$mode,'preformatted'); $this->Lexer->addEntryPattern('\n\t(?![\*\-])',$mode,'preformatted'); // How to effect a sub pattern with the Lexer! - $this->Lexer->addPattern('\n ','preformatted'); + $this->Lexer->addPattern('\n ','preformatted'); $this->Lexer->addPattern('\n\t','preformatted'); } @@ -545,11 +545,11 @@ class Doku_Parser_Mode_preformatted exte class Doku_Parser_Mode_code extends Doku_Parser_Mode { function connectTo($mode) { - $this->Lexer->addEntryPattern('<code(?=.*</code>)',$mode,'code'); + $this->Lexer->addEntryPattern('<pre(?=.*</pre>)',$mode,'code'); } function postConnect() { - $this->Lexer->addExitPattern('</code>','code'); + $this->Lexer->addExitPattern('</pre>','code'); } function getSort() { Only in parser: parser.php~