pft-grab - Man Page

Grab a file as attachment or picture

Synopsis

pft grab [options] file [file ...]

Description

Grab one or more files as attachments or pictures, put it in the right place under ROOT/content.

The command will assume by default that the file is an attachment, that is a binary file to be stored under ROOT/content/attachments. This behavior can be overridden by means of the --picture option: as result the ROOT/content/pics directory will be used instead as destination.

This command outputs the Markdown code for linking the grabbed content item in a PFT page.  The output can be inserted in the PFT entry. The output will be consistent with the attachment/picture choice: if --picture is specified, the Markdown notation for including a picture will be used, otherwise the syntax for links will be used.  See Example.

Users of the ViM editor may find useful to invoke this command from within the editor as follows:

    :read ! pft grab [options] file [file...]

Options

--today | -t

Store the file inside a content directory named after the current day. This is meant to avoid name conflict with previously stored attachments or pictures having the same name (see Example).

--picture | -p

Store the files into the ROOT/content/pics directory and output the Markdown code required to show it as a picture.

Note that no check is performed on the file format to verify it is actually a picture.

--rename=name | -r name

Rename the file. The alternate file name supplied with this option must explicitly set the extension, if an extension is desired.  Supplying the wrong extension will not imply a format change.

This option is not allowed if multiple files are grabbed with the same command.

--year=Y | -y Y

When using --today, overload year with Y. Implies --today.

--month=M | -m M

When using --today, overload month with M. Implies --today.

--day=D | -d <D>

When using --today, overload day with D. Implies --today.

--help | -h

Show this help.

Example

 $ pft grab /tmp/tux.png
 [tux.png]: :attach:tux.png

 $ pft grab /tmp/tux.png --picture
 ![tux.png](:pic:tux.png)

 $ pft grab /tmp/tux.png --picture --today
 ![tux.png](:pic:2016-04-20/tux.png)

 $ pft grab --picture http://example.com/picture.png
 ![picture.png](:pic:picture.png)

See Also

pft-make(1)

Referenced By

pft(1).

2024-01-25 perl v5.38.2 User Contributed Perl Documentation