Raw Code Download: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
This wiki is capable of letting users download raw code embedded into the pages. Please see [http://wiki.yobi.be/wiki/Mediawiki_RawFile] for more details, especially the examples at [http://wiki.yobi.be/wiki/Mediawiki_RawFile#Short_example].
This wiki is capable of letting users download raw code embedded into the pages. Please see [http://wiki.yobi.be/wiki/Mediawiki_RawFile] for more details, especially the examples at [http://wiki.yobi.be/wiki/Mediawiki_RawFile#Short_example].


In short, use either <nowiki><code></code></nowiki> tags around your code snippets or for more power use the specially designed <nowiki>{{#fileanchor: myotherscript.sh}}</nowiki> and <nowiki>{{#filelink: myotherscript.sh}}</nowiki> templates as shown in the long example.
In short, use either <nowiki><pre></pre></nowiki> tags around your code snippets or for more power use the specially designed <nowiki>{{#fileanchor: myotherscript.sh}}</nowiki> and <nowiki>{{#filelink: myotherscript.sh}}</nowiki> templates as shown in the long example.


Here is a working example taken from [http://www.graphicslab.org/Blog/Adding-a-new-Command-to-the-Scribus-Scripter]
Here is a working example taken from [http://www.graphicslab.org/Blog/Adding-a-new-Command-to-the-Scribus-Scripter]




Save the following code [{{#file: cmdtext.cpp}} as cmdtext.cpp]
Save the following code as [{{#file: cmdtext.cpp}}cmdtext.cpp]
<pre>
<pre>



Revision as of 03:31, 8 July 2011

This wiki is capable of letting users download raw code embedded into the pages. Please see [1] for more details, especially the examples at [2].

In short, use either <pre></pre> tags around your code snippets or for more power use the specially designed {{#fileanchor: myotherscript.sh}} and {{#filelink: myotherscript.sh}} templates as shown in the long example.

Here is a working example taken from [3]


Save the following code as [{{#file: cmdtext.cpp}}cmdtext.cpp]


/*! docstring */
PyDoc_STRVAR
(scribus_repeattext__doc__,
QT_TR_NOOP("repeatText(n, [\"name\"])\n\
\n\
Repeat the text of the text frame \"name\" n times.\n\
If \"name\" is not given the currently selected item is used.\n\"
));
/*! Repeat text */
PyObject * scribus_repeattext(PyObject * /*self*/, PyObject * args);