2

I'd like to export headings with particular names/tags, with a particular set of export options, to particular file locations.

I'd like to do this all via elisp, so that I can have it part of a larger script which then pushes the changes to server. Also there will be multiple sets of overlapping documents/headings exported in different ways, so having all the settings in separate elisp scripts using project-alists allows more flexibility then adding annotations to the files or headings themselves.

As a concrete example, I might want to output a.org::*h to foo.html and b.org to bar.html, with a set of publish settings. foo.html in this case should only contain the contents of the h heading, with child headings of h exported as top level headings in foo.html.

The only way I can see how to do this is to hackily pre-process with a script that copies over parts I want into a new directory (into files with those specific names) and then publishing from there. I'm not sure how to do that in a way that doesn't have unexpected side effects, and am curious if there is a better way?

An ideal solution would enable me to:

  • Specify headings to export, and corresponding output file names.
  • Use project-alist so that I can describe other export settings and combine these export "projects" as needed.
  • Ensure links worked, even as headings are transformed into separate files.
  • I think that much of what you want to do may be accomplished through customizing org-publish-project-alist, but maybe you will have to write your own export function. – wvxvw Jul 12 '15 at 12:22
  • I can't see how either of those would help given my reading of the docs and source code, can you elaborate? org-publish-project-alist doesn't let you specify headings to export (though I might use it's pre/post-process directives), and I'm not sure what the benefit would be of writing a new export function. I realized this is a "big" question, so I broke it up a little and seperately asked: emacs.stackexchange.com/questions/14090/… – avv Jul 20 '15 at 0:24
  • Yes, this is roughly as I imagined (I thought using :completion-function would be something like what you wanted, though probably I was wrong). – wvxvw Jul 20 '15 at 5:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.