Skip to content

New command $filename. #23

@apt1002

Description

@apt1002

Define $filename(name) to be the absolute path of the file that Nancy would expand to satisfy $include(name).

This would avoid several uses of $run(dirname,$realpath). For example, in Linton, the file template.in.html includes the following (BTW what is $expand doing here?):

Last updated $run(lastmodified.in.py,$expand{$run(dirname,$realpath)}/body.in.md)

This finds the last-modified date of a file body.in.md that is in the same directory as whatever file included template.in.html. It is technically broken, in that body.in.md might not be in that directory; it might instead be in a parent directory, or in a different input tree. This example would be clearer and more correct, and would avoid using $realpath, if it were written like this:

Last updated $run(lastmodified.in.py,$filename(body.in.md))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions