[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/treesit-fold 86c3e73746 135/417: Add html summary parser
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/treesit-fold 86c3e73746 135/417: Add html summary parser |
Date: |
Mon, 1 Jul 2024 10:02:19 -0400 (EDT) |
branch: elpa/treesit-fold
commit 86c3e73746a884f3b77cf2e09500a25a285da075
Author: Jen-Chieh <jcs090218@gmail.com>
Commit: Jen-Chieh <jcs090218@gmail.com>
Add html summary parser
---
tree-sitter-fold-summary.el | 32 +++++++++++++++++++-------------
tree-sitter-fold.el | 1 -
2 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/tree-sitter-fold-summary.el b/tree-sitter-fold-summary.el
index aa548b8f80..5218214697 100644
--- a/tree-sitter-fold-summary.el
+++ b/tree-sitter-fold-summary.el
@@ -97,43 +97,43 @@ type of content by checking the word boundary's existence."
(tree-sitter-fold-summary--doc-extract doc-str sym)))
(defun tree-sitter-fold-summary-batch (doc-str)
- "Extract batch summary from DOC-STR."
+ "Extract summary from DOC-STR in Batch."
(tree-sitter-fold-summary--generic doc-str '("::" "rem" "REM")))
(defun tree-sitter-fold-summary-csharp-vsdoc (doc-str)
- "Extract C# vsdoc summary from DOC-STR."
+ "Extract summary from DOC-STR in C# vsdoc."
(let ((type-triple (string-match-p "///" doc-str)))
(setq doc-str (s-replace-regexp "<[/]*[^>]+." "" doc-str))
(tree-sitter-fold-summary--generic doc-str (if type-triple "///" "//"))))
(defun tree-sitter-fold-summary-csharp (doc-str)
- "Extract summary for C# from DOC-STR."
+ "Extract summary from DOC-STR in C#."
(cond ((string-match-p "///" doc-str)
(tree-sitter-fold-summary-csharp-vsdoc doc-str))
(t (tree-sitter-fold-summary-javadoc doc-str))))
(defun tree-sitter-fold-summary-javadoc (doc-str)
- "Extract javadoc summary from DOC-STR."
+ "Extract summary from DOC-STR in Javadoc."
(tree-sitter-fold-summary--generic doc-str "*"))
(defun tree-sitter-fold-summary-go (doc-str)
- "Extract Go document summary from DOC-STR."
+ "Extract summary from DOC-STR in Go."
(tree-sitter-fold-summary--generic doc-str "//"))
(defun tree-sitter-fold-summary-lua-doc (doc-str)
- "Extract Lua document string from DOC-STR."
+ "Extract summary from DOC-STR in Lua."
(tree-sitter-fold-summary--generic doc-str "--"))
(defun tree-sitter-fold-summary-python-doc (doc-str)
- "Extract Python document string from DOC-STR."
+ "Extract summary from DOC-STR in Python."
(tree-sitter-fold-summary--generic doc-str "\"\"\""))
(defun tree-sitter-fold-summary-ruby-doc (doc-str)
- "Extract Ruby document string from DOC-STR."
+ "Extract summary from DOC-STR in Ruby."
(tree-sitter-fold-summary--generic doc-str "#"))
(defun tree-sitter-fold-summary-rust-doc (doc-str)
- "Extract Rust document summary from DOC-STR."
+ "Extract summary from DOC-STR in Rust."
(tree-sitter-fold-summary--generic doc-str "///"))
(defun tree-sitter-fold-summary-c-macro (doc-str)
@@ -144,18 +144,22 @@ type of content by checking the word boundary's
existence."
(tree-sitter-fold-summary--doc-extract doc-str "")))
(defun tree-sitter-fold-summary-c (doc-str)
- "Summary parser for C from DOC-STR."
+ "Extract summary from DOC-STR in C comment."
(or (tree-sitter-fold-summary-javadoc doc-str)
(tree-sitter-fold-summary-c-macro doc-str)))
(defun tree-sitter-fold-summary-markdown (doc-str)
- "Extract Makrdown block from DOC-STR."
+ "Extract summary from DOC-STR in Markdown block."
(tree-sitter-fold-summary--doc-extract doc-str '()))
(defun tree-sitter-fold-summary-org (doc-str)
- "Extract Org block from DOC-STR."
+ "Extract summary from DOC-STR in Org block."
(tree-sitter-fold-summary--doc-extract doc-str '()))
+(defun tree-sitter-fold-summary-xml (doc-str)
+ "Extract summary from DOC-STR in XML."
+ (tree-sitter-fold-summary--generic doc-str "-"))
+
;;
;; (@* "Core" )
;;
@@ -196,6 +200,7 @@ type of content by checking the word boundary's existence."
(c++-mode . tree-sitter-fold-summary-c)
(csharp-mode . tree-sitter-fold-summary-csharp)
(go-mode . tree-sitter-fold-summary-go)
+ (html-mode . tree-sitter-fold-summary-xml)
(java-mode . tree-sitter-fold-summary-javadoc)
(javascript-mode . tree-sitter-fold-summary-javadoc)
(js-mode . tree-sitter-fold-summary-javadoc)
@@ -214,7 +219,8 @@ type of content by checking the word boundary's existence."
(scala-mode . tree-sitter-fold-summary-javadoc)
(sh-mode . tree-sitter-fold-summary-javadoc)
(swift-mode . tree-sitter-fold-summary-c)
- (typescript-mode . tree-sitter-fold-summary-javadoc))
+ (typescript-mode . tree-sitter-fold-summary-javadoc)
+ (nxml-mode . tree-sitter-fold-summary-xml))
"Alist mapping major-mode to doc parser function."
:type 'hook
:group 'tree-sitter-fold)
diff --git a/tree-sitter-fold.el b/tree-sitter-fold.el
index 84ce1e3602..daf7f785e3 100644
--- a/tree-sitter-fold.el
+++ b/tree-sitter-fold.el
@@ -71,7 +71,6 @@ The alist is in form of (major-mode . (foldable-node-type)).")
(ess-r-mode . ,(tree-sitter-fold-parsers-r))
(go-mode . ,(tree-sitter-fold-parsers-go))
(html-mode . ,(tree-sitter-fold-parsers-html))
- (mhtml-mode . ,(tree-sitter-fold-parsers-html))
(java-mode . ,(tree-sitter-fold-parsers-java))
(javascript-mode . ,(tree-sitter-fold-parsers-javascript))
(js-mode . ,(tree-sitter-fold-parsers-javascript))
- [nongnu] elpa/treesit-fold 42d059d7db 314/417: feat: Add HLSL support (#93), (continued)
- [nongnu] elpa/treesit-fold 42d059d7db 314/417: feat: Add HLSL support (#93), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 70b2c79ff4 308/417: changelog, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 0627723e5f 368/417: Rename license with no ext, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold aa6146bc62 313/417: feat: Add Lisp support (#92), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 9717243a85 347/417: feat: Add Tablegen support, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 44a237a329 359/417: fixed linting issues in parsers, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 757d2fab67 346/417: feat: Add ActionScript support, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 0b7eb8fb5b 410/417: typo, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold f66e2b8be9 417/417: perf: Wait for post command to render, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold ca1b5d701d 134/417: Update doc, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 86c3e73746 135/417: Add html summary parser,
ELPA Syncer <=
- [nongnu] elpa/treesit-fold 20f96511ef 137/417: Update doc, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 40163da28a 141/417: Update doc, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold f297d8a664 204/417: update, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 4f5ea58d8c 214/417: Update copyright year, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 5711d9f6d5 226/417: refactor(parsers): Place it in alphabetic order, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 443ba5106a 229/417: feat(ruby): Enhance Ruby parser (#26), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 3b2e70db92 231/417: tests(test.yml): Add workflow_dispatch, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 0bae1476a4 242/417: chore: Changelog and styles (#38), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 6178f3345c 193/417: update ci, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 095e093737 194/417: Remove unused shell entry, ELPA Syncer, 2024/07/01