1

My project is transitioning its documentation from Word documents to Sphinx. An intranet page with the Sphinx output is already up and running.

What we'd like to do is have Sphinx also copy Word documents to the intranet page, and reference those with hyperlinks from the rst files. Preferably in such a way that the links are still readable in plaintext (for example, a reference to ./file.doc is perfectly acceptable).

The documents don't need to be indexed nor converted nor generated - just published.

Is there any way to get Sphinx to do this, or do I need to build some scripts manually?

Community
  • 1
  • 1
Frank Kusters
  • 2,544
  • 2
  • 21
  • 30
  • I'm not sure I understand the question, but perhaps you can use the `download` role: http://www.sphinx-doc.org/en/latest/markup/inline.html#role-download. – mzjn Oct 28 '16 at 06:44
  • "Preferably in such a way that the links are still readable in plaintext". What does this mean? What would a link that is not readable in plaintext look like? – mzjn Oct 28 '16 at 06:45
  • @mzjn If the link is a fully qualified URL, that would count as 'not readable in plaintext'. – Frank Kusters Oct 31 '16 at 19:18
  • @mzjn The `download` role is exactly what I need, thank you! If you put it in an answer, I can accept it as such. – Frank Kusters Oct 31 '16 at 19:19

1 Answers1

1

The download text role can be used to do what you want. From the following markup, Sphinx will copy Test.docx to the _downloads subdirectory of the output directory and generate a link:

See :download:`this Word document <../Test.docx>`.
mzjn
  • 48,958
  • 13
  • 128
  • 248