|Re: FlyingObjects.dwar's picture and description fields [message #306 is a reply to message #304]
||Sun, 04 February 2018 19:54
Registered: June 2014
There is not official explanation and there is no direct way from DataWarrior to import images or html content.|
But you can do that with a little editing of the dwar file in a text editor.
Lets assume you intend to add html and jpeg files to a column named 'Name'. You start with:
-a dwar file without any associated html or jpeg content.
-a folder with html files and one with jpeg files, both to be associated with the rows of the dwar file.
First you need to define one of the dwar's columns to carry the detail information.
This is done by defining column properties. Lets assume you want to add the detail links to
a column called 'Name'. For that you need to extend the column properties section, if there is one.
Otherwise you create a new one just after the </datawarrior-fileinfo> line. For that you add these lines:
These lines define for the column 'Name' two detail types (indicated by '0' and '1'):
- mime type 'image/jpeg' with the name 'Picture' to be found in a directory 'images'
- mime type 'text/html' with the name 'Description' to be found in a directory 'html'
Likewise you might use 'absPath' to define a complate detail directory path rather than a relative path from the dwar file.
Now you may concatenate detail file references to the respective cell content of the 'Name' column.
For instance you may add to a cell containing the name 'Aermacchi' the following: '|#|0:aermacchi.jpg|#|1:aermacchi.html'.
'|#|' serves as separator. Then comes a number (here 0 or 1) referring to the detail number in the properties section.
After the columns comes the detail file name. It must reflect the defined mime type.
If you open the updated dwar file in DataWarrior, if will show you the detail information. You may
the save the file under a different name and DataWarrior will ask you, whether the detail shall
be imported directly into the dwar file. If you do so, the directories with the individual files are not needed anymore.
I hope, I was clear and this solves your question...
[Updated on: Sun, 04 February 2018 19:55]
Report message to a moderator