If given, the current section contains metadata about file or other resource with the given URL.
If empty, the URl of the file is extracted directly from the header. Otherwise, the given URL is used.
for example:
The file \x[file/path/to/myfile.c] is very useful.

= path/to/myfile.c
{file}

An explanation of what this file is about.
renders the same as:
The file \x[file/path/to/myfile.c] is very useful.

= path/to/myfile.c
{file}
{id=file/path/to/myfile.c}

An explanation of what this file is about.

\a[path/to/myfile.c][View file]
so note how:
  • automatic ID from title does not normalize the path, e.g. it does not convert / to -.
    Also, a file/ prefix is automatically added to the ID. This is needed with -S, --split-headers to avoid a collision between:
    • path/to/myfile.c: the actual file
    • file/path/to/myfile.c: the metadata about that file. Note that locally the .html extension is added as in file/path/to/myfile.c.html which avoids the collision. But on a server deployment, the .html is not present, and there would be a conflict if we didn't add that file/ prefix.
  • a link to the is added automatically, since users won't be able to click it from the header, as clicking on the header will just link to the header itself
  • a preview is added. The type of preview is chosen as follows:
    • if the URL has an image extension, do an image preview
    • otherwise if the URL has a video extension, or is a YouTube URL, do a video preview
    • otherwise, don't show a preview, as we don't know anything sensible to show
In some cases however, especially when dealing with external URLs, we might want to have a more human readable title with a file specified as in:
The video \x[tank-man-by-cnn-1989] is very useful.

= Tank Man by CNN (1989)
{file=https://www.youtube.com/watch?v=YeFzeNAHEhU}

An explanation of what this video is about.
which renders something like:
The video \x[tank-man-by-cnn-1989] is very useful.

= Tank Man by CNN (1989)

\a[https://www.youtube.com/watch?v=YeFzeNAHEhU][View file]

An explanation of what this video is about.

\Video[https://www.youtube.com/watch?v=YeFzeNAHEhU]

Ancestors