Add support for downloading CSV file#7
Conversation
Extended plugin to provide this, by adding the options:
import=<file to display>
export=:dokuwiki:media:path:where:to:write:mediafile.csv
linkname=Name of the download link to create
Thus, I changed the syntax to use '|' as delimiter between options
rather than using ' '. I feel this is "more dokuwiki" :). However,
this breaks existing dokuwiki pages that use the csv plugin to display
a CVS file, which now would have to replace the separating space (' ')
with '|import='.
The idea behind this extension is that I want to maintain a list (in
my case a member list) in dokuwiki but provide a download link to the
csv file (also for users with only read access to the page). This is
now supported as shown in the following example:
<csv|export=:media:members.csv|linkname=Download member list>
Name,Email
,
Paul,paul@email.com
Andreads,andreas@dokuwiki.org
</csv>
It renders the CSV data as a DokuWiki table but adds a CSV download link
with the title "Download member list".
This is done in the following way:
When rendering the CSV data, this data is also copied to the export=
file. Finally, a link to the just generated file is provided.
|
In general I like the functionality but there's a couple of things I would change:
|
|
On Tuesday 29 September 2015 08:52:23 Andreas Gohr wrote:
I understand the upside that this would not render it incompatible with Further, isn't space separation really uncommon for dokuwiki plugins using the
No problem with this one.
I think it is working. In fact, that's what I am using in my docuwiki <csv|export=:media:members.csv|linkname=Download member list> Or is that now what you mean? Roland |
Options including spaces must be enclosed in quotes ". Also revert back to using file= instead of import=.
|
OK, I changed to ' ' separators, wasn't so hard after all. |
|
why did you close this? |
|
Sorry - I only started today using github. This was my misuse of the tool. |
|
Any news on pulling this? |
|
Any reason why you don't want to pull this? Are other changes needed? |
Extended plugin to provide this, by adding the options:
import=
export=:dokuwiki:media:path:where:to:write:mediafile.csv
linkname=Name of the download link to create
Thus, I changed the syntax to use '|' as delimiter between options
rather than using ' '. I feel this is "more dokuwiki" :). However,
this breaks existing dokuwiki pages that use the csv plugin to display
a CVS file, which now would have to replace the separating space (' ')
with '|import='.
The idea behind this extension is that I want to maintain a list (in
my case a member list) in dokuwiki but provide a download link to the
csv file (also for users with only read access to the page). This is
now supported as shown in the following example:
<csv|export=:media:members.csv|linkname=Download member list>
Name,Email
,
Paul,paul@email.com
Andreads,andreas@dokuwiki.org
It renders the CSV data as a DokuWiki table but adds a CSV download link
with the title "Download member list".
This is done in the following way:
When rendering the CSV data, this data is also copied to the export=
file. Finally, a link to the just generated file is provided.