emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] manual: confusing example of adding attributes to a link (affiliated keywords)
@ 2022-06-20 16:25 Max Nikulin
  2022-06-25  5:29 ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Max Nikulin @ 2022-06-20 16:25 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Org Manual in info "(org) Links in HTML export" 
https://orgmode.org/manual/Links-in-HTML-export.html has the following 
example:

> Org files can also have special directives to the HTML export
> back-end. For example, by using ‘#+ATTR_HTML’ lines to specify new
> format attributes to <a> or <img> tags. This example shows changing
> the link’s title and style:
> 
> #+ATTR_HTML: :title The Org mode homepage :style color:red;
> [[https://orgmode.org]]

Likely I have seen similar suggestions in this list as well.

Actually it assigns attribute to paragraphs in addition to links. That 
is why, I think, this fragment should be removed from manual as a 
confusing one since it gives impression of support of per-link attributes.

Attributes assigned through affiliated keywords belongs to paragraph 
(block-level element), not to link (inline object). Actual result of export:

     <p title="The Org mode homepage" style="color:red;">
     <a href="https://orgmode.org" title="The Org mode homepage" 
style="color:red;">https://orgmode.org</a>
     </p>

If it were possible to set attributes to links, the result should be

     <p>
     <a href="https://orgmode.org" title="The Org mode homepage" 
style="color:red;">https://orgmode.org</a>
     </p>

The reason of my expectation is that a paragraph may have more than one 
link with different titles.

I am unsure if formal bug report will help. I promised it in the 
following discussion:
Max Nikulin to emacs-orgmode. Re: Org-syntax: Intra-word markup. Thu, 3 
Feb 2022 19:10:19 +0700. https://list.orgmode.org/stggnf$d8g$1@ciao.gmane.io

A similar complain:
Anton Linevych. How to add extra attributes to link in Org-mode? 
2017-06-21 https://linevi.ch/en/org-link-extra-attrs.html

The reason why I have decided to post this bug report now is the 
following message:
Juan Manuel Macías to emacs-orgmode. Re: About 'inline special blocks' 
Sun, 19 Jun 2022 12:47:40 +0000. 
https://list.orgmode.org/875ykwvmz7.fsf@posteo.net

It states that styles and similar stuff may solve the issue with 
attributes for inline objects. From my point of view it is wrong and in 
some cases per-object attributes are necessary. While <a rel="nofollow 
noreferrer" href="..."> or <a target="_blank" href="..."> may be added 
through style, attributes like "alt" for images, "title", "lang", etc. 
for links are individual.

I am aware of the following post:
J. Kitchin. Extending the org-mode link syntax with attributes. 
2015-02-05 
http://kitchingroup.cheme.cmu.edu/blog/2015/02/05/Extending-the-org-mode-link-syntax-with-attributes/
The recipe solves the problem, but this time the topic of inline special 
blocks has been risen in the context of limitations in Org markup making 
it inappropriate tool for GNU manuals in general and the Org manual in 
particular. So some more general solution is required than local 
customization.

So as outcome for this bug report I expect that either caveats related 
to affiliated keywords are clearly stated in the manual or some 
"official" way to assign attributes for specific inline objects is 
introduced.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-25 12:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-20 16:25 [BUG] manual: confusing example of adding attributes to a link (affiliated keywords) Max Nikulin
2022-06-25  5:29 ` Ihor Radchenko
2022-06-25 10:12   ` Max Nikulin
2022-06-25 10:39     ` Ihor Radchenko
2022-06-25 11:55       ` Max Nikulin
2022-06-25 12:17         ` Ihor Radchenko

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).