summaryrefslogtreecommitdiff
path: root/docs/modules/api
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2023-11-20 02:43:51 -0700
committerDan Allen <dan.j.allen@gmail.com>2023-11-20 02:43:51 -0700
commit51cafcec08ee2fb82954eb82f63f0283a516a780 (patch)
tree31b22c680abdd7f41805d928c771d9161d27113f /docs/modules/api
parenta03949256721bdbc2a208cc7abe230396ce65f12 (diff)
document how to enable the catalog_assets option using an extension
Diffstat (limited to 'docs/modules/api')
-rw-r--r--docs/modules/api/pages/catalog-assets.adoc15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/modules/api/pages/catalog-assets.adoc b/docs/modules/api/pages/catalog-assets.adoc
index 04db7d30..5aa721de 100644
--- a/docs/modules/api/pages/catalog-assets.adoc
+++ b/docs/modules/api/pages/catalog-assets.adoc
@@ -46,6 +46,21 @@ doc = Asciidoctor.convert_file 'doc.adoc', safe: :safe, catalog_assets: true
Notice that we've used the `convert_file` method instead of the `load_file` method.
This ensures that inline assets are included in the catalog as well.
+If you need to enable the `:catalog_assets` option when using the CLI, you'll need to require the following extension:
+
+.enable-catalog-assets-preprocessor.rb
+[,ruby]
+----
+Asciidoctor::Extensions.register do
+ preprocessor do
+ process do |doc, reader|
+ doc.instance_variable_set :@options, ((doc.instance_variable_get :@options).merge catalog_assets: true)
+ nil
+ end
+ end
+end
+----
+
Now that you've configured the processor to catalog assets, you can access them from the document object.
Let's explore it.