emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Price <moptop99@gmail.com>
To: "Berry, Charles" <ccberry@ucsd.edu>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: getting access to a self-invented option?
Date: Wed, 7 Aug 2019 11:36:11 -0400	[thread overview]
Message-ID: <CAN_Dec-su4XnSBwoS6tB_tgscMc_2qRMncqy+AS_vih73iDBmg@mail.gmail.com> (raw)
In-Reply-To: <D985E44D-E547-4783-838F-6EEEF124C738@ucsd.edu>

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

On Sat, Aug 3, 2019 at 1:42 PM Berry, Charles <ccberry@ucsd.edu> wrote:

> 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
>
>         C-c C-e H m
>
> will export using your custom variant of hugo.
>
> :-) I'm trying to use the variable to determine whether I export with hugo
or with my hugo-reveal franken-backend:
https://github.com/titaniumbones/ox-huveal . So my preference is to
evaluate the variable BEFORE export begins.

I guess another option is to just set a buffer-local variable in the file,
or use #+FILETAGS: and hack htings that way. I'm not sure what the most
sustainable & org-like method relaly is...



>
> HTH,
>
> Chuck
>
>
> > On Aug 2, 2019, at 9:10 AM, Matt Price <moptop99@gmail.com> wrote:
> >
> > I'm trying to streamline some veyr ad-hoc workflows I have. One thing I
> do 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
> (after that I have a git hook that generates the website & uploads the
> changed pages to the appropriate location, usually a github-pages branch or
> separate repo).
> >
> > So I have this code:
> >
> > (defun mwp-hugo-export-and-release ()
> >   "Make it faster and easier to put my lectures up on the website."
> >   (interactive)
> >
> >   (let* ((modfile (org-hugo-export-wim-to-md))
> >          (basedir (plist-get  (org-export-get-environment 'hugo)
> ':hugo-base-dir ))
> >          (default-directory (expand-file-name basedir)))
> >     (magit-stage-file modfile)
> >     ;; (magit-status)
> >     (magit-commit-create)
> >     )  )
> >
> > It works great, I'm very happy. HOWEVER: in my websites I have two kinds
> of outputs:
> >
> > - regular pages -- these get exported to .md files and turned into html
> by hugo
> > - lecture notes -- these get exported to reveal.js HTML pages by
> org-re-reveal and my hugo theme treats them differently .
> >
> > I would really like to set a switch somewhere in the file, something
> like:
> >
> > #+MWP_EXPORT_TYPE: slides
> >
> > And then something like
> >
> > let* ((modfile (if (eq :mwp-export-type "slides")
> (mwp-hugo-reveal-custom-export-function)
> >                                (org-hugo-export-wim-to-md)))
> >      ....etc)
> >             do stuff)
> >
> >
> > 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
> good suggestion?
> >
> > Thank you as always!
> >
> > Matt
>
>
>

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

  reply	other threads:[~2019-08-07 15:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02 16:10 getting access to a self-invented option? Matt Price
2019-08-02 20:00 ` Tim Cross
2019-08-07 15:39   ` Matt Price
2019-08-03  5:28 ` Thibault Marin
2019-08-07 15:30   ` Matt Price
2019-08-03 17:42 ` Berry, Charles
2019-08-07 15:36   ` Matt Price [this message]
2019-08-07 16:58     ` Berry, Charles
2019-08-07 17:21       ` Berry, Charles

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=CAN_Dec-su4XnSBwoS6tB_tgscMc_2qRMncqy+AS_vih73iDBmg@mail.gmail.com \
    --to=moptop99@gmail.com \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    /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).