Skip to content

Commit

Permalink
feat: expand macro tag section
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Oct 2, 2022
1 parent 246ef08 commit 2465505
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions 1.0-specification.norg
Original file line number Diff line number Diff line change
Expand Up @@ -797,19 +797,36 @@ version: 1.0
The content of the macro tag is /any/ norg markup - this includes {** structural detached
modifiers} and nested {* tags}. The macro tag is closed with the `=end` statement.

%TODO: explain that generally speaking, all tags are implemented as macros%
%TODO: show example macro%
Under the hood, all other {* tags}[tag] types are implemented as macros with special parameters
and contents.

The `next` and `...` arguments are automatically supplied. See the {:1.0-semantics:}[semantics
document] for more details.

Example:
The following is an example of a macro:
|example
=see url
(see {&url&})
=end
|end

It can then be invoked using any of the other tag types, for example the {** infirm tag}:
|example
This is a recipe for a cake
.see https://wikipedia.com/some-cool-cake-recipe
\- let's begin cooking!
|end

After macro expansion, this is what the document would look like:
|example
This is a recipe for a cake
(see {https://wikipedia.com/some-cool-cake-recipe})
\- let's begin cooking!
|end

Which, when reformatted, would look (and render) like so:
|example
This is a recipe for a cake (see {https://wikipedia.com/some-cool-cake-recipe}) - let's begin
cooking!
|end

*** Standard Ranged Tags
There are times where you may want to create an isolated block of Norg markup.
To do this you may use the standard ranged tag, which uses the `|` character.
Expand Down

0 comments on commit 2465505

Please sign in to comment.