[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/devdocs df8888d 1/4: Add option to disable fontificatio
From: |
ELPA Syncer |
Subject: |
[elpa] externals/devdocs df8888d 1/4: Add option to disable fontification of code blocks |
Date: |
Sun, 6 Jun 2021 05:57:08 -0400 (EDT) |
branch: externals/devdocs
commit df8888d0183e1d09cb830f6d5fd078e62aa5cd8c
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>
Add option to disable fontification of code blocks
---
devdocs.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/devdocs.el b/devdocs.el
index 1d44957..a0f3431 100644
--- a/devdocs.el
+++ b/devdocs.el
@@ -69,9 +69,10 @@
"String used to format a documentation location, e.g. in header line."
:type 'string)
-(defvar devdocs--index (make-hash-table :test 'equal)
- "A hash table to cache document indices.
-To be accessed through the function `devdocs--index'.")
+(defcustom devdocs-fontify-code-blocks t
+ "Whether to fontify code snippets inside pre tags.
+Fontification is done using the `org-src' library, which see."
+ :type 'boolean)
(defvar devdocs-history nil
"History of documentation entries.")
@@ -282,7 +283,8 @@ with the order of appearance in the text."
"Insert and fontify pre-tag represented by DOM."
(let ((start (point)))
(shr-tag-pre dom)
- (when-let ((lang (dom-attr dom 'data-language)))
+ (when-let ((lang (and devdocs-fontify-code-blocks
+ (dom-attr dom 'data-language))))
(org-src-font-lock-fontify-block (downcase lang) start (point)))))
(defun devdocs--render (entry)