ox-publish index allows alternative formats?

2023-07-24 Thread Britt Anderson
Question:

Could ~:makeindex~ (in the ~org-publish-project-alist~) be expanded to
accept a user provided function for formatting the output differently?

Background: 

I am using org for a static website (brittanderson.github.io). I wanted
to make a list of blog posts subdivided by topic and I decided to use
~:makeindex~. I add ~#+Index: keyword~ lines to the preamble of the
posts and the list is generated, however I did not like the formatting.
It gave me a list of keywords as links (often repeated) with no context
(like title or date). So I hacked this alternative:
https://brittanderson.github.io/posts/theindex.html

It seems like it would be nice to allow users to provide their own
formatting functions to ~org-publish-index-generate-theindex~. Similar
to the way that ~:sitemap-function~ allows a user controlled sitemap.
I altered a few lines to do this for myself (as seen in the diff below),
but am unsure whether there is any more general interest in expanding
the index functionality or where in the org hierarchy would be the best
place to try and code such that ~:makeindex~ can be nil, 'default or the
name of a user provided function that expects one argument (to become
~target~). 

My question is whether this is something that is worth doing, and if it
is worth doing how hard should it be for a novice to attempt, and does
anyone have any pointers for how to tackle it?

-- Britt Anderson

My example of minor edits:

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 3c7311b56..d04c15fd5 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -1109,15 +1109,16 @@ publishing directory."
;; Last term: Link it to TARGET, if possible.
(let ((target (nth 2 idx)))
  (format
-  "[[%s][%s]]"
-  ;; Destination.
+  "*%s* [[%s]]"
+   (car (last entry))
+   ;; Destination.
   (pcase (car target)
 (`nil (format "file:%s" file))
 (`id (format "id:%s" (cdr target)))
 (`custom-id (format "file:%s::#%s" file (cdr target)))
 (_ (format "file:%s::*%s" file (cdr target
   ;; Description.
-  (car (last entry)
+  )))
  "\n"
(setq current-letter letter last-entry entry
   ;; Create "theindex.org", if it doesn't exist yet, and provide




Re: [O] org-list-make-subtree produces JSON readtable error: 47

2019-04-30 Thread Britt Anderson
Britt Anderson  writes:

> Whether or not I use the keyboard short cut or M-x. Any idea what may be
> causing this?
>
> (org-version)
> "9.2.3"
> (emacs-version)
> "GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
>  of 2019-04-12"
>
>
> Thanks

Appears to be caused by a conflict with ob-ipython. Will post issue
there. /Britt




Re: [O] org-list-make-subtree produces JSON readtable error: 47

2019-04-30 Thread Britt Anderson
Britt Anderson  writes:

> Whether or not I use the keyboard short cut or M-x. Any idea what may be
> causing this?
>
> (org-version)
> "9.2.3"
> (emacs-version)
> "GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
>  of 2019-04-12"
>
>
> Thanks

Seems to be caused by a conflict with ob-ipython. Will report issue
there.



[O] org-list-make-subtree produces JSON readtable error: 47

2019-04-30 Thread Britt Anderson
Whether or not I use the keyboard short cut or M-x. Any idea what may be
causing this?

(org-version)
"9.2.3"
(emacs-version)
"GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
 of 2019-04-12"


Thanks




[O] org-copy-subtree: Invalid function: org-preserve-local-variables

2019-01-07 Thread Britt Anderson
Using org version 9.2 and emacs version 26.1 I received the error in the
subject line when trying to move or archive subtrees. It seems to me
that this is related to the

(eval-and-compile (require 'org-macs))

line in org.el as replacing it with (require 'org-macs) solved that
problem.

Can someone tell me whether this is actually related to something else
that I may have set up faulty or whether there is a more correct fix.

Thanks,