emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* index for HTML export
@ 2022-07-13 14:28 Fraga, Eric
  2022-07-13 14:47 ` Fraga, Eric
  2022-07-13 22:35 ` Ihor Radchenko
  0 siblings, 2 replies; 9+ messages in thread
From: Fraga, Eric @ 2022-07-13 14:28 UTC (permalink / raw)
  To: Emacs Org mode mailing list

Hello all,

I know (well, I believe as I haven't tried yet) I can /publish/ a
project and generate an index using the #+index entries in the org
files.  However, for a single file, is it possible to generate the index
as part of the export process directly (or even separately from the
export process)?  I can do this when I export to LaTeX, for instance.

Thank you,
eric

-- 
: Eric S Fraga, with org release_9.5.4-623-gc66bdb in Emacs 29.0.50

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: index for HTML export
  2022-07-13 14:28 index for HTML export Fraga, Eric
@ 2022-07-13 14:47 ` Fraga, Eric
  2022-07-13 15:58   ` Fraga, Eric
  2022-07-13 22:35 ` Ihor Radchenko
  1 sibling, 1 reply; 9+ messages in thread
From: Fraga, Eric @ 2022-07-13 14:47 UTC (permalink / raw)
  To: Org Mode List

... and following up on this, when trying to /publish/ instead of just
export, I am failing miserably.  I created a simple project definition
but every time I try to publish either a specific file or the project, I
get (with file name partly elided):

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument stringp 101)
expand-file-name(101 "/home/ucecesf/...")
  #f(compiled-function (f) #<bytecode 0x1a85d5a52409b4e8>)(101)
  mapcar(#f(compiled-function (f) #<bytecode 0x1a85d5a52409b4e8>) "export.org")
  #f(compiled-function (p) #<bytecode 0x39f8919f842a987>)(("test" :base-directory "/home/ucecesf/..." :publishing-function org-html-publish-to-html :publishing-directory "/home/ucecesf/..." :include "export.org" :makeindex t))
  cl-some(#f(compiled-function (p) #<bytecode 0x39f8919f842a987>) (("test" :base-directory "/home/ucecesf/..." :publishing-function org-html-publish-to-html :publishing-directory "/home/ucecesf/..." :include "export.org" :makeindex t)))
  org-publish-get-project-from-filename("/home/ucecesf/...")
  org-publish-file("/home/ucecesf/...")
  org-publish-current-file(nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  command-execute(org-export-dispatch)
--8<---------------cut here---------------end--------------->8---

I will try to create a minimal example and with emacs -Q later but I
have used publishing fine in the past for my website.  The example here
is based on the very simple example in the org info manual.

Thank you,
eric
-- 
Eric S Fraga, @ericsfraga:matrix.org, GnuPG: 0xc89193d8fffcf67d

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: index for HTML export
  2022-07-13 14:47 ` Fraga, Eric
@ 2022-07-13 15:58   ` Fraga, Eric
  2022-07-13 16:05     ` Fraga, Eric
  0 siblings, 1 reply; 9+ messages in thread
From: Fraga, Eric @ 2022-07-13 15:58 UTC (permalink / raw)
  To: Org Mode List

So publishing cannot have the target directory be the same as the source
directory, it would seem?  Having a different directory for
:publishing-directory makes publishing work.  I still do not understand
the error, however.

My original question remains: can we create an index for HTML export
without using publishing?

Thank you,
eric

-- 
: Eric S Fraga, with org release_9.5.4-623-gc66bdb in Emacs 29.0.50

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: index for HTML export
  2022-07-13 15:58   ` Fraga, Eric
@ 2022-07-13 16:05     ` Fraga, Eric
  2022-07-14  6:13       ` Jens Lechtenboerger
  0 siblings, 1 reply; 9+ messages in thread
From: Fraga, Eric @ 2022-07-13 16:05 UTC (permalink / raw)
  To: Org Mode List

(apologies for flurry of emails)

Publishing works, in the sense that my org file is exported to HTML just
fine.  An index file is created but is not populated with any index
links.  What am I missing?  The info page is less than helpful
unfortunately.  Are index lines, e.g.

#+index: test!org publishing

processed in any way?

Thank you,
eric

PS -it's a lovely day here in the SE of England so time to enjoy a beer
in the garden!  Talk to you all tomorrow. :-)

-- 
: Eric S Fraga, with org release_9.5.4-623-gc66bdb in Emacs 29.0.50

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: index for HTML export
  2022-07-13 14:28 index for HTML export Fraga, Eric
  2022-07-13 14:47 ` Fraga, Eric
@ 2022-07-13 22:35 ` Ihor Radchenko
  1 sibling, 0 replies; 9+ messages in thread
From: Ihor Radchenko @ 2022-07-13 22:35 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Emacs Org mode mailing list

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> I know (well, I believe as I haven't tried yet) I can /publish/ a
> project and generate an index using the #+index entries in the org
> files.  However, for a single file, is it possible to generate the index
> as part of the export process directly (or even separately from the
> export process)?  I can do this when I export to LaTeX, for instance.

Timothy is working on this feature. See
https://github.com/tecosaur/org-glossary

Best,
Ihor


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: index for HTML export
  2022-07-13 16:05     ` Fraga, Eric
@ 2022-07-14  6:13       ` Jens Lechtenboerger
  2022-07-14  7:01         ` Fraga, Eric
  0 siblings, 1 reply; 9+ messages in thread
From: Jens Lechtenboerger @ 2022-07-14  6:13 UTC (permalink / raw)
  To: Org Mode List

On 2022-07-13, Fraga, Eric wrote:

> Publishing works, in the sense that my org file is exported to HTML just
> fine.  An index file is created but is not populated with any index
> links.  What am I missing?  The info page is less than helpful
> unfortunately.  Are index lines, e.g.
>
> #+index: test!org publishing
>
> processed in any way?

Over here, yes: https://oer.gitlab.io/OS/index-terms.html

I use this in my publish code:

	   (list "org-presentations"
		 :base-directory "."
		 :base-extension "org"
		 :makeindex oer-reveal-publish-makeindex
		 :exclude "index\\|backmatter\\|config\\|course-list\\|license-template\\|imprint\\|privacy\\|README\\|CONTRIBUTING\\|CHANGELOG"
		 :publishing-function oer-reveal-publish-org-publishing-functions
		 :publishing-directory "./public")

where oer-reveal-publish-makeindex is t and my publish.el makes sure
to publish to HTML:
https://gitlab.com/oer/OS/-/blob/master/elisp/publish.el

  (list "index-terms"
	:base-directory "."
	;; A file theindex.org (which includes theindex.inc)
	;; is created due to assignment to
	;; oer-reveal-publish-makeindex above.
	;; Using that setting, the file is automatically published with
	;; org-re-reveal, which is useless.
	;; Thus, publish as HTML here.  For this to work, index-terms.org
	;; is a manually created file including theindex.inc.
	;; The preparation and completion functions below set up an
	;; advice on org-html-link to rewrite links into presentations
	;; using org-re-reveal's anchor format.
	:include '("index-terms.org")
	:exclude ".*"
	:preparation-function 'oer-reveal--add-advice-link
	:completion-function 'oer-reveal--remove-advice-link
	:publishing-function '(org-html-publish-to-html)
	:publishing-directory "./public")

So, do you see theindex.org and theindex.inc?  Do you publish the
former?

Best wishes
Jens


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: index for HTML export
  2022-07-14  6:13       ` Jens Lechtenboerger
@ 2022-07-14  7:01         ` Fraga, Eric
  2022-07-14  7:18           ` Jens Lechtenboerger
  0 siblings, 1 reply; 9+ messages in thread
From: Fraga, Eric @ 2022-07-14  7:01 UTC (permalink / raw)
  To: Org Mode List

On Thursday, 14 Jul 2022 at 08:13, Jens Lechtenboerger wrote:
>   (list "index-terms"

[...]

>         :preparation-function 'oer-reveal--add-advice-link
>         :completion-function 'oer-reveal--remove-advice-link
>         :publishing-function '(org-html-publish-to-html)
>         :publishing-directory "./public")
>
> So, do you see theindex.org and theindex.inc?  Do you publish the
> former?

Yes, I do see theindex.org and theindex.inc but there are no index
entries.  What do the first two functions listed above do?

-- 
: Eric S Fraga, with org release_9.5.4-623-gc66bdb in Emacs 29.0.50

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: index for HTML export
  2022-07-14  7:01         ` Fraga, Eric
@ 2022-07-14  7:18           ` Jens Lechtenboerger
  2022-07-14  8:02             ` Fraga, Eric
  0 siblings, 1 reply; 9+ messages in thread
From: Jens Lechtenboerger @ 2022-07-14  7:18 UTC (permalink / raw)
  To: Org Mode List

[-- Attachment #1: Type: text/plain, Size: 935 bytes --]

On 2022-07-14, Fraga, Eric wrote:

> On Thursday, 14 Jul 2022 at 08:13, Jens Lechtenboerger wrote:
>>   (list "index-terms"
>
> [...]
>
>>         :preparation-function 'oer-reveal--add-advice-link
>>         :completion-function 'oer-reveal--remove-advice-link
>>         :publishing-function '(org-html-publish-to-html)
>>         :publishing-directory "./public")
>>
>> So, do you see theindex.org and theindex.inc?  Do you publish the
>> former?
>
> Yes, I do see theindex.org and theindex.inc but there are no index
> entries.

That is strange.  File theindex.inc should contain the index entries.
I believe that “:makeindex t” on the Org source files with #+INDEX:
entries should do the job.

> What do the first two functions listed above do?

They adapt the link format for my specific export backend (to point
to slides of presentations).  That is not relevant in your case.

Best wishes
Jens

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 6187 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: index for HTML export
  2022-07-14  7:18           ` Jens Lechtenboerger
@ 2022-07-14  8:02             ` Fraga, Eric
  0 siblings, 0 replies; 9+ messages in thread
From: Fraga, Eric @ 2022-07-14  8:02 UTC (permalink / raw)
  To: Org Mode List

On Thursday, 14 Jul 2022 at 09:18, Jens Lechtenboerger wrote:
> That is strange.  File theindex.inc should contain the index entries.
> I believe that “:makeindex t” on the Org source files with #+INDEX:
> entries should do the job.

Well, it seems that index generation by publishing works with "emacs -Q"
so there's something in my configuration that is stopping things
working.  Time to drill down in my init files...

Thank you,
eric
-- 
: Eric S Fraga, with org release_9.5.4-623-gc66bdb in Emacs 29.0.50

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-07-14  8:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-13 14:28 index for HTML export Fraga, Eric
2022-07-13 14:47 ` Fraga, Eric
2022-07-13 15:58   ` Fraga, Eric
2022-07-13 16:05     ` Fraga, Eric
2022-07-14  6:13       ` Jens Lechtenboerger
2022-07-14  7:01         ` Fraga, Eric
2022-07-14  7:18           ` Jens Lechtenboerger
2022-07-14  8:02             ` Fraga, Eric
2022-07-13 22:35 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).