summaryrefslogtreecommitdiff
path: root/docs/modules/api
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-11-07 23:51:00 -0700
committerDan Allen <dan.j.allen@gmail.com>2021-11-08 01:11:07 -0700
commitc57a291221edfa056bfec363acc84b1542d7743a (patch)
tree6c0d9d3771ff0607f2d035aa26a2306bfd1fbf50 /docs/modules/api
parentf28e26bd586d08ae2c639f7881eba7d1dba2bc1a (diff)
revise the docs for the :safe API option [skip ci]
Diffstat (limited to 'docs/modules/api')
-rw-r--r--docs/modules/api/pages/set-safe-mode.adoc28
1 files changed, 20 insertions, 8 deletions
diff --git a/docs/modules/api/pages/set-safe-mode.adoc b/docs/modules/api/pages/set-safe-mode.adoc
index 5548f24c..4d2480f7 100644
--- a/docs/modules/api/pages/set-safe-mode.adoc
+++ b/docs/modules/api/pages/set-safe-mode.adoc
@@ -1,21 +1,33 @@
= Set the Safe Mode Using the API
:navtitle: Set Safe Mode
-The default xref:ROOT:safe-modes.adoc[safe mode] in the API is `SECURE`.
-You can change the safe mode using a string, symbol or integer value.
+When using Asciidoctor via the API, the default xref:ROOT:safe-modes.adoc[safe mode] is `SECURE`.
+You can change the safe mode using the `:safe` API option.
== Set :safe option
-The value must be set in the document constructor using the `:safe` option.
+The safe mode can be controlled from the API using the `:safe` option.
+The `:safe` option is accepted by all xref:index.adoc#entrypoints[entrypoint methods] (e.g., `Asciidoctor#convert_file`).
- result = Asciidoctor.convert_file 'doc.adoc', safe: 'server'
+The `:safe` option accepts the safe mode as a string:
-or
+[,ruby]
+----
+Asciidoctor.convert_file 'doc.adoc', safe: 'server'
+----
- result = Asciidoctor.convert_file 'doc.adoc', safe: :server
+as a symbol (preferred):
-or
+[,ruby]
+----
+Asciidoctor.convert_file 'doc.adoc', safe: :server
+----
- result = Asciidoctor.convert_file 'doc.adoc', safe: 10
+as an integer:
+
+[,ruby]
+----
+Asciidoctor.convert_file 'doc.adoc', safe: 10
+----
You can also set the xref:cli:set-safe-mode.adoc[safe mode from the CLI] and xref:ROOT:reference-safe-mode.adoc[enable or disable content based on the current safe mode].