feat: add autocompletion for TAGS inside :PROPERTIES:

Resolved #757
pull/1570/head
Tienson Qin 2021-03-31 00:40:17 +08:00
parent ee95b5070b
commit be01f3e0b7
2 changed files with 8 additions and 26 deletions

View File

@ -2241,24 +2241,3 @@
(when alias? [:span.text-sm.font-medium.opacity-50 " Alias"])]
(blocks-container blocks config))])))]
(blocks-container blocks config))])
(comment
;; timestamps
;; [2020-02-10 Mon 13:22]
;; repetition
(def r1 "<2005-10-01 Sat +1m>")
;; TODO: mldoc add supports
(def r2 "<2005-10-01 Sat +1m -3d>")
(def l
"1. First item
hello world
2. Second item
nice
3. Third item")
(def t
"| Name | Phone | Age |
|-------+-------+-----|
| Peter | 1234 | 17 |
| Anna | 4321 | 25 |"))

View File

@ -171,13 +171,16 @@
(let [properties (into {} properties)
page-refs (->>
(map (fn [v]
(when v
(->> (re-seq text/page-ref-re v)
(map second)
(map string/lower-case))))
(when (string? v)
(let [page-refs (->> (re-seq text/page-ref-re v)
(map second))
tags (->> (string/split v #",")
(filter (fn [s] (= \# (first s))))
(map (fn [s] (subs s 1))))]
(concat page-refs tags))))
(vals properties))
(apply concat)
(distinct))
(remove string/blank?))
properties (->> properties
(medley/map-kv (fn [k v]
(let [v (string/trim v)