emacs-orgmode
[Top][All Lists]
Advanced

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

[RFC][PATCH] Allow to export to ascii custom link types as notes


From: Max Nikulin
Subject: [RFC][PATCH] Allow to export to ascii custom link types as notes
Date: Sat, 21 Oct 2023 00:21:47 +0700
User-agent: Mozilla Thunderbird

Hi,

In the following thread

Ihor Radchenko. Re: Exporting elisp: and shell: links.
Sat, 14 Oct 2023 08:13:35 +0000.
https://list.orgmode.org/87wmvp1v0w.fsf@localhost

it was discussed that attempts to customize export to plain text of link types such as "elisp:" and "shell:" break formatting as notes at the end of the heading (`org-ascii-links-to-notes').

The attached patches is a draft implementing this feature (new functions are not documented yet).

For ascii backend :export function from `org-link-parameters' may return (PATH . DESCRIPTION) `cons' instead of string. Depending on chosen link style it will be exported as "[DESCRIPTION]" with the "[DESCRIPTION] PATH" note at the end of heading or as the inline reference "DESCRIPTION (PATH)".

I believe that parenthesis should be skipped in the case of angle brackets "(<URI>)", but I do not change this behavior. There is some inconsistency in respect to brackets for description of inline links, but it is preserved as well.

I do not like that :export functions are called twice: for text and for note. In my opinion it is better to collect links in a property of INFO to later format notes at the end of the heading. I would consider more dense style of notes with list markers instead of empty line as separator.

Namely "shell:" and "elisp:" links may be exported as notes in the current Org version since they have no :export property. The proposed feature allows to have custom :export e.g. to not add "shell:" prefix to the code.

Attachment: 0001-test-ox-ascii.el-Test-custom-links.patch
Description: Text Data

Attachment: 0002-ox-ascii.el-Refactor-link-export.patch
Description: Text Data

Attachment: 0003-ox-ascii.el-Allow-to-export-custom-links-as-notes.patch
Description: Text Data


reply via email to

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