Site Tools


wiki:pluginsyntax:filelist

File List Plugin

The filelist plugin provides a syntax for adding linked and sorted lists of files as selected by wildcard based glob patterns to a wiki page and thus allows dynamically including file listings of arbitrary filesystem locations and media namespaces. Using the additional filename command, one can also add a single link to a file out of a list anywhere in the text, which can be used to automatically keep download links for software releases up to date with the most recent upload.

Usage

The filelist plugin provides two new commands to be used in wiki pages, filelist and filename. The general command syntax for both is the following:

{{[ command ]>[ pattern ][ parameterlist ]}}
  • command must be either filelist or filename.
  • pattern is a searching pattern for files to include in the generated list, defined using the pattern syntax of the unix fnmatch function. An example: If you want to include all files ending on .txt in the folder some/path/1), you would use some/path/*.txt as the pattern (and the parameter direct=1, see parameters below). Analogue to this, to include all jpeg media files in :some:namespace, you'd use :some:namespace:*.jpg.
  • parameterlist can be used to define optional, & separated parameters (defined as key-value-pairs). For a list of supported parameters, see below.

Paths

The filelist plugin supports both absolute as well as relative paths into the filesystem or Dokuwiki media namespaces. All paths are checked against a whitelist of allowed paths for scanning (as defined via the configuration setting ''allowed_absolute_paths''). Paths which are not located below these whitelisted paths are not allowed for globbing and thus filelist/filename calls to such paths fail. Per default, the Dokuwiki basedir as defined in DOKU_INC is included in this whitelist and mapped to the Dokuwiki base-URL, DOKU_URL.

Relative paths into the filesystem are interpreted relative to the Dokuwiki basedir. Relative media paths (without a leading : that is) are interpreted relative to the namespace of the currently active page. Thus, :snippets:dokuwiki:* and * would be interpreted the same on the current page :snippets:dokuwiki:filelist.

Parameters

Name Description Possible values Default
direct Whether to interpret the given pattern as a direct path in the file system or as an dokuwiki media id. Defaults to media id. 0 or 1 0
sort The property by which to sort the internal file list. By default, the file name is used, with upper case being sorted before lower case (use iname for a case insensitive sorting criteria). name, iname, ctime, mtime, size name
order Whether to sort the internal file list ascending or descending. Sorting in ascending order is the default. asc, desc asc
filelist specific parameters
offset The offset in the internal file list from which on to display the list. Default is an offset of 0. any numeric value 0
limit The number of files to display, beginning at index offset. A number of 0 means to display all available files. any numeric value 0
style The style to use for display. list creates an unordered bullet list (the default), olist an ordered list, table a table view and page a heading/section based view of the selected files. list, olist, table, page list
tableheader Whether to show the table header describing the table columns. Off by default. 0 or 1 0
tableshowdate Whether to show the file modification date in the table view. Off by default. 0 or 1 0
tableshowsize Whether to show the file size in the table view. Off by default. 0 or 1 0
recursive Whether to do a recursive file crawl starting at the defined basepath. If this parameter is set to 1, the whitecard part of the search pattern is applied to each found subdirectory. If no files are found, the subdirectory is not included in the search result. All display styles besides table will show the result in a hierarchical structure; table will first flatten the result by prepending all found files with there subtree pathname (note that this happens before sorting). 0 or 1 0
titlefile The filename of a file which to lookup in each subtree if recursive is set to 1 and whose content to use as title for the directory. It will be ignored in the results of the filelisting itself. Defaults to _title.txt. Example: A _title.txt file containing “My special title” found during a crawl on the subpath my/subpath will be rendered as having the name “My special title” instead of “subpath”. any filename _title.txt
filename specific parameters
index Which specific item to select for display from the internal file list. The default is the first one. any numeric value 0

Examples

filename

{{filename>:cp:c61-genset-control-tower-3p.jpg}}

turns into

c61-genset-control-tower-3p.jpg



filelist

Example 1
{{filelist>:datasheets:*.pdf&style=table&tableheader=1&tableshowdate=1&tableshowsize=1&limit=15}}

turns into

FilenameFilesizeLast modified
abb145-300.pdf1.0 MiB2018/05/28 22:28
abb_circuit_breakers.pdf3.1 MiB2018/05/28 22:28
abb_contactors.pdf3.5 MiB2018/05/28 22:28
abb_lw110_lug_ext..pdf552.8 KiB2018/05/28 22:28
af400_dims.pdf165.4 KiB2018/05/28 22:28
altech-buttons.pdf643.2 KiB2018/05/28 22:28
altech_labels.pdf280.9 KiB2018/05/28 22:28
altech_switch_contacts.pdf448.3 KiB2018/05/28 22:28
altech_terminal_blocks.pdf4.6 MiB2018/05/28 22:28
atkinson_elect_uiro.pdf275.0 KiB2018/05/28 22:28
comap_intelicompact-nt-1.3-reference_guide_r3.pdf7.7 MiB2018/05/28 22:28
comap_intelicompact-nt-operator_guide_12-2011.pdf1.6 MiB2018/05/28 22:28
comap_mainscompact-nt-1.0-reference_guide.pdf3.2 MiB2018/05/28 22:28
cooper-bussmann_industrial-control_7400039.pdf222.6 KiB2018/05/28 22:28
crown_battery_renewable_power_products_brochure.pdf972.3 KiB2018/05/28 22:28
Example 2
Example 3
{{filelist>lib/images/*&style=olist&direct=1&recursive=1&sort=iname}}

turns into

  1. _deprecated.txt
  2. admin
    1. acl.png
    2. config.png
    3. plugin.png
    4. popularity.png
    5. README
    6. revert.png
    7. styling.png
    8. usermanager.png
  3. blank.gif
  4. bullet.png
  5. closed-rtl.png
  6. closed.png
  7. diff.png
  8. email.png
  9. email.svg
  10. error.png
  11. external-link.png
  12. external-link.svg
  13. fileicons
    1. 32x32
      1. 7z.png
      2. asm.png
      3. bash.png
      4. bz2.png
      5. c.png
      6. cc.png
      7. conf.png
      8. cpp.png
      9. cs.png
      10. csh.png
      11. css.png
      12. csv.png
      13. deb.png
      14. diff.png
      15. doc.png
      16. docx.png
      17. file.png
      18. gif.png
      19. gz.png
      20. h.png
      21. hpp.png
      22. htm.png
      23. html.png
      24. ico.png
      25. java.png
      26. jpeg.png
      27. jpg.png
      28. js.png
      29. json.png
      30. lua.png
      31. mp3.png
      32. mp4.png
      33. odc.png
      34. odf.png
      35. odg.png
      36. odi.png
      37. odp.png
      38. ods.png
      39. odt.png
      40. ogg.png
      41. ogv.png
      42. pas.png
      43. pdf.png
      44. php.png
      45. pl.png
      46. png.png
      47. ppt.png
      48. pptx.png
      49. ps.png
      50. py.png
      51. rar.png
      52. rb.png
      53. rpm.png
      54. rtf.png
      55. sh.png
      56. sql.png
      57. svg.png
      58. swf.png
      59. sxc.png
      60. sxd.png
      61. sxi.png
      62. sxw.png
      63. tar.png
      64. tgz.png
      65. txt.png
      66. wav.png
      67. webm.png
      68. xls.png
      69. xlsx.png
      70. xml.png
      71. zip.png
    2. 7z.png
    3. asm.png
    4. bash.png
    5. bz2.png
    6. c.png
    7. cc.png
    8. conf.png
    9. cpp.png
    10. cs.png
    11. csh.png
    12. css.png
    13. csv.png
    14. deb.png
    15. diff.png
    16. doc.png
    17. docx.png
    18. dsn.png
    19. file.png
    20. gif.png
    21. gz.png
    22. h.png
    23. hpp.png
    24. htm.png
    25. html.png
    26. ico.png
    27. index.php
    28. java.png
    29. jpeg.png
    30. jpg.png
    31. js.png
    32. json.png
    33. lua.png
    34. mp3.png
    35. mp4.png
    36. new
      1. 7z.png
      2. asm.png
      3. bash.png
      4. bz2.png
      5. c.png
      6. cc.png
      7. conf.png
      8. cpp.png
      9. cs.png
      10. csh.png
      11. css.png
      12. csv.png
      13. deb.png
      14. diff.png
      15. doc.png
      16. docx.png
      17. dsn.png
      18. file.png
      19. gif.png
      20. gz.png
      21. h.png
      22. hpp.png
      23. htm.png
      24. html.png
      25. ico.png
      26. index.php
      27. java.png
      28. jpeg.png
      29. jpg.png
      30. js.png
      31. json.png
      32. lua.png
      33. mp3.png
      34. mp4.png
      35. odc.png
      36. odf.png
      37. odg.png
      38. odi.png
      39. odp.png
      40. ods.png
      41. odt.png
      42. ogg.png
      43. ogv.png
      44. pas.png
      45. pdf.png
      46. php.png
      47. pl.png
      48. png.png
      49. ppt.png
      50. pptx.png
      51. ps.png
      52. py.png
      53. rar.png
      54. rb.png
      55. README
      56. rpm.png
      57. rtf.png
      58. sh.png
      59. sql.png
      60. swf.png
      61. sxc.png
      62. sxd.png
      63. sxi.png
      64. sxw.png
      65. tar.png
      66. tgz.png
      67. txt.png
      68. wav.png
      69. webm.png
      70. xls.png
      71. xlsx.png
      72. xml.png
      73. zip.png
    37. odc.png
    38. odf.png
    39. odg.png
    40. odi.png
    41. odp.png
    42. ods.png
    43. odt.png
    44. ogg.png
    45. ogv.png
    46. orig
      1. 7z.png
      2. asm.png
      3. audio.png
      4. bash.png
      5. bz2.png
      6. c.png
      7. cc.png
      8. conf.png
      9. cpp.png
      10. cs.png
      11. csh.png
      12. css.png
      13. csv.png
      14. deb.png
      15. diff.png
      16. doc.png
      17. docx.png
      18. dsn.png
      19. file.png
      20. gif.png
      21. gz.png
      22. h.png
      23. hpp.png
      24. htm.png
      25. html.png
      26. ico.png
      27. index.php
      28. java.png
      29. jpeg.png
      30. jpg.png
      31. js.png
      32. json.png
      33. lua.png
      34. mp3.png
      35. mp4.png
      36. odc.png
      37. odf.png
      38. odg.png
      39. odi.png
      40. odp.png
      41. ods.png
      42. odt.png
      43. ogg.png
      44. ogv.png
      45. pas.png
      46. pdf.png
      47. php.png
      48. pl.png
      49. png.png
      50. ppt.png
      51. pptx.png
      52. ps.png
      53. py.png
      54. rar.png
      55. rb.png
      56. rpm.png
      57. rtf.png
      58. sh.png
      59. sql.png
      60. swf.png
      61. sxc.png
      62. sxd.png
      63. sxi.png
      64. sxw.png
      65. tar.png
      66. tgz.png
      67. txt.png
      68. wav.png
      69. webm.png
      70. xls.png
      71. xlsx.png
      72. xml.png
      73. zip.png
    47. pas.png
    48. pdf.png
    49. php.png
    50. pl.png
    51. png.png
    52. ppt.png
    53. pptx.png
    54. ps.png
    55. py.png
    56. rar.png
    57. rb.png
    58. README
    59. rpm.png
    60. rtf.png
    61. sh.png
    62. sql.png
    63. svg
      1. 7z.svg
      2. asm.svg
      3. bash.svg
      4. bz2.svg
      5. c.svg
      6. conf.svg
      7. cpp.svg
      8. cs.svg
      9. csh.svg
      10. css.svg
      11. csv.svg
      12. deb.svg
      13. doc.svg
      14. docx.svg
      15. file.svg
      16. gif.svg
      17. gz.svg
      18. h.svg
      19. htm.svg
      20. html.svg
      21. ico.svg
      22. index.php
      23. java.svg
      24. jpeg.svg
      25. jpg.svg
      26. js.svg
      27. json.svg
      28. lua.svg
      29. mp3.svg
      30. mp4.svg
      31. ods.svg
      32. odt.svg
      33. ogg.svg
      34. ogv.svg
      35. pdf.svg
      36. php.svg
      37. pl.svg
      38. png.svg
      39. ppt.svg
      40. pptx.svg
      41. ps.svg
      42. py.svg
      43. rar.svg
      44. rb.svg
      45. README
      46. rpm.svg
      47. rtf.svg
      48. sh.svg
      49. sql.svg
      50. svg.svg
      51. swf.svg
      52. tar.svg
      53. tgz.svg
      54. txt.svg
      55. wav.svg
      56. webm.svg
      57. xls.svg
      58. xlsx.svg
      59. xml.svg
      60. zip.svg
    64. svg.png
    65. swf.png
    66. sxc.png
    67. sxd.png
    68. sxi.png
    69. sxw.png
    70. tar.png
    71. tgz.png
    72. txt.png
    73. wav.png
    74. webm.png
    75. xls.png
    76. xlsx.png
    77. xml.png
    78. zip.png
  14. history.png
  15. icon-list.png
  16. icon-sort.png
  17. index.html
  18. info.png
  19. interwiki
    1. amazon.de.svg
    2. amazon.svg
    3. amazon.uk.svg
    4. callto.svg
    5. doku.svg
    6. google.svg
    7. paypal.svg
    8. phpfn.svg
    9. skype.svg
    10. tel.svg
    11. user.svg
    12. wp.svg
    13. wpde.svg
    14. wpes.svg
    15. wpfr.svg
    16. wpjp.svg
    17. wpmeta.svg
    18. wppl.svg
  20. interwiki.png
  21. interwiki.svg
  22. larger.gif
  23. license
    1. badge
      1. cc-by-nc-nd.png
      2. cc-by-nc-sa.png
      3. cc-by-nc.png
      4. cc-by-nd.png
      5. cc-by-sa.png
      6. cc-by.png
      7. cc-zero.png
      8. cc.png
      9. gnufdl.png
      10. publicdomain.png
    2. button
      1. cc-by-nc-nd.png
      2. cc-by-nc-sa.png
      3. cc-by-nc.png
      4. cc-by-nd.png
      5. cc-by-sa.png
      6. cc-by.png
      7. cc-zero.png
      8. cc.png
      9. gnufdl.png
      10. publicdomain.png
  24. magnifier.png
  25. media_align_center.png
  26. media_align_left.png
  27. media_align_noalign.png
  28. media_align_right.png
  29. media_link_direct.png
  30. media_link_displaylnk.png
1)
relative to your dokuwiki root
wiki/pluginsyntax/filelist.txt · Last modified: 2022/11/15 01:40 by Alan Shea