emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Nick Dokos <ndokos@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Cannot get the EXPORT_FILE_NAME override to work
Date: Thu, 04 May 2017 19:56:11 +0000	[thread overview]
Message-ID: <CAFyQvY2aD1B_NGn-rLyqz26GoSFES_bNfrjc7NpfHmGhC0Mnfw@mail.gmail.com> (raw)
In-Reply-To: <CAFyQvY1SQFayfgGojNQJZsyvGpK+2PtWGfgM5_g01SXU+aShCA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]

>
> On Thu, May 4, 2017 at 1:34 PM Nick Dokos <ndokos@gmail.com> wrote:
>
>> You could probably org-map your way
>> through the subtrees and export each one by calling
>>
>>    (org-export-as 'html t)
>>
>> N.B. the subtreep setting in this call.
>
>
Thanks for the tip. I ended up with this:

(let ((subtree-tags-to-export '("readme" "contributing"
                                "wikitcsh"))
      ;; If a subtree matches a tag, do not try to export further
      ;; subtrees separately that could be under that.
      (org-use-tag-inheritance nil)
      (org-export-with-toc nil)  ;Do not export TOC
      (org-export-with-tags nil)) ;Do not print tag names in exported files
  (dolist (tag subtree-tags-to-export)
    (let* ((exported-file-list (org-map-entries
'(org-gfm-export-to-markdown nil :subtreep) tag))
           ;; The assumption is that for each tag, *only* one file is
exported
           (exported-file (when exported-file-list
                            (car exported-file-list))))
      (when (string-match-p "\\`wiki.+" tag) ;Move the wiki files to the
correct directory
        (rename-file (expand-file-name exported-file eless-root-dir)
                     (expand-file-name exported-file eless-wiki-dir)
                     :ok-if-already-exists)))))

https://github.com/kaushalmodi/eless/blob/4c4aea14f7293b25644d48ebf90dbc68cf1b3654/build/build.el#L88-L104

-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 2466 bytes --]

      reply	other threads:[~2017-05-04 19:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 15:30 Cannot get the EXPORT_FILE_NAME override to work Kaushal Modi
2017-05-04 15:36 ` Kaushal Modi
2017-05-04 16:40 ` Nick Dokos
2017-05-04 17:02   ` Kaushal Modi
2017-05-04 17:33     ` Nick Dokos
2017-05-04 18:28       ` Kaushal Modi
2017-05-04 19:56         ` Kaushal Modi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY2aD1B_NGn-rLyqz26GoSFES_bNfrjc7NpfHmGhC0Mnfw@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ndokos@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).