4

I know this kind of defeat the purpose of a literal block, however I was wondering if there was any workaround to achieve this. My use case is to put an hyperlink in a block literal of pseudo code, in order to reference details elsewhere in the document.

Example :

Look at this JSON pseudo code
-----------------------------

::

  {
    "id": <number>,
    "name": <string>,
    "big_property": <see schema of big_object_>
  }

And the details of big object
-----------------------------

.. _big_object:

::

  {
     <another_schema>
  }

I would like that in the first literal block, big_object_ becomes an hyperlink.

Quentin
  • 1,085
  • 1
  • 11
  • 29

1 Answers1

4

You can use the parsed-literal directive for this:

.. parsed-literal::

  {
    "id": <number>,
    "name": <string>,
    "big_property": <see schema of big_object_>
  }
mzjn
  • 48,958
  • 13
  • 128
  • 248
  • That's perfect thank you ! Somehow it was impossible to find that by googling "restructuredtext hyperlink in literal blocks" or variants, I was convinced there was no solution :D – Quentin Apr 14 '17 at 06:25