I have hundreds Org files under a directory hierarchy and would want to export only those recently modified in HTML to speed up the process. I have the following project alist that I feed up to
`("html" :base-directory "~/Org/wiki" :base-extension "org" :include ,(my/org-files-to-publish) :with-broken-links t :publishing-directory "~/Org/wiki" :publishing-function org-html-publish-to-html)
(my/org-files-to-publish) returns recent Org files to export.
It seems that
org-publish considers not only files of
:include but also unconditionally those immediately under the root directory (e.g.
Question: How to export exactly a list of Org files to HTML ?
:exclude accepts only regex and not a files list, I can't find a reliable way to do what I want beside looping on
org-publish-file plus some extra stuff
P.S. This theory is confirmed by checking the output of
set-difference :test 'equal between
org-publish-get-base-files PROJECT and
my/org-files-to-publishis only called once above: when you define
org-publish-project-alistin the first place. Once that has been done, the
:includelist is set for the duration of the session. So the problem is NOT how to export exactly a list of Org files: you do that by setting the
:includeproperty. Your problem seems to be: how to dynamically change the
:includeproperty so that its value is the result of the function call. Am I understanding the problem correctly?
org-publish-project-alist, I use a project alist that I feed up to
org-publishwhenever I'm publishing. So
my/org-files-to-publishis called each time, and the list of files indeed changes dynamically. I print the list length to make sure this really happens. Now, no matter what list I'm exporting, it always exports and start by the first-level files unconditionally (even if the list doesn't include them). And this is because
org-publish) includes them by calling
:includethose files exclusively.