Changeset 2427 in project

11/14/06 16:10:42 (15 years ago)

Reverting spam.

2 deleted
2 edited


  • wiki/stream-wiki

    r2404 r2427  
    1 Interest sourse! My sourse -
    2 <a href="">zyrtec</a> [url=]zyrtec[/url]
    3 <a href="">crestor</a> [url=]crestor[/url]
    4 <a href="">plavix</a> [url=]plavix[/url]
    5 <a href="">neurontin</a> [url=]neurontin[/url]
    6 <a href="">protonix</a> [url=]protonix[/url]
    7 <a href="">prilosec</a> [url=]prilosec[/url]
    8 <a href="">zyrtec</a> [url=]zyrtec[/url]
    9 <a href="">viagra</a> [url=]viagra[/url]
    10 <a href="">appartamento vendita casa mutuo</a> [url=]appartamento vendita casa mutuo[/url]
    11 <a href="">casa mutuo appartamento vendita</a> [url=]casa mutuo appartamento vendita[/url]
    12 <a href="">chiedere prestito finanziamento casa</a> [url=]chiedere prestito finanziamento casa[/url]
    13 <a href="">prestito visa carta</a> [url=]prestito visa carta[/url]
    14  <a href=""></a> [url=][/url]
     1[[tags:eggs streams]]
     5== Introduction
     7Streams-based code for converting from the relatively
     8standard and easy to type wiki format to many useful formats.
     10It currently supports converting to the following formats:
     12* HTML
     13* LaTeX (useful for generating PDF files)
     14* Text (useful for indexing contents without markup, for example for searching).
     16We are working on implementing support for Texi.
     17OpenDocumentFormat may come after.
     19This egg provides the parsing functionality used by [[|svnwiki]].
     20Using this egg other content management systems could allow its users to upload and modify
     21contents in wiki format and display it in many different formats.
     23== Examples
     25=== Converting from wiki format to HTML
     27The following code receives input from current-input-port
     28in wiki format and converts it to HTML written to
     31<enscript highlight=scheme>(use stream-ext stream-wiki)
     33(write-stream (wiki->html (port->stream (current-input-port))))</enscript>
     35Note that the resulting page does not include the {{<html>}} and {{<body>}} tags
     36(to make it easy to include it as part of a page with other stuff).
     38=== Converting from wiki format to LaTeX
     40The following code receives input from current-input-port
     41in wiki format and converts it to LaTeX written to
     44<enscript highlight=scheme>(use stream-ext stream-wiki)
     47  (latex-page "english"
     48              "article"
     49              (wiki->latex (port->stream (current-input-port)))))</enscript>
     51=== Returning the links in a file
     53The following code reads information in wiki format from current-input-port
     54and returns a stream with all the local links found.
     55Note that links to absolute URLs are not considered local links and are thus not returned.
     56Each entry in the stream has the form {{(dst name)}}, where
     57{{dst}} is the target of the link and {{name}} the text shown in the link.
     59<enscript highlight=scheme>(use stream-ext stream-wiki)
     61(wiki-links (port->stream (current-input-port)))</enscript>
     63=== Returning a list of tags in a file
     65It is possible to include "tags" (in the sense of ''tagging'' files with ''categories'')
     66in wiki pages as part of their contents.
     67To do this, the page should include a stream of the form {{<nowiki>[[tags:tag0 ... tagn]]</nowiki>}}.
     68This allows users of wiki systems to browse pages by categories (eg. list all pages
     69having tag ''tag0'').
     71The following code loads a file in wiki format from {{}} and returns
     72a stream of symbols, one for each tag found.
     74<enscript highlight=scheme>(use stream-ext stream-wiki)
     76(wiki-tags (port->stream (open-input-file "")))</enscript>
     79== Authors
     81This egg is made by [[|Alejandro Forero Cuervo]] <>.
     83== License
     85The {{stream-wiki}} egg is available under the GNU General Public License.
     87== Requirements
     89This egg depends on the following:
     91* [[srfi-40]]
     92* [[stream-ext]]
     93* [[html-stream]]
     94* [[stream-parser]]
     95* [[sandbox]]
     96* [[posix]]
     97* [[format-modular]]
     98* [[stream-sections]]
     100== Converting from wiki to HTML
     102<enscript highlight=scheme>(wiki->html input [tail] [name] [open] [include] [linktypes] [make-header] [data-output-func] [check-exists?] [extensions] [url-adjust])</enscript>
     104Converts from a simple wiki format (which is relatively
     105standard nowadays) into HTML.
     107{{input}} should be a stream of characters
     108(built with the mechanisms provided by SRFI-40 or the stream-ext egg) with
     109the contents in wiki-format; the
     110function returns a stream of characters to
     111be included as part of an HTML page.
     113Note that the returned stream will be built dynamically as it is read
     114(and so will the input stream be read).
     116The following are the optional parameteres.
     117Please be aware that they are bound to change in the future, hopefully as the interface is improved or generalized.
     119; {{tail}}: Defaults to {{stream-null}}.  The stream of characters {{tail}} will be appended at the end of the parsing.
     120; {{name}}: Defaults to {{""}}.  You should pass the name of the file currently being parsed.  The only reason it might be needed is in a {{TOC}} entry, passed to the procedure received as the {{open}} parameter.
     121; {{open}}: Defaults to {{(constantly stream-null)}} (for security reasons; we won't allow the wiki contents to open files and include them unless the caller explicitly allows it).  This should be a procedure receiving a filename as a string and returning a stream of characters with its associated contents.  This is used for {{TOC}} entries.  If you trust your wiki contents, you could use {{(compose port->stream open-input-file)}} here.
     122; {{include}}: Defaults to {{(lambda (name tail) tail)}}.  This function is used for files includes into the current file (with an {{include:file}} link).  It should return the contents that should be shown instead of the include directive, followed by the {{tail}}.  Currently they are not parsed by stream-wiki but included directly in the output, so if they are wiki contents you might want to call {{wiki->html}} on them before returning them.
     123; linktypes : Defaults to {{(make-hash-table)}}.  A list of definitions for types of links, which you can build with {{load-linktypes}}.
     124; make-header: Defaults to {{(make-html-header 1)}}.  Function to turn wiki headers into HTML.  TODO: Document better.
     125; {{data-output-func}}: Defaults to {{(constantly stream-null)}}.  Use that for now.  This is used when an extension needs to generate a file, which currently only happens for the {{math}} tags.  TODO: Document better.
     126; {{check-exists?}}: Defaults to {{(constantly #t)}}.  It is a procedure given a pathname.  It should check to see if the file exists in the wiki.  This is used to know if local links should be rendered in red (meaning the file doesn't exist) or in the regular color.
     127; {{extensions}}: Defaults to {{(make-hash-table)}}.  Contains the list of extensions loaded that stream-wiki will use while rendering files.  They should be loaded with {{(load-extensions-from-file)}}.
     128; {{url-adjust}}: Defaults to {{identity}}.  stream-wiki uses this for relative URLs in the wiki.  For example, if you want to turn all relative links into absolute links with some specific URL, use this function.  The procedure gets passed the link as a stream of characters and is expected to return a stream of characters itself.
     130== Converting from wiki to LaTeX
     132== Converting from wiki to Plain Text
     134<enscript highlight=scheme>(wiki->text input [human-readable])</enscript>
     136Remove all wiki markup from the stream of characters {{input}} and produce a corresponding stream of characters for its associated representation as a plain-text file.
     137This is useful, for example, to register the file in a search database (see, for example, the [[estraier|estraier egg]]).
     139{{human-readable}} specifies whether the resulting file will be optimized to be read by a human (eg. a user reading it over a text-only interface) or a computer (eg. an indexer using the [[estraier]] egg).
     141== Analyzing wiki files
     143=== Obtaining links
     145<enscript highlight=scheme>(wiki-links input)</enscript>
     147Return a stream with all local (not external) links in the stream of characters {{input}}.
     148Each element in the stream is a stream of characters with the destination of the link.
     150=== Obtaining sections
     152=== Obtaining tags
     154=== Obtaining a table of contents
     156== Version history
     158; 1.7 : Support for new types of extensions.  This shouldn't be visible to stream-wiki users that don't use the extensions code advancedly (ie. only svnwiki should view this change).  In the future I will strip the extensions code to a separate egg, I think.
     159; 1.6 : Added {{wiki->text}}, small fix in URL handling, adjust URLs in images (using {{check-exists?}} and {{url-adjust}}, don't strip HTML comments (since some users have reported they need to be able to include HTML comments in their wiki files, eg. for TOL).
     160; 1.5 : Added {{url-adjust}} parameter for local/relative URLs.
     161; 1.4 : Fixed a typo that was causing crashes during Texi/LaTeX output (again, the <=> string); made extensions see macros; more fixes in URL recognition; many fixes to the extension files.
     162; 1.3 : Improvements in the recognition of URLs, the generation of TexVC math image files, add support for external extensions, preliminary menus and navigation for texi-driver (by Graham Fawcett), fixed typos that were causing problems with <blockquote> and LaTeX output and with the string <=>.
     163; 1.2 : Improved the parsing of email addresses and URLs (which in some cases failed to recognized them as such).  Parse the result of evaluating linktypes as wiki format recursively (detecting infinite recursion and failing gracefully).
     164; 1.1 : Lots of improvements, way too many to list here. :-/
     165; 1.0 : First public release
  • wiki/wiki-syntax

    r2408 r2427  
    1  <a href="">Christmas gifts</a> Christmas gifts
     1[[tags:wiki syntax]]
     4== Introduction
     6This document describes the syntax used by [[|svnwiki]] to represent
     7contents in a wiki.
     9If you have suggestions to improve svnwiki, please [[|let us know]].
     11== Text Formatting
     13=== Creating a paragraph
     15To create a paragraph simply enter the text. You can place a single
     16newline anywhere in your paragraph and it will have no effect.
     18To split a paragraph use two consecutive newlines (an empty line).
     20The above two paragraphs could have been written as:
     22 To create a paragraph simply enter the text.
     23 You can place a single newline anywhere in
     24 your paragraph and it will have no effect.
     26 To split a paragraph use two consecutive newlines (an empty line).
     28=== Creating titles
     30To create a title, use a line starting with two, three, four or five equal signs:
     32 == Title Name
     33 === Sub-title Name
     34 ==== Sub-sub-title Name
     35 ===== Sub-sub-sub-title Name
     37If you use two equal signs, you will create a top-level title.  The more
     38equal signs you use, the less important your title will be.
     40An alternative option for creating titles is using ''<nowiki>&lt;h1&gt;</nowiki>''
     41''<nowiki>&lt;h2&gt;</nowiki>'', ''<nowiki>&lt;h3&gt;</nowiki>'',
     42''<nowiki>&lt;h4&gt;</nowiki>'', ''<nowiki>&lt;h5&gt;</nowiki>'' and
     43''<nowiki>&lt;h6&gt;</nowiki>'' tags.
     44There is one important difference with the
     45previous syntax: tags created in this manner will not be included in the
     46articles' Table of Contents.  For this reason, you are encouraged not
     47to use this syntax unless you have specific reasons.
     49=== Font styles (bold, italics, technical)
     51To create '''bold''' text, use three apostrophes ('), as in: ''<nowiki>'''bold'''</nowiki>''.  Use two for ''italics'': ''<nowiki>''italics''</nowiki>''.  For {{type-written
     52text}}, which is useful for technical documentation, use
     53this syntax: ''<nowiki>{{text}}</nowiki>''.
     55Related with type-written text, you can mark entire paragraphs
     56to be shown in type-written text.  This is used for lines that
     57correspond to program's output or commands that a user should
     58enter.  To active this all you need to do is start each line in
     59your paragraph with a space.  Paragraphs written in this manner
     60are shown as follows:
     62 > uptime
     63  23:04:03 up 14:18,  1 user,  load average: 0.02, 0.06, 0.18
     64 > uname -a
     65 Linux azul 2.6.10 #1 Mon Feb 7 00:20:16 COT 2005 i686 GNU/Linux
     66 >
     68=== Font size (big, small)
     70To increase or decrease the size of the text you can wrap it around
     71a pair of ''<nowiki>&lt;big&gt;...&lt;/big&gt;</nowiki>'' and
     72''<nowiki>&lt;small&gt;...&lt;/small&gt;</nowiki>'' tags respectively.
     76 <nowiki>&lt;big&gt;This text is big...&lt;/big&gt;</nowiki>
     78 <nowiki>&lt;small&gt;... and this is small.&lt;/small&gt;</nowiki>
     80This is shown as:
     82<big>This text is big...</big>
     84<small>... and this is small.</small>
     87=== Centering text
     89To center text you can wrap multiple paragraphs (and lists, titles, etc.) with a pair of ''<nowiki>&lt;center&gt;...&lt;/center&gt;</nowiki>'' tags, as in:
     91 <center>
     92 some text
     93 * item
     94 * another
     95 </center>
     97This will be shown as:
     100some text
     101* item
     102* another
     105=== Special characters
     107svnwiki automatically replaces certain sequences of characters with HTML
     108entities that browsers display better.  The following is the list of sequences:
     110 <nowiki>(R) (C) <- <-> -> <= <=> => -- --- << 1/4 1/2 3/4 >></nowiki>
     112These sequences are replaced with these characters respectively:
     113(R) (C) <- <-> -> <= <=> => -- --- << 1/4 1/2 3/4 >>
     116=== Quotes
     118If you want to make quotes, you can start your lines with ''>'' (the
     119standard character for email quotation).  Alternatively, you can
     120surround it with <nowiki>&lt;blockquote&gt; ... &lt;/blockquote&gt;</nowiki>
     122This text will be show as:
     124> I am enough of an artist to draw freely upon my imagination.
     125> Imagination is more important than knowledge.
     126> Knowledge is limited.
     127> Imagination encircles the world.
     131== Organizing your article (Table of contents, lists, tables, horizontal lines)
     133=== Table of Contents
     135If you want to show the table of contents of an article, use the following
     138 <nowiki>[[toc:]]</nowiki>
     140This will be replaced with the table of contents.  You can see an example at
     141the beginning of this page.
     143=== Lists of items
     145You can create lists of bullets or numbers by starting your lines with
     146asterisks or number signs:
     148 * Some item
     149 * Another item
     150 ** A sub item
     151 ** Another sub item
     152 **# A numbered sub sub item
     153 **# Another numberd sub sub item
     154 * The last item
     156The above list will be rendered as:
     158* Some item
     159* Another item
     160** A sub item
     161** Another sub item
     162**# A numbered sub sub item
     163**# Another numberd sub sub item
     164* The last item
     166As you can see, you can mix bullets and numbers lists any way you want.
     168=== Lists of Definitions
     170You can create a list of definitions by using multiple lines with the
     171following syntax:
     173 ; ''TERM'' : ''DEFINITION''
     175This is useful to give a list of terms along with their respective
     180 ; Lassie : A very intelligent dog.
     181 ; Garfield : A pessimistic cat.
     182 ; Tux : A fearsome pinguin.
     184This list is shown as:
     186; Lassie : A very intelligent dog.
     187; Garfield : A pessimistic cat.
     188; Tux : A fearsome pinguin.
     190=== Using tables
     192You can create a table using the standard HTML syntax, based on the
     194<tt><nowiki>&lt;tr&gt;</nowiki></tt> and
     195<tt><nowiki>&lt;td&gt;</nowiki></tt> tags.
     199 <table>
     200 <tr><th>Country</th><th>Number of cities</th></tr>
     201 <tr><td>Colombia</td><td>16</td></tr>
     202 <tr><td>Argentina</td><td>16</td></tr>
     203 <tr><td>Brasil</td><td>31</td></tr>
     204 </table>
     206This is shown as:
     209<tr><th>Country</th><th>Number of cities</th></tr>
     215Currently it is not possible to include parameters in any of the above tags;
     216this will probably be fixed in a future release.
     218=== Horizontal dividing line
     220You can include an horizontal dividing line with the followking markup:
     222 ----
     224This is shown as:
     228== Creating Links
     230To create links use ''<nowiki>[[dst]]</nowiki>'', where ''dst'' is the
     231link target.  You can use relative or absolute URLs.
     233If you want your link to display a text other than its target, use
     234''<nowiki>[[dst|Some text]]</nowiki>''.  This will be shown as:
     235[[dst|Some text]].
     237Here are some examples:
     239* <tt><nowiki>[[]]</nowiki></tt>
     240* <tt><nowiki>[[default|Home Page]]</nowiki></tt>
     242== Including Images
     244To include images in your articles use the following text:
     246 ''<nowiki>[[image:URL|ALT]]</nowiki>''
     248Here you'll need to replace ''URL'' with the URL of your image (which can
     249be absolute or relative) and ''ALT'' with a simple description of the image.
     252 ''<nowiki>[[image:|Image]]</nowiki>''
     254Renders this:
     258== Svnwiki and programming languages
     260=== Syntax coloring
     262You can embbed code or information in many file formats or programming languages;
     263Svnwiki will use [[|GNU Enscript]] to highlight it.
     264Use the <nowiki>&lt;enscript&gt;</nowiki> tag and pass the programming language or file format as the highlight parameter.
     266For example,
     268 <nowiki>&lt;enscript highlight=c&gt;</nowiki>
     269 static void
     270 pinst_check ()
     271 {
     272   pid_t pinst = pinst_find();
     273   if (pinst != -1 && kill(pinst, 0) != -1)
     274     printf("%s: server alive (%d)\n", program_name, pinst);
     275   else
     276     printf("%s: server is not running\n", program_name);
     277   exit(EXIT_SUCCESS);
     278 }
     279 <nowiki>&lt;/enscript&gt;</nowiki>
     281is shown as:
     283<enscript highlight=c>
     284static void
     285pinst_check ()
     287  pid_t pinst = pinst_find();
     288  if (pinst != -1 && kill(pinst, 0) != -1)
     289    printf("%s: server alive (%d)\n", program_name, pinst);
     290  else
     291    printf("%s: server is not running\n", program_name);
     292  exit(EXIT_SUCCESS);
     296Note that in order for this to work you'll need to have GNU Enscript installed.
     297If you don't, the information will be shown with no coloring.
     299The following languages are supported: ada asm awk bash c changelog cpp csh delphi diff diffs diffu dylan eiffel elisp erlang forth fortran fortran_pp haskell html icon idl inf java javascript ksh lua m4 mail makefile matlab nroff oberon2 objc outline oz pascal perl postscript pyrex python rfc scheme sh skill smalltalk sml sql states synopsys tcl tcsh tex vba verilog vhdl vrml wmlscript zsh.
     301=== Embedding Scheme code
     303It is possible to embbed entire programs in
     304the Scheme programming language inside the wiki pages.
     305svnwiki will execute it securely (in a safe environment)
     306and replace it with whatever output it produces.
     308For example, you could include code that prints some numbers:
     310 <nowiki>&lt;scheme&gt;</nowiki>
     311<enscript highlight=scheme>
     312(let loop ((a 0) (b 1) (i 0))
     313  (cond
     314    ((< i 10) (format #t "<p>~A: ~A~%" i a) (loop b (+ a b) (+ i 1)))))
     316 <nowiki>&lt;/scheme&gt;</nowiki>
     318This code would get replaced with the following:
     321(let loop ((a 0) (b 1) (i 0))
     322  (cond
     323    ((< i 10)
     324     (format #t "<p>~A: ~A~%" i a)
     325     (loop b (+ a b) (+ i 1)))))
     328Note that the output of the Scheme code will be included literally
     329in the page (so you can output HTML tags directly).
     331=== Literal code
     333To include something in a page literally (preventing svnwiki to convert it
     334from wiki to HTML), place it inside a <nowiki>&lt;nowiki&gt; ... &lt;/nowiki&gt;</nowiki> pair.
     338If you have suggestions to improve Svnwiki, please [[|let us know]].
Note: See TracChangeset for help on using the changeset viewer.