Menu

#15 RFE: document links

open
nobody
None
5
2008-08-28
2008-08-28
No

Metadata is good.

Much in the same way that ReST authors can specify metadata that gets converted to HTML meta elements by rst2html, they should be able to use document links as specified in

http://www.w3.org/TR/html4/struct/links.html#edef-LINK

One way to implement this would be a copy of the meta directive, with an interface something like

.. link::
:next type=text/html: chapter3.html
:next type=text/plain: chapter3.txt
:previous type=text/html: chapter1.html
:previous type=text/html dir=rev: chapter
:index type=text/html: index.html

producing in the HTML document

<head>
<link rel="next" type="text/html" href="chapter3.html" />
<link rel="next" type="text/plain" href="chapter3.txt" />
<link rel="previous" type="text/html" href="chapter1.html" />
<link rev="previous" type="text/html" href="chapter3.html" />
<link rel="index" type=text/html" href="index.html" />
</head>

Types could be inferred from the URI by the writer, possibly.

Another possible interface could a new directive for each of the linktypes described in

http://www.w3.org/TR/html4/types.html#type-links

such as:

.. link-next:: chapter3.html
:type: text/html

.. link-next:: chapter3.txt
:type: text/plain

.. link-previous:: chapter1.html

.. link-previous:: chapter3.html
:direction: rev

.. link-alternate:: chapter2.pdf
:type: application/pdf
:media: print

This has the advantage of looking more like some of the other ReST metadata directives and less like a duplication of HTML.

In this case, there should be a mechanism for defining custom linktypes, too.

Discussion

  • Günter Milde

    Günter Milde - 2009-09-03

    This is an enhancement request.

     
  • Günter Milde

    Günter Milde - 2009-09-07

    Additional reStructuredText syntax for just one output format is bad.

    How about a generic solution like an option to put 'raw' content into the head?

     
  • Matthew Leingang

    I agree that additional reST syntax for just one output format is not good. But these metadata statements could be implementable in other languages, too. Hyperlinks can be used in PDF documents, and even embedded in the eXtensible Metadata Packet within the PDF header. I think of it as analogous to the :author: field. Even thought the link types are part of HTML, their use is not restricted to HTML

     

Log in to post a comment.