]> Pileus Git - pages/blob - tools/vpaste.md
Update pages and do some spellchecking
[pages] / tools / vpaste.md
1 vpaste is a pastebin that uses Vim for syntax highlighting.
2
3 The pastebin
4 ------------
5 * <http://vpaste.net/>
6
7 Source Code
8 -----------
9 Source code is available in git and [gitweb](/git/?p=vpaste)
10
11     git clone git://pileus.org/vpaste
12
13 Embedding examples
14 ------------------
15 vpaste allows pastes to be embedded in external websites:
16
17 <script type="text/javascript" src="http://vpaste.net/embed.js?ft=sh">
18         #!/bin/bash
19
20         echo Hello, World > test.txt
21 </script>
22
23 This can be done by including code in the script tag itself, as in the above
24 example, or by linking to an existing paste:
25
26 <script type="text/javascript" src="http://vpaste.net/embed.js?vpaste"></script>
27
28 A third way to use the embedding script is to include it once, possibly in the
29 in the header, and then call the `format_code('pre','vpaste')` function later
30 on to perform syntax highlighting on all the `<pre class="vpaste">` tags.
31
32 In this case, slightly more care must be taken to properly escape HTML
33 characters scuh as `<` and `>`.
34
35 <pre class="vpaste" title="ft=c">
36         #include &lt;stdio.h&gt;
37
38         int main(int argc, char **argv)
39         {
40                 printf("hello, world");
41                 return 0;
42         }
43 </pre>
44
45 <script type="text/javascript">format_code('pre', 'vpaste');</script>