<commit_before># <slot name="title">pWiki Macros</slot>

## Syntax

Any macro can be used in any of the two forms, either _inline_ or _HTML-like_.

Inline:
```
@macro-name(arg)
```

HTML-style:
```
<macro-name arg="value"/>

<macro-name arg="value">
  ...text...
</macro-name>
```

The two forms are almost identical, with the only difference being that the 
inline form does not support body text (note that some macros may provide
this functionality as an argument, namely `slot`).

The two forms exist to fill two distinct functions:
- inline: compatible with attribute values and short
- html-like: element-like, simpler when dealing with html

### Escaping macros

Macros can be escaped for inclusion in the page, the two types of macros 
are escaped a bit differently:

- inline macros -- escaped by preceding with a `\`

  ```
  \\@include(SomePage)
  ```

  Displayed in page as:

  \@include(SomePage)

  _NOTE: if displayed on github, this will show an extra "\" in both 
  cases, this should be ignored as pWiki will consume the escaping "\" 
  in both the code example and the preview._


- html-like macros -- escaped _the HTML way_

  ```
  &lt;include src="SomePage"\&gt;
  ```

  Displayed in page as:

  &lt;include src="SomePage"\\&gt;




## Macros

### filter (name)

Enable or disable a page filter.

A filter is a way to transform the page source.

Arguments:
- `name` -- filter name. If name is preceded with a '-' then it <commit_msg>added @now() macro doc...<commit_after># <slot name="title">pWiki Macros</slot>

## Syntax

Any macro can be used in any of the two forms, either _inline_ or _HTML-like_.

Inline:
```
@macro-name(arg)
```

HTML-style:
```
<macro-name arg="value"/>

<macro-name arg="value">
  ...text...
</macro-name>
```

The two forms are almost identical, with the only difference being that the 
inline form does not support body text (note that some macros may provide
this functionality as an argument, namely `slot`).

The two forms exist to fill two distinct functions:
- inline: compatible with attribute values and short
- html-like: element-like, simpler when dealing with html

### Escaping macros

Macros can be escaped for inclusion in the page, the two types of macros 
are escaped a bit differently:

- inline macros -- escaped by preceding with a `\`

  ```
  \\@include(SomePage)
  ```

  Displayed in page as:

  \@include(SomePage)

  _NOTE: if displayed on github, this will show an extra "\" in both 
  cases, this should be ignored as pWiki will consume the escaping "\" 
  in both the code example and the preview._


- html-like macros -- escaped _the HTML way_

  ```
  &lt;include src="SomePage"\&gt;
  ```

  Displayed in page as:

  &lt;include src="SomePage"\\&gt;




## Macros

### now ()

Get current date in seconds since epoch, this is equivalet Javascript's
`Date.now()`.

This is mostly used for automatically creating paths (see: todo / outline)


### filter (name)

Enable or disable a page filter.

A filter is a way to transform the page source.

Arguments:
- `name` -- filter name. If name is preceded with a '-' then it 
{'fraction_non_alphanumeric': 0.1092139175257732, 'fraction_numerical': 0.0, 'mean_word_length': 3.519650655021834, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4190934', 'n_tokens_mistral': 977, 'n_tokens_neox': 910, 'n_words': 417}