From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Berry, Charles" Subject: Re: getting access to a self-invented option? Date: Sat, 3 Aug 2019 17:42:49 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:51966) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hty3W-0008Kb-Ah for emacs-orgmode@gnu.org; Sat, 03 Aug 2019 13:42:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hty3V-0005pB-9k for emacs-orgmode@gnu.org; Sat, 03 Aug 2019 13:42:58 -0400 Received: from mx0a-00395d01.pphosted.com ([148.163.133.170]:8972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hty3U-0005o6-O3 for emacs-orgmode@gnu.org; Sat, 03 Aug 2019 13:42:57 -0400 In-Reply-To: Content-Language: en-US Content-ID: <815DF02B17B88545B96367808632E1F8@AD.UCSD.EDU> 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" To: Matt Price Cc: Org Mode Matt, This seems like a good use case for a `derived-backend'. You can use `org-export-define-derived-backend' with 'hugo as the parent, = define a :menu-entry to add an export action for your custom export to the = hugo menu using '?m' (say) as the key. Then=20 C-c C-e H m will export using your custom variant of hugo. HTH, Chuck > On Aug 2, 2019, at 9:10 AM, Matt Price wrote: >=20 > I'm trying to streamline some veyr ad-hoc workflows I have. One thing I d= o a lot during the school year is make some changes to an org source file, = and then export to hugo markdown with ox-hugo, and finally commit to git (a= fter that I have a git hook that generates the website & uploads the change= d pages to the appropriate location, usually a github-pages branch or separ= ate repo).=20 >=20 > So I have this code: >=20 > (defun mwp-hugo-export-and-release () > "Make it faster and easier to put my lectures up on the website." > (interactive) > =20 > (let* ((modfile (org-hugo-export-wim-to-md)) > (basedir (plist-get (org-export-get-environment 'hugo) ':hugo-b= ase-dir )) > (default-directory (expand-file-name basedir))) > (magit-stage-file modfile) > ;; (magit-status) > (magit-commit-create) > ) ) >=20 > It works great, I'm very happy. HOWEVER: in my websites I have two kinds = of outputs:=20 >=20 > - regular pages -- these get exported to .md files and turned into html b= y hugo > - lecture notes -- these get exported to reveal.js HTML pages by org-re-r= eveal and my hugo theme treats them differently . >=20 > I would really like to set a switch somewhere in the file, something like= : >=20 > #+MWP_EXPORT_TYPE: slides >=20 > And then something like=20 >=20 > let* ((modfile (if (eq :mwp-export-type "slides") (mwp-hugo-reveal-custom= -export-function) > (org-hugo-export-wim-to-md))) > ....etc) > do stuff) >=20 >=20 > But I'm not sure how to get access to a totally non-standard option like = the kind I just invented in that last bit of pseudo-code. Anyone have a goo= d suggestion? >=20 > Thank you as always! >=20 > Matt