emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to export to the simplest possible HTML?


From: Marcin Borkowski
Subject: Re: How to export to the simplest possible HTML?
Date: Tue, 30 May 2023 20:45:31 +0200
User-agent: mu4e 1.1.0; emacs 30.0.50

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]