User Tools

Site Tools


howto:syntax

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howto:syntax [2020/08/09 16:46] va7fihowto:syntax [2024/08/03 08:51] (current) – [Control Macros] va7fi
Line 464: Line 464:
  
  
-===== Embedding HTML and PHP =====+===== Embedding HTML =====
  
-You can embed raw HTML or PHP code into your documents by using the ''%%<html>%%'' or ''%%<php>%%'' tags. (Use uppercase tags if you need to enclose block level elements.)+You can embed raw HTML code into your documents by using the ''%%<html>%%'' tag. (Use uppercase tags if you need to enclose block level elements.)
  
 HTML example: HTML example:
  
-<code>+<code html>
 <html> <html>
 This is some <span style="color:red;font-size:150%;">inline HTML</span> This is some <span style="color:red;font-size:150%;">inline HTML</span>
Line 486: Line 486:
 </HTML> </HTML>
  
-PHP example: 
  
-<code> +**Please Note**: HTML embedding requires the [[doku>plugin:confightmlok |htmlok plugin]] Without it, the code is displayed instead of executed.
-<php> +
-echo 'The PHP version: '; +
-echo phpversion(); +
-echo ' (generated inline HTML)'; +
-</php> +
-<PHP> +
-echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>'; +
-echo '<td>'.phpversion().'</td>'; +
-echo '</tr></table>'; +
-</PHP> +
-</code> +
- +
-<php> +
-echo 'The PHP version: '; +
-echo phpversion(); +
-echo ' (inline HTML)'; +
-</php> +
-<PHP> +
-echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>'; +
-echo '<td>'.phpversion().'</td>'; +
-echo '</tr></table>'; +
-</PHP> +
- +
-**Please Note**: HTML and PHP embedding is disabled by default in the configurationIf disabled, the code is displayed instead of executed.+
  
 ===== RSS/ATOM Feed Aggregation ===== ===== RSS/ATOM Feed Aggregation =====
Line 539: Line 514:
 ===== Control Macros ===== ===== Control Macros =====
  
-Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble:+Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are available:
  
 ^ Macro           ^ Description | ^ Macro           ^ Description |
 | %%~~NOTOC~~%%   | If this macro is found on the page, no table of contents will be created | | %%~~NOTOC~~%%   | If this macro is found on the page, no table of contents will be created |
-| %%~~NOCACHE~~%% | DokuWiki caches all output by default. Sometimes this might not be wanted (eg. when the %%<php>%% syntax above is used), adding this macro will force DokuWiki to rerender a page on every call |+| %%~~NOCACHE~~%% | DokuWiki caches all output by default. Sometimes this might not be wanted (adding this macro will force DokuWiki to rerender a page on every call |
  
 ===== Syntax Plugins ===== ===== Syntax Plugins =====
howto/syntax.1597016786.txt.gz · Last modified: 2020/08/09 16:46 by va7fi