From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [ox-publish, patch] More flexible sitemaps Date: Wed, 20 Jul 2016 09:56:34 +0200 Message-ID: <87shv47nf1.fsf@saiph.selenimh> References: <87eg8ydpli.fsf@gmx.us> <87twhpk8e1.fsf@saiph.selenimh> <87h9djv4gw.fsf@gmx.us> <87wpm8j527.fsf@saiph.selenimh> <87furlkefs.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPmMw-0000Z3-I6 for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 03:56:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPmMu-0003kO-Gq for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 03:56:37 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:46387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPmMu-0003kJ-AK for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 03:56:36 -0400 In-Reply-To: <87furlkefs.fsf@gmx.us> (rasmus@gmx.us's message of "Thu, 07 Jul 2016 11:03:35 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Rasmus Cc: emacs-orgmode@gnu.org, roklein@roklein.de Hello, Rasmus writes: > Sorry about the slow reply. Sometimes there's not enough time. So true. > I obviously agree with your criticism. It=E2=80=99s not obvious how to d= o this > properly. > > If we provide a backend we=E2=80=99d have to move the index preparation to > beginning of each export process as :publishing-function can be a list. > Also, I=E2=80=99m not sure how we=E2=80=99d know about the backend. Befo= re the exporting > starts, we at most know the names of the functions right? If one of the > publishing functions is anonymous we don=E2=80=99t even have that. > > Perhaps the best way is to move keywords back to ox, though I=E2=80=99d r= ather 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-pli= st. >>> + (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=20 >> >> (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 > > (STYLE STYLE-FUNCTION) ? 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. WDYT? Regards, --=20 Nicolas Goaziou