fix(snippets): adaptive heading level; subject mirror in heading+table

This commit is contained in:
2026-02-24 15:15:14 +01:00
parent 54d6fb27ed
commit f363782bd5
4 changed files with 21 additions and 20 deletions

View File

@@ -2,22 +2,22 @@
# name: ADR - Architectural Decision Record
# key: ;adr
# --
* `(let ((max-id 0)) (save-excursion (goto-char (point-min)) (while (re-search-forward "^\\* ADR-\\([0-9]+\\)" nil t) (setq max-id (max max-id (string-to-number (match-string 1)))))) (format "ADR-%04d" (1+ max-id)))` - ${1:Subject}
`(make-string (1+ (or (org-current-level) 0)) ?*)` ${1:`(let ((max-id 0)) (save-excursion (goto-char (point-min)) (while (re-search-forward (concat "^\\*+ ADR-\\([0-9]+\\)") nil t) (setq max-id (max max-id (string-to-number (match-string 1)))))) (format "ADR-%04d" (1+ max-id)))`} - ${2:Subject}
| *ID* | `(let ((max-id 0)) (save-excursion (goto-char (point-min)) (while (re-search-forward "^\\* ADR-\\([0-9]+\\)" nil t) (setq max-id (max max-id (string-to-number (match-string 1)))))) (format "ADR-%04d" (1+ max-id)))` |
| *Subject* | ${1:Subject} |
| *Status* | ${2:Proposed} |
| *ID* | $1 |
| *Subject* | $2 |
| *Status* | ${3:Proposed} |
| *Date* | `(format-time-string "%Y-%m-%d")` |
*** Problem statement
`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Problem statement
*** Decision
`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Decision
*** Alternatives
`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Alternatives
*** Justification
`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Justification
*** Implications
`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Implications
*** Derived requirements
`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Derived requirements
$0