Discussion:
[Docutils-users] help with RAW directive to insert a text file
Jorge
2014-02-23 20:47:50 UTC
Permalink
Hi there,

I'm quite new to this stuff, I am trying to embed a plain text file into my
document using the raw directive. But can't figure out how to do this.


This is what I have in my .rst

"
The code executed by this job is listed below:

.. raw:: text
:file: ../gits/vcloud-management-tools/lib/application.rb

"

How do I do this?
Pete Jemian
2014-02-24 15:52:31 UTC
Permalink
Perhaps

.. literalinclude:: ../gits/vcloud-management-tools/lib/application.rb
:linenos:
:language: guess
Post by Jorge
Hi there,
I'm quite new to this stuff, I am trying to embed a plain text file into my
document using the raw directive. But can't figure out how to do this.
This is what I have in my .rst
"
.. raw:: text
:file: ../gits/vcloud-management-tools/lib/application.rb
"
How do I do this?
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
--
----------------------------------------------------------
Pete R. Jemian, Ph.D. <***@anl.gov>
Beam line Controls and Data Acquisition, Group Leader
Advanced Photon Source, Argonne National Laboratory
Argonne, IL 60439 630 - 252 - 3189
-----------------------------------------------------------
Education is the one thing for which people
are willing to pay yet not receive.
-----------------------------------------------------------
David Goodger
2014-02-24 15:59:44 UTC
Permalink
Note that "literalinclude" is a Sphinx-specific extension, and is NOT
a part of core Docutils:
http://sphinx-doc.org/markup/code.html#directive-literalinclude

Please include links to documentation in future, thanks.

DG
Post by Pete Jemian
Perhaps
.. literalinclude:: ../gits/vcloud-management-tools/lib/application.rb
:language: guess
Post by Jorge
Hi there,
I'm quite new to this stuff, I am trying to embed a plain text file into my
document using the raw directive. But can't figure out how to do this.
This is what I have in my .rst
"
.. raw:: text
:file: ../gits/vcloud-management-tools/lib/application.rb
"
How do I do this?
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
--
----------------------------------------------------------
Beam line Controls and Data Acquisition, Group Leader
Advanced Photon Source, Argonne National Laboratory
Argonne, IL 60439 630 - 252 - 3189
-----------------------------------------------------------
Education is the one thing for which people
are willing to pay yet not receive.
-----------------------------------------------------------
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
David Goodger
2014-02-24 15:57:42 UTC
Permalink
Post by Jorge
Hi there,
I'm quite new to this stuff, I am trying to embed a plain text file into my
document using the raw directive. But can't figure out how to do this.
This is what I have in my .rst
"
.. raw:: text
:file: ../gits/vcloud-management-tools/lib/application.rb
"
How do I do this?
You're using the wrong directive. "raw" is to insert fragments that
are passed untouched to the final output. IOW, the format of the raw
fragment must match the document output format (e.g. HTML, LaTeX,
etc.).

You should be using the "include" directive with the "literal" or
"code" options. For details, see:
http://docutils.sourceforge.net/docs/ref/rst/directives.html#include
--
David Goodger <http://python.net/~goodger>
Loading...