emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] ox-publish export subtree scopes?


From: Adonay Felipe Nogueira
Subject: Re: [O] ox-publish export subtree scopes?
Date: Mon, 15 Jan 2018 19:27:29 -0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Rasmus, emacs-orgmode, what's the status of this?

2017-12-05T19:10:17+0000 Kaushal Modi wrote:
> Hello Rasmus,
>
> I'd like to make the ox-publish based exporting working for my ox-hugo[1]
> package but so far have been unsuccessful.
>
> The main reason is that org-foo-publish-to-bar functions take only plist,
> filename and pub-dir as args. I miss the ability to first pick a subtree
> scope from the specific Org file and then export only that. Is something like
> that already possible which I am missing?
>
> In addition, when given a file name, I need to auto-decide (i) if I need to
> cycle through "valid" subtrees (see more about that below) and export those
> subtrees,or (ii) export the whole Org file if #+TITLE is present.
>
> So I ended up with org-hugo-export-wim-to-md[2] ("wim" stands for What I
> Mean). Below is a snippet from its doc string:
>
> =====
> - If the current subtree has the \"EXPORT_FILE_NAME\" property, export
> that subtree.
> - If the current subtree doesn't have that property, but one of its
> parent subtrees has, then export from that subtree's scope.
> - If none of the subtrees have that property (or if there are no Org
> subtrees at all), but the Org #+TITLE keyword is present,
> export the whole Org file as a post with that title (calls
> `org-hugo-export-to-md' with its SUBTREEP argument set to nil).
>
> - If ALL-SUBTREES is non-nil, export all valid Hugo post subtrees
> \(that have the \"EXPORT_FILE_NAME\" property) in the current file
> to multiple Markdown posts.
> - If ALL-SUBTREES is non-nil, and again if none of the subtrees have
> that property (or if there are no Org subtrees), but the Org #+TITLE
> keyword is present, export the whole Org file.
>
> - If the file neither has valid Hugo post subtrees, nor has the
> #+TITLE present, throw a user error. If NOERROR is non-nil, use
> `message' to display the error message instead of signaling a user
> error.
> =====
>
> And I use a Makefile[3] to find all Org files in the current directly and
> call the above function, which then does the right thing as explained in the
> conditions above.
>
> Is there any way to call org-publish to export either the entire file or
> cycle through the file and export the subtrees matching a predicate?
>
> [1]: https://github.com/kaushalmodi/ox-hugo
> [2]:
> https://github.com/kaushalmodi/ox-hugo/blob/832a5d7424013f60b77354ec28613440afac0269/ox-hugo.el#L2424-L2448
>
> [3]: https://github.com/kaushalmodi/ox-hugo/blob/master/Makefile

-- 
- https://libreplanet.org/wiki/User:Adfeno
- Palestrante e consultor sobre /software/ livre (não confundir com
  gratis).
- "WhatsApp"? Ele não é livre. Por favor, veja formas de se comunicar
  instantaneamente comigo no endereço abaixo.
- Contato: https://libreplanet.org/wiki/User:Adfeno#vCard
- Arquivos comuns aceitos (apenas sem DRM): Corel Draw, Microsoft
  Office, MP3, MP4, WMA, WMV.
- Arquivos comuns aceitos e enviados: CSV, GNU Dia, GNU Emacs Org, GNU
  GIMP, Inkscape SVG, JPG, LibreOffice (padrão ODF), OGG, OPUS, PDF
  (apenas sem DRM), PNG, TXT, WEBM.



reply via email to

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