Nest org, md results at level 2 on Emacs interface. Improve readability

- Makes it easier to fold/unfold, traverse and read results
- This 2 level nesting is already being used on the web interface

- Previously we were using the original nesting depth of the entry.
  This was aimed at providing more of the orginal context of the
  results. But currently this additional information does not provide
  as much, for the decreased legibility of the results
This commit is contained in:
Debanjum Singh Solanky 2022-08-01 03:54:35 +03:00
parent dbc7ca74c9
commit 0ebfbb43ce

View file

@ -78,7 +78,10 @@
(format "# %s\n%s"
query
(mapcar
(lambda (args) (format "%s" (cdr (assoc 'entry args))))
(lambda (args)
(replace-regexp-in-string
"^\#+" "##"
(format "%s" (cdr (assoc 'entry args)))))
json-response))))
(defun khoj--extract-entries-as-org (json-response query)
@ -90,8 +93,11 @@
(format "* %s\n%s"
query
(mapcar
(lambda (args) (format "%s" (cdr (assoc 'entry args))))
json-response))))
(lambda (args)
(replace-regexp-in-string
"^\*+" "**"
(format "%s" (cdr (assoc 'entry args)))))
json-response))))
(defun khoj--extract-entries-as-images (json-response query)
"Convert json response from API to html with images"