Creative Commons License
Excepto donde se indique otra cosa, todo el contenido de este lugar está bajo una licencia de Creative Commons.
Taquiones > software > factory > syntax > Ejemplos de uso del plugin syntax de ikiwiki

Ejemplos de uso del plugin syntax para IkiWiki

  • Added line numbers in version 0.6

Perl program with a predefined first line number:

    1 sub connection {
    2     my $class = shift;
    3     my $dsn = shift;
    4     my $user = shift;
    5     my $passwd = shift;
    6     my $attr = shift;
    7 
    8     if (not $dsn) {
    9         my $conf = Lidia::Config->new();
   10         $dsn = $conf->db->dsn();
   11         $user = $conf->db->user();
   12         $passwd = $conf->db->passwd();
   13     }
   14 
   15     return $class->SUPER::connection( $dsn, $user, $passwd, $attr);
   16 }

Bash script with line numbers too:

    1 # Long term variables, which may be set in the cvsdeb config file or the
    2 # environment:
    3 # rootdir workdir (if all original sources are kept in one dir)
    4 
    5 TEMPDIR=/tmp/$$
    6 mkdir $TEMPDIR || exit 1
    7 TEMPFILE=$TEMPDIR/cl-tmp
    8 trap "rm -f $TEMPFILE; rmdir $TEMPDIR" 0 1 2 3 7 10 13 15
    9 
   10 TAGOPT=
   11 
   12 # Command line; will bomb out if unrecognised options
   13 TEMP=$(getopt -a -s bash \
   14        -o hC:EH:G:M:P:R:T:U:V:W:Ff:dcnr:x:Bp:Dk:a:Sv:m:e:i:I:t: \
   15        --long help,version,ctp,tC,sgpg,spgp,us,uc,op \
   16        --long si,sa,sd,ap,sp,su,sk,sr,sA,sP,sU,sK,sR,ss,sn \
   17        -n "$PROGNAME" -- "$@")
   18 eval set -- $TEMP

HTML example:

    1 <head>
    2 
    3   <title>VLC media player - Web Interface</title>
    4   <meta http-equiv="Content-Type" content="text/html; charset=<vlc id="value" param1="charset"/>" />
    5   <link href="style.css" rel="stylesheet" type="text/css" />
    6   <!--[if IE ]>
    7   <link href="iehacks.css" rel="stylesheet" type="text/css" />
    8   <![endif]-->
    9   <script type="text/javascript" src="js/functions.js"></script>
   10 
   11   <!-- in case people had scripts that sent commands to the default
   12        index.html page -->
   13   <vlc id="control" param1="stop,pause,previous,next,add,sout,play,delete,empty,seek,fullscreen,keep,volume,sort,
   14 move" />
   15   <vlc id="set" param1="sout" param2="string" />
   16 
   17 </head>
   18 
   19 <body onload="loop_refresh();">