From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Limit subtree to a specific export backend Date: Mon, 30 Sep 2013 18:03:16 +0200 Message-ID: <87li2e70vv.fsf@gmx.us> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQfwe-0003Dd-Jb for emacs-orgmode@gnu.org; Mon, 30 Sep 2013 12:03:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQfwX-0001AS-9O for emacs-orgmode@gnu.org; Mon, 30 Sep 2013 12:03:36 -0400 Received: from plane.gmane.org ([80.91.229.3]:56271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQfwW-0001AA-VY for emacs-orgmode@gnu.org; Mon, 30 Sep 2013 12:03:29 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VQfwV-0003dY-1V for emacs-orgmode@gnu.org; Mon, 30 Sep 2013 18:03:27 +0200 Received: from ip-pool-130.iue.it ([192.167.90.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Sep 2013 18:03:27 +0200 Received: from rasmus by ip-pool-130.iue.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Sep 2013 18:03:27 +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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Sebastian, Sebastian Wiesner writes: > can I limit a subtree to be exported with specific backends only? > I.e. only to HTML, but not Texinfo or LaTeX? > > Background: I am trying to simplify the documentation of one of my > projects, and combine the website and the user manual into a single > document. Naturally, there is some content on the website that should > not appear in the manual and vice versa. As Sebastien suggests, if you can identify export status depending on tags you can do it with a filter. Here's an example that's perhaps a bit too verbose and not thoroughly tested: #+BEGIN_SRC Org #+TITLE: Conditional export #+options: tags:nil * Common intro txt ** Pdf heading :latex: the math is really pretty! ** HTML heading :html: the text features hyperlinks! ** More common notes Intro over * Code :noexport: #+begin_src emacs-lisp (defun rasmus/conditional-export (settings backend) "Change SETTINGS to include dynamically set export-tags. Enable the use of BACKEND as EXPORT_TAGS. A derived backend is treated as its parent." (let ((backends (remove-duplicates (mapcar (lambda (x) (or (org-export-backend-parent x) (org-export-backend-name x))) org-export--registered-backends))) ;; for treating derived backend and parent backends differently: ;; (backend-or-parent backend) (backend-or-parent (dolist (b org-export--registered-backends return) (when (eq (org-export-backend-name b) backend) (return (or (org-export-backend-parent b) (org-export-backend-name b))))))) (plist-put settings :exclude-tags (append (plist-get settings :exclude-tags) (mapcar 'symbol-name (remove backend-or-parent backends)))))) (add-to-list 'org-export-filter-options-functions 'rasmus/conditional-export) #+end_src #+END_SRC -- Enough with the bla bla!