|
|
(197 intermediate revisions by 5 users not shown) |
Line 1: |
Line 1: |
| __NOTOC__ | | __NOTOC__ |
| | | |
− | == [[metawikipedia:DynamicPageList2|DynamicPageList]] (DPL) == | + | {|class=wikitable |
− | | + | |colspan=2 align=center bgcolor=e7e7ff| |
− | DPL is a MediaWiki extension which creates ''lists of articles that match certain criteria''. Articles are listed by name; ''meta data'' like popularity or last access date can be added. And there are powerful mechanisms to ''extract content'' from articles and show it as part of the list (based on another mediawiki extension called LabeledSectionTransclusion).
| + | ''This wiki is the homeplace of three powerful MediaWiki extensions developed and maintained by Gero Scholz''. |
− | | + | <br><small>Currently we run MediaWiki 1.13 with page caching enabled.</small> |
− | '''In short DPL aims to be a universal report generator for MediaWiki.'''
| + | {|border=0 |
− | | + | |align=left bgcolor=lightblue| |
− | look at an [[Example 2|example]] ...
| + | A universal report generator for MediaWikis |
− | | + | <br>A light-weight approach to semantic wiki |
− | == A typical situation .. == | + | <br>A graph generator based on aiSee |
− | Assume you have written some articles about ''countries''. Typically these articles will have three things in common:
| + | |align=left bgcolor=lightblue| |
− | * All articles will belong to a common category
| + | '''Dynamic Page List (DPL)''' |
− | * They will have a similar chapter structure, i.e. they will contain sections named 'Religion' or 'History'
| + | <br>'''{{DocTypes}}''' |
− | * They will use a template which is used to present highly structured short data items ('Capital', 'Inhabitants', ..) in a nice way (e.g. as a wikitable)
| + | <br>'''Wgraph''' |
− | | + | |} |
− | == What can DPL do for me? ==
| + | |- |
− | | + | |bgcolor=#ffe7ff align=center| |
− | Let us assume that there is an article on Islam. You want to give some information about the spreading of this religion over various countries. But you do not want to create redundancy by repeating information that was already given in the articles on each country.
| + | <big>'''[[Dynamic Page List]] -- [[DPL:Version History|{{DPL stable version}}]]'''</big> |
− | | + | |bgcolor=#ddffff align=center| |
− | In our scenario the natural approach with DPL would be to define a list of 'countries' (=category) where Islam plays a role (i.e. restrict your selection to articles which contain a link to 'Islam'). Typically you would want to include part of the text chapter on religion from each of the relevant countries. You might also want to give the number of inhabitants for each country. The output should be shown as an alphabetically ordered table. It would be nice if the user could easily sort the table by inhabitants or some aother criteria.
| + | <big>'''[[Wgraph]]'''</big> |
− | | + | |- |
− | DPL can
| + | |bgcolor=#ffe7ff valign=top| |
− | * generate a list of all those articles
| + | '''DPL is a report generator for MediaWikis'''.<br> |
− | * show metadata of the articles
| + | It creates ''lists of articles'' that match certain criteria. ''Meta data'' like author, popularity or date of last update can be added. ''Contents'' from articles can be included in the result, based on chapters, templates or special markers in the text. |
− | * show one or more chapters of the articles
| + | <center><div style="font-size:8pt"> |
− | * show parameter values which are passed to the common template
| + | <dpl> |
− | * order articles appropriately
| + | category=African Union member states |
− | * present the result in a sortable table (e.g.)
| + | nottitlematch=Sudan |
− | | + | includepage={Infobox Country or territory}:area:population_estimate,%0[100] |
− | == Which steps are necessary? == | |
− | | |
− | '''Find the articles you want to list:'''
| |
− | * select by a logical combination (AND,OR,NOT) of categories
| |
− | * select by a logical combination (AND,OR,NOT) of namespaces
| |
− | * define a pattern which must match their name
| |
− | * name a page to which the articles must or must not refer
| |
− | * exclude or include redirections
| |
− | | |
− | '''Order the articles descending or ascending according to'''
| |
− | * name
| |
− | * date of last change
| |
− | * popularity
| |
− | * user who changed them last
| |
− | * ...
| |
− | | |
− | '''Define attributes you want to see''' | |
− | * article name
| |
− | * article namespace
| |
− | * date of last change
| |
− | * date of last access
| |
− | * user who changed them last
| |
− | | |
− | '''Define contents you want to show''' | |
− | * chapter contents (identified by headings)
| |
− | * text portions (defined by special marker tags)
| |
− | * values of template calls
| |
− | | |
− | '''Define the output format''' | |
− | * headlines
| |
− | * ordered list, unordered list
| |
− | * table, sorted table (using javascript)
| |
− | * category style listing
| |
− | * truncate title or contents to maximum length
| |
− | * add a link to the article or to their chapters
| |
− | | |
− | == Example ==
| |
− | | |
− | '''Have a look at a more [[Example 2|realistic example]] or continue reading ...''' | |
− | | |
− | There are some articles on ''fictitious coutries'' (this is also the name of their common category). They all use a template named "Country" which receives facts like ''capital''. The template produces a small table and a link to the country list we want to generate. There are chapters on religion and history in most of the articles.
| |
− | We show how to create a sortable wikitable list of those articles which gives some excerpts of the contents.
| |
− | {{Sortable Tables}}
| |
− | | |
− | DPL can be used as a mediawiki parser '''extension''', which means that a special DPL tag is used:
| |
− | | |
− | ''parser extension syntax'' | |
− | <pre><nowiki> | |
− | <DPL> | |
− | category=Fictitious country | |
− | includepage={Country} dpl,#History,#Religion[50] | |
− | includemaxlength=50
| |
− | addpagecounter=true
| |
| mode=userformat | | mode=userformat |
− | listseparators=\n{|class=sortablewikitable id=123 \n!Country \n!Official Name \n!Capital \n!Dial Code \n!History \n!Religion \n|-,\n|-\n|[[%PAGE%]] (%COUNT%)\n,\n,\n|}
| |
− | secseparators=,\n|,,
| |
− | </DPL>
| |
− | </nowiki></pre>
| |
− |
| |
− | We select articles by category and explain that we want to see contents from the template "Country" and from two chapters. We truncate the excerpts. We create a sortable table which contains the article name (as a link) and its access frequency in the first column and the content pieces in the other columns. Note that at the end of truncated contents you will find a small arrow which links directly to the chapter from where the contents was taken. The formatting for the template variables has to be done in a special template which is by convention named after the original tenmplate plus a suffix ([[Template:Country dpl]] in our case). This template is very simple; it only presents the values for name, capital and dial code as columns of a table.
| |
− |
| |
− | ===== country list =====
| |
− | <DPL>
| |
− | category=Fictitious country
| |
− | includepage={Country} dpl,#History,#Religion[50]
| |
− | includemaxlength=10
| |
| addpagecounter=true | | addpagecounter=true |
− | mode=userformat | + | format=,,\n|align=right|%COUNT%\n, |
− | listseparators=\n{|class=sortablewikitable id=123 \n!Country \n!Official Name \n!Capital \n!Dial Code \n!History \n!Religion \n|-,\n|-\n|[[%PAGE%]] (%COUNT%)\n,\n,\n|}
| + | table=,Country,Area,Population,Text,#hits |
− | secseparators=,\n|,, | + | tablerow=align=right|%%,align=right|%%,<small>%%</small> |
− | </DPL> | + | </dpl> |
| + | </div></center> |
| + | Combining the power of DPL and [[mw:Extension:Ploticus|Ploticus]] we can easily generate a pie chart showing (for example) page hit frequencies. To see that it works live, note the hit count of a country, then click on that country in the above table and come back to the main page. The hit count has changed and the pie has become a little bigger ;-) |
| + | {{:Ploticus Demo}} |
| + | ---- |
| + | You are looking for a pefect integration with GoogleMaps? |
| + | See [[MapDemo]] ... |
| + | ---- |
| + | You want to know which articles were edited by whom recently? DPL can produce a quick overview: |
| + | {{:Scatter Demo}} |
| + | |bgcolor=#ddffff valign=top| |
| + | '''Wgraph is a graph generator for MediaWikis.'''<br> |
| + | It allows you to define the semantics of a graph in an abstract textual notation called WGL (Wiki Graph Language). You may add hints for layout, but the graph itself is being produced automatically. Wgraph is a powerful visualisation instrument for objects and their relations. |
| + | <center> |
| + | {{#wgraph: svg | thumb = 50 | |
| + | node wgl { type data label "text notation\n-- WGL --" } |
| + | edge wgl wgraph { kind rightnear color red } |
| + | node wgraph { type process label "Wgraph\nmediawiki extension" } |
| + | edge wgraph gdl { } |
| + | node gdl { type data label "graph definition\n-- GDL --" } |
| + | edge gdl aisee { } |
| + | node aisee { type process label "aiSee\nlayout generator" } |
| + | edge aisee img { kind leftnear } |
| + | node img { type data label "image\n-- png, svg --" |
| + | shape hexagon } |
| + | nodetype data { shape ellipse, color lightyellow, |
| + | bordercolor khaki, height 60 } |
| + | nodetype process { shape box color lightmagenta |
| + | bordercolor magenta height 60 } |
| + | xspace=70, yspace=120 |
| + | }} |
| + | </center> |
| + | ---- |
| + | You want to have a dependency matrix for includes or links? |
| + | Use '''dplmatrix''' ... |
| + | {{#dplmatrix:''links from Painters<br>to other Painters''|'''x'''|-|flip| |
| + | {{#dpl: |
| + | |debug=1 |
| + | |category=Painter |
| + | |format=,%PAGE% ~~ %TITLE%\n²{:Test matrix2¦page=%PAGE%¦category=Painter¦namespace=}², |
| + | }} |
| + | }} |
| + | ---- |
| + | You want to use structured documents, based on a semantic model? |
| + | <br>But 'Semantic Wiki' looks to "heavy" for your requirements? |
| + | <br>Try our light-weight '''[[DocTypes]]''' .. |
| + | |- |
| + | |} |
| | | |
− | ===== country list (2) =====
| + | * All extensions are under GPL license. '''Test them here live!''' There is extensive documentation, see the online '''manuals'''. You can '''[[Download|download]]''' the sources. |
| + | * In addition there are some minor extensions like ''Call'' and improved versions of existing extensions named ''Inputbox'' and ''StripMarkup'' which may be useful. See the navigation bar. We also host the [[mw:Extension:StackFunctions|StackFunctions]] extension. |
| | | |
− | DPL can also be used as a mediawiki parser '''function''', which is more powerful as it allows DPL to be used within templates, parameters being template calls or variable expansions. The disadvantage is that syntax looks less nice as the pipe character must be hidden in macros if used as a parameter contents. So the same example could also have been written as:
| + | * There are plenty of '''examples''', which can serve as a starting point for your own ideas. There is a small '''calendar application''' (built with DPL) which you can use and enhance. |
| + | * There is a place where you can '''report bugs''' and '''request new features'''. If you use the extensions, please '''leave a reference''' to your wiki! |
| | | |
− | ''parser function syntax'' | + | <p align=right>''[[User:Gero|The Author]]''</p> |
− | <pre><nowiki>
| |
− | {{#dpl:category=Fictitious country
| |
− | |includepage={Country} dpl,#History[50],#Religion
| |
− | |addpagecounter=true
| |
− | |mode=userformat
| |
− | |listseparators=\n{{(!}} class=sortablewikitable id=123
| |
− | \n!Country
| |
− | \n!Official Name
| |
− | \n!Capital
| |
− | \n!Dial Code
| |
− | \n!History
| |
− | \n!Religion
| |
− | \n{{!}}-,\n{{!-}}\n{{!}}[[%PAGE%]] (%COUNT%)\n,\n,\n{{!)}}
| |
− | |secseparators=,\n{{!}},,
| |
− | }}
| |
− | </nowiki></pre>
| |
− | | |
− | The result:
| |
− | | |
− | {{#dpl:category=Fictitious country
| |
− | |includepage={Country} dpl,#History[50],#Religion
| |
− | |includemaxlength=50
| |
− | |addpagecounter=true
| |
− | |mode=userformat
| |
− | |listseparators=\n{{(!}} class=sortablewikitable id=123
| |
− | \n!Country
| |
− | \n!Official Name
| |
− | \n!Capital
| |
− | \n!Dial Code
| |
− | \n!History
| |
− | \n!Religion
| |
− | \n{{!}}-,\n{{!-}}\n{{!}}[[%PAGE%]] (%COUNT%)\n,\n,\n{{!)}}
| |
− | |secseparators=,\n{{!}},,
| |
− | }}
| |