aboutsummaryrefslogtreecommitdiff
path: root/doc/ref/javascript/user-additions.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ref/javascript/user-additions.texi')
-rw-r--r--doc/ref/javascript/user-additions.texi18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/ref/javascript/user-additions.texi b/doc/ref/javascript/user-additions.texi
new file mode 100644
index 00000000..706b1dd4
--- /dev/null
+++ b/doc/ref/javascript/user-additions.texi
@@ -0,0 +1,18 @@
+@node user-additions.js
+@section user-additions.js
+
+Some things in the JavaScript code is built to be user-extendable.
+The HTML-page attempts to load @code{/static/user/user-additions.js}.
+
+
+Currently; this only entails @ref{formatters}, where you could, for
+example, parse all HTTP-links in a description.
+
+@example
+window.formatters.set('description', (el, d) => @{
+ el.innerHTML = d.replaceAll(/https?:\/\/\S+/g, '<a href="$&">$&</a>');
+@})
+@end example
+
+Remember that the documents are X-HTML, so be @emph{extremely} careful
+with innerHTML.