summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-07-19 23:58:40 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-07-20 04:35:48 -0600
commit2d9671f592a11be193100b31bb24a1691c31abf8 (patch)
treee33bdb7f563ebf245e73eb6f0f76363d4ddd6796 /docs
parent843001d479c128fa884dd6ac891db629a76cdba6 (diff)
add more detail for how to apply substitutions to inline text in an extension
Diffstat (limited to 'docs')
-rw-r--r--docs/modules/extensions/pages/inline-macro-processor.adoc23
1 files changed, 18 insertions, 5 deletions
diff --git a/docs/modules/extensions/pages/inline-macro-processor.adoc b/docs/modules/extensions/pages/inline-macro-processor.adoc
index 4201c1ed..8e5a9078 100644
--- a/docs/modules/extensions/pages/inline-macro-processor.adoc
+++ b/docs/modules/extensions/pages/inline-macro-processor.adoc
@@ -63,18 +63,31 @@ This attribute accepts a symbol, an array of symbols, or a comma-separated strin
Let's say that we want normal substitutions to be applied to the text.
Here's how that can be done:
-[source,ruby]
+[,ruby]
----
-create_inline_pass parent, '*https://asciidoctor.org[Asciidoctor]*', attributes: { 'subs' => :normal }
+create_inline_pass parent, '*https://example.org[Learn more]*',
+ attributes: { 'subs' => :normal }
----
-This node will be converted into a link with bold link text.
+This inline passthrough node will produce a link that has link text with strong emphasis (i.e., bold).
You can also specify the substitutions as a string, which is parsed just like the value of the subs attribute on a block.
-[source,ruby]
+[,ruby]
----
-create_inline_pass parent, '*https://asciidoctor.org[Asciidoctor]*', attributes: { 'subs' => 'quotes,macros' }
+create_inline_pass parent, '*https://example.org[Learn more]*',
+ attributes: { 'subs' => 'quotes,macros' }
----
You can specify whichever substitutions you want applied, and in what order.
+
+Instead of creating an inline passthrough node, you can also create a span of formatted text with additional substitutions applied.
+
+[,ruby]
+----
+create_inline parent, :quoted, 'https://asciidoctor.org is _awesome_!',
+ attributes: { 'subs' => :quotes }
+----
+
+The `:quoted` primary type represents a span of formatted text.
+In this case, we don't need to apply the `macros` substitution since links have not yet been converted.