summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-08-16 12:33:01 +0200
committerThomas F. K. Jorna <[email protected]>2021-08-16 12:33:01 +0200
commite57a19e17456f971ffec61a07613c7065c1c3abc (patch)
treea49f0250aab7b8f92c3ba985fe1968b0ba0d02b9
parentccf8dd47bdb04289cce7ae690d9ce21c09254a01 (diff)
fix:#65 include citet and citep keywords
-rw-r--r--org-roam-ui.el13
-rw-r--r--pages/index.tsx4
2 files changed, 7 insertions, 10 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el
index efea3af..d1bdd07 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -133,8 +133,8 @@ Defaults to #'browse-url."
(defvar oru-ws nil
"The websocket for org-roam-ui.")
-(defvar org-roam-ui-ws
- "The websocket server for org-roam-ui.")
+;; (defvar org-roam-ui-ws nil
+;; "The websocket server for org-roam-ui.")
;;;###autoload
(define-minor-mode
@@ -155,7 +155,6 @@ This serves the web-build and API over HTTP."
(org-roam-ui-mode
;;; check if the default keywords actually exist on `orb-preformat-keywords'
;;; else add them
- ;; (org-roam-ui--check-orb-keywords) ;
(setq-local httpd-port org-roam-ui-port)
(setq httpd-root org-roam-ui/app-build-dir)
(httpd-start)
@@ -298,7 +297,7 @@ unchanged."
(links-db-rows (org-roam-db-query `[:select ,links-columns
:from links
:left :outer :join refs :on (= links:dest refs:ref)
- :where (or (= links:type "id") (= links:type "cite"))]))
+ :where (in links:type ["cite", "citet", "citep", "id"])]))
;; Convert any cite links that have nodes with associated refs to an
;; id based link of type `ref' while removing the 'nil `refs:node-id'
;; from all other links
@@ -307,7 +306,7 @@ unchanged."
(if node-id
(list source node-id "ref")
(list source dest type)))) links-db-rows))
- (links-with-empty-refs (seq-filter (lambda (l) (equal (nth 2 l) "cite")) links-db-rows))
+ (links-with-empty-refs (seq-filter (lambda (l) (string-match-p "cite" (nth 2 l))) links-db-rows))
(empty-refs (delete-dups (seq-map (lambda (l) (nth 1 l)) links-with-empty-refs)))
(fake-nodes (seq-map 'org-roam-ui--create-fake-node empty-refs))
;; Try to update real nodes that are reference with a title build from
@@ -327,9 +326,7 @@ unchanged."
(let* ((node (org-roam-id-at-point)))
(unless (string= org-roam-ui--ws-current-node node)
(setq org-roam-ui--ws-current-node node)
- (websocket-send-text oru-ws (json-encode `((type . "command")
- (data. ((commandName . "follow")
- (id . ,node))))))))))
+ (websocket-send-text oru-ws (json-encode `((type . "command") (data . ((commandName . "follow") (id . ,node))))))))))
(defun org-roam-ui--update-theme ()
diff --git a/pages/index.tsx b/pages/index.tsx
index e2cda84..7434e3d 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -1006,7 +1006,7 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) {
visuals.highlightFade * opacity,
)
}
- if (visuals.citeLinkColor && roamLink.type === 'cite') {
+ if (visuals.citeLinkColor && roamLink.type.includes('cite')) {
return needsHighlighting && (visuals.citeLinkHighlightColor || visuals.linkHighlight)
? highlightColors[visuals.citeLinkColor][
visuals.citeLinkHighlightColor || visuals.linkHighlight
@@ -1138,7 +1138,7 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) {
{...graphCommonProps}
linkLineDash={(link) => {
const linkArg = link as OrgRoamLink
- if (visuals.citeDashes && linkArg.type === 'cite') {
+ if (visuals.citeDashes && linkArg.type.includes('cite')) {
return [visuals.citeDashLength, visuals.citeGapLength]
}
if (visuals.refDashes && linkArg.type == 'ref') {