From: Marcin Borkowski <mbork@mbork.pl>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Org-Mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: How to export to the simplest possible HTML?
Date: Tue, 30 May 2023 20:45:31 +0200 [thread overview]
Message-ID: <87353dr73o.fsf@mbork.pl> (raw)
In-Reply-To: <87r0qyuyoa.fsf@localhost>
On 2023-05-30, at 08:21, Ihor Radchenko <yantar92@posteo.net> wrote:
> Marcin Borkowski <mbork@mbork.pl> writes:
>
>> ... I tried this:
>>
>> (org-html-export-as-html nil nil nil t '(org-export-with-toc nil))
>
> You need (org-html-export-as-html nil nil nil t '(:with-toc nil))
> See `org-export-options-alist'.
Thanks. So apparently I mixed "options" with "variables".
>> but the ToC still appears in the output. Also, I'd prefer to do it
>> a bit "less interactively" - for example, setting the current buffer to
>> the one with export results is unnecessary for me, since I'm going to
>> call my exporting function in a loop over many elements. I tried
>>
>> (org-export-with-backend 'html (org-element-at-point (point)))
>
> Just use `org-export-as'.
Thanks again, I didn't know about that function!
>> but it errored out:
>>
>> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>> org-html-headline((headline (:raw-value ...)) ...)
>> org-export-with-backend(html (headline (:raw-value ...)))
>
> Because `org-element-at-point' does not return a parsed subtree. Just a
> partial one without children.
I don't understand this distinction, but now that I know about
`org-export-as' it doesn't matter.
>> I also want to supply my custom formatting for italics & friends, so
>> that
>>
>> This is /italic/.
>>
>> can become e.g.
>>
>> This is <span class="emphasize">italic</span>.
>>
>> I'm considering writing a custom (derived) export backend, but maybe
>> that is an overkill? Any ideas?
>
> Derived backend will be the easiest. It is not even hard. Just a few
> lines of code.
I know, I wrote one a few years ago, but I still think it might be a bit
overhead. Well, I'll definitely consider that option.
Thanks,
--
Marcin Borkowski
http://mbork.pl
next prev parent reply other threads:[~2023-05-30 18:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-30 3:47 How to export to the simplest possible HTML? Marcin Borkowski
2023-05-30 6:21 ` Ihor Radchenko
2023-05-30 18:45 ` Marcin Borkowski [this message]
2023-06-03 3:36 ` Marcin Borkowski
2023-06-03 5:08 ` Ihor Radchenko
2023-06-03 6:24 ` Marcin Borkowski
2023-06-03 8:37 ` Ihor Radchenko
2023-06-24 13:25 ` Marcin Borkowski
2023-06-24 13:34 ` Ihor Radchenko
2023-06-24 13:48 ` Marcin Borkowski
2023-05-30 15:32 ` Max Nikulin
2023-05-30 18:48 ` Marcin Borkowski
2023-06-08 15:18 ` Thomas Redelberger
2023-06-24 15:04 ` Max Nikulin
2023-06-25 19:56 ` Marcin Borkowski
2023-06-27 11:00 ` Max Nikulin
2023-06-28 9:03 ` Marcin Borkowski
-- strict thread matches above, loose matches on Subject: below --
2023-06-10 8:25 Thomas Redelberger
2023-06-24 13:16 ` Marcin Borkowski
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=87353dr73o.fsf@mbork.pl \
--to=mbork@mbork.pl \
--cc=emacs-orgmode@gnu.org \
--cc=yantar92@posteo.net \
/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).