[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [ox-publish, patch] More flexible sitemaps

From: Nicolas Goaziou
Subject: Re: [O] [ox-publish, patch] More flexible sitemaps
Date: Wed, 20 Jul 2016 09:56:34 +0200


Rasmus <address@hidden> writes:

> Sorry about the slow reply.  Sometimes there's not enough time.

So true.

> I obviously agree with your criticism.  It’s not obvious how to do this
> properly.
> If we provide a backend we’d have to move the index preparation to
> beginning of each export process as :publishing-function can be a list.
> Also, I’m not sure how we’d know about the backend.  Before the exporting
> starts, we at most know the names of the functions right?  If one of the
> publishing functions is anonymous we don’t even have that.
> Perhaps the best way is to move keywords back to ox, though I’d rather opt
> for something else.

You're right, "ox-publish" is mostly back-end agnostic so the
information is not readily available.

However, we're creating an Org file here. We don't need to have parsed
values for keywords. So, what about simply looking for, e.g., #+SUBTITLE
value in the document and use it instead as a template replacement? IOW,
what about eschewing so-called "environment" altogether?

>>> +    ;; Call function to build sitemap based on files and the project-plist.
>>> +    (let* ((style (or (plist-get project-plist :sitemap-style) 'tree))
>>> +           (fun (intern (format "org-publish-org-sitemap-as-%s" style))))
>> Side note : I think this is a bit too smart. It prevents, e.g., from
>> grepping for a function name. Maybe 
>>   (if (eq style 'something) #'... #'....)
>> would be better.
> The point is that it should be easy to supply your own functions.  All
> sorts of requirements for the index/sitemap could come up, and it is
> important to not limit to the tree-style and the flat-style.

But that's outside the scope of the patch currently considered. My point
is that we should avoid forging function names as a UI.

> I might want to provide an index ordered by keywords, say.
> Perhaps styles should be stores in an alist with elements like

Some functions may handle multiple styles, as `org-publish-org-sitemap'
does. Besides, any user-provided sitemap function is likely to handle
its own style without relying on :sitemap-style property.

Therefore, providing :sitemap-function and :sitemap-style is enough,
there's no need to merge them together.



Nicolas Goaziou

reply via email to

[Prev in Thread] Current Thread [Next in Thread]