Outils pour utilisateurs

Outils du site


start

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
start [2025/09/10 16:50] ztrulphcsstart [2025/10/18 09:06] (Version actuelle) – modification externe 127.0.0.1
Ligne 5: Ligne 5:
 This is my welcome page, almost empty. The goal is just to show that DW is running. This is my welcome page, almost empty. The goal is just to show that DW is running.
  
 +===== sample texts from dokuwiki.org =====
  
 +
 +A rough diagram of the relationships between these components;
 +<file>
 +    +-----------+          +-----------+
 +    |            Input    Client   |
 +    |  Parser   |<---------|   Code    |
 +    |            String  |           |
 +    +-----.-----+          +-----|-----+
 +  Modes                       /|\
 +    +                 Renderer |
 +  Input            Instructions|
 +  String \|/                     |
 +    +-----'-----+          +-----------+
 +    |                    |           |
 +    |  Lexer    |---------> Handler  |
 +    |            Tokens  |           |
 +    +-----.-----+          +-----------+
 +          |
 +          |
 +     +----+---+
 +     | Modes  |-+
 +     +--------+ |-+
 +       +--------+ |
 +         +--------+
 +</file>
 +
 +
 +<code php>
 +$handler = new MyHandler();
 +$lexer = new dokuwiki\Lexer\Lexer($handler, 'base', true);
 +</code>
 +
 +Here the initial mode here is called 'base'.
 +
 +== addEntryPattern / addExitPattern ==
 +[[xref>addEntryPattern()]] and [[xref>addExitPattern()]] are used to register a pattern for entering and exiting a particular parsing mode. For example;
 +
 +<code php>
 +// arg0: regex to match - note no need to add start/end pattern delimiters
 +// arg1: name of mode where this entry pattern may be used
 +// arg2: name of mode to enter
 +$lexer->addEntryPattern('<file>','base','file');
 +
 +// arg0: regex to match
 +// arg1: name of mode to exit
 +$lexer->addExitPattern('</file>','file');
 +</code>
  
start.1757515801.txt.gz · Dernière modification : de ztrulphcs