On 2023-05-30, at 08:21, Ihor Radchenko <yanta...@posteo.net> wrote:

> Marcin Borkowski <mb...@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.


Marcin Borkowski

Reply via email to