· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Help On Macros


1. Macros

Macros allow the insertion of system features into normal wiki pages; the only thing that makes those pages special is that they contain macros. If you edit pages like RecentChanges or SystemInfo, you'll see what that means.

For more information on the possible markup, see HelpOnEditing.

1.1. Search macros

MacroDescriptionExample
[[TitleSearch]] search the page titles FindPage
[[FullSearch]] search the page contents FindPage
[[GoTo]] directly go to the page you enter FindPage
[[PageList(regex)]] list of pages whose title matches the regex HelpIndex

1.2. Navigation

MacroDescriptionExample
[[RecentChanges]] a list of recently edited pages RecentChanges
[[TitleIndex]] an index of all page titles TitleIndex
[[WordIndex]] an index of all words in page titles WordIndex
[[RandomPage]] a link to a random page KldpExamples
[[RandomPage(#)]] links to a number of random pages
[[TableOfContents]] display a local table of contents see below

1.3. System information

MacroDescriptionExample
[[InterWiki]] a list of all known InterWiki names InterWiki
[[SystemInfo]] info on the wiki, the python interpreter and the host system SystemInfo
[[PageCount]] current page count 2397 pages

1.4. Others

MacroDescriptionExample
[[Icon(image)]] display system icons HelpOnNavigation
[[UserPreferences]] display a user preferences dialog UserPreferences
[[BR]] insert a line break 1st line
2nd line
[[Include(HelloWorld[,heading[,level]])]] include contents of another page

BASIC

10 print "Hello World"

C Language

#include <stdio.h>
int main()
{
  printf("Hello World\n");
  return 0;
}

#include <stdio.h>
#define e 3
#define g (e/e)
#define h ((g+e)/2)
#define f (e-g-h)
#define j (e*e-g)
#define k (j-h)
#define l(x) tab2[x]/h
#define m(n,a) ((n&(a))==(a))

long tab1[]={ 989L,5L,26L,0L,88319L,123L,0L,9367L };
int tab2[]={ 4,6,10,14,22,26,34,38,46,58,62,74,82,86 };

int main(m1,s) char *s; {
    int a,b,c,d,o[k],n=(int)s;
    if(m1==1){ char b[2*j+f-g]; main(l(h+e)+h+e,b); printf(b); }
    else switch(m1-=h){
        case f:
            a=(b=(c=(d=g)<<g)<'<g)<<g;
            return(m(n,a|c)|m(n,b)|m(n,a|d)|m(n,c|d));
        case h:
            for(a=f;a=e)for(b=g<<g;b<n;++b)o[b]=o[b-h]+o[b-g]+c;
            return(o[b-g]%n+k-h);
        default:
            if(m1-=e) main(m1-g+e+h,s+g); else *(s+g)=f;
            for(*s=a=f;a<e;) *s=(*s<<e)|main(h+a++,(char *)m1);
        }
        return 0;
}

C++

#include <iostream>
int main()
{
  std::cout <<"Hello, world.\n";
  return 0;
}

JAVA

// HelloWorld.java

class HelloWorld {
    public static void main(String args[]) {
        System.out.println("Hello, World!");
    }
}



2. Example Display

We don't show examples for all macros here, because that would make this page quite long. Here is is the replacement text for the [[SystemInfo]] macro:
PHP Version 7.0.33Linux wiki.kldp.org 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64
MoniWiki Version Release 1.2.5-RC1 [Revision: 1.1273 ]
HTTP Server Version Apache
Number of Pages 2397



ID
Password
Join
Enjoy your life; be pleasant and gay, like the birds in May.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2005-03-31 10:01:23
Processing time 0.0026 sec