From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Re: Vararg macros, and code block as macro? Date: Thu, 26 Jul 2018 21:01:08 +0200 Message-ID: <19470276-0C3C-4140-8B79-2F21AD66910C@zzamboni.org> References: Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_BBECFAF9-F062-46D7-B4E5-56C8A237A943" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1filVp-0001VP-N9 for emacs-orgmode@gnu.org; Thu, 26 Jul 2018 15:01:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1filVn-0003XV-Vg for emacs-orgmode@gnu.org; Thu, 26 Jul 2018 15:01:21 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:46045) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1filVn-0003Vb-MV for emacs-orgmode@gnu.org; Thu, 26 Jul 2018 15:01:19 -0400 Received: by mail-ed1-x531.google.com with SMTP id s16-v6so2196046edq.12 for ; Thu, 26 Jul 2018 12:01:19 -0700 (PDT) In-Reply-To: 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: Kaushal Modi Cc: Diego Zamboni , Org-mode --Apple-Mail=_BBECFAF9-F062-46D7-B4E5-56C8A237A943 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Kaushal, > How about adding this to your emacs config: >=20 > =E2=80=A6 > Make sure that that always evaluates before you do Org exports, and = then simply use this in your Org files: Thanks for the tips! I hadn=E2=80=99t thought of adding the functions to = my Emacs config, but that would work perfectly. On the other hand, it = would be nice to make the org file fully self-contained :) > PS: Thanks for sharing that code! You are following the vision of = ox-hugo.. replacing Hugo shortcodes with Org macros :+1: :)=20 Thanks! This is exactly what I=E2=80=99m trying to do as I migrate my = existing Hugo posts to ox-hugo (I migrate them whenever I need to update = them in any way). My idea is to eventually republish some of my posts in = a different format (as an ebook, maybe), so I want the text to be as = Hugo-independent as possible. And the code is even more readable - I = find Hugo=E2=80=99s macro language quite obscure. For example, here=E2=80=99= s the same =E2=80=9Chsapi=E2=80=9D shortcode in Hugo: = https://github.com/zzamboni/zzamboni.org/blob/master/layouts/shortcodes/hs= api.html = Cheers, =E2=80=94Diego --Apple-Mail=_BBECFAF9-F062-46D7-B4E5-56C8A237A943 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = Kaushal,

How about adding this to your emacs config:

=E2=80=A6
Make sure that = that always evaluates before you do Org exports, and then simply use = this in your Org = files:

Thanks for the tips! I hadn=E2=80=99t thought of adding = the functions to my Emacs config, but that would work perfectly. On the = other hand, it would be nice to make the org file fully self-contained = :)

PS: Thanks for sharing that code! = You are following the vision of ox-hugo.. replacing Hugo shortcodes with = Org macros :+1: = :) 

Thanks! This is exactly what I=E2=80=99m trying to do = as I migrate my existing Hugo posts to ox-hugo (I migrate them whenever = I need to update them in any way). My idea is to eventually republish = some of my posts in a different format (as an ebook, maybe), so I want = the text to be as Hugo-independent as possible. And the code is even = more readable - I find Hugo=E2=80=99s macro language quite obscure. For = example, here=E2=80=99s the same =E2=80=9Chsapi=E2=80=9D shortcode in = Hugo: https://github.com/zzamboni/zzamboni.org/blob/master/layouts/sh= ortcodes/hsapi.html

Cheers,
=E2=80=94Diego

= --Apple-Mail=_BBECFAF9-F062-46D7-B4E5-56C8A237A943--