Files
pandoc/test/command/5876.md
T
Even Brenden 7df29e495f Search for metadata files in $DATADIR/metadata (#7851)
If files specified with `--metadata-file` are not found in the working
directory, look in `$DATADIR/metadata`.

Expose new `readMetadataFile` function from Text.Pandoc.Class
[API change].

Expose new `PandocCouldNotFindMetadataFileError` constructor for
`PandocError` from Text.Pandoc.Error [API change].

Closes #5876.
2022-01-21 12:00:45 -08:00

1.2 KiB

% pandoc -s -t native --data-dir=command/5876 --metadata-file=5876.yaml
Hello
^D
Pandoc
  Meta
    { unMeta =
        fromList
          [ ( "desc"
            , MetaInlines
                [ Str "Found"
                , Space
                , Str "in"
                , Space
                , Str "metadata"
                , Space
                , Str "directory."
                ]
            )
          ]
    }
  [ Para [ Str "Hello" ] ]
% pandoc -s -t native --data-dir=command/5876 --metadata-file=command/5876.yaml
Hello
^D
Pandoc
  Meta
    { unMeta =
        fromList
          [ ( "desc"
            , MetaInlines
                [ Str "Found"
                , Space
                , Str "in"
                , Space
                , Str "working"
                , Space
                , Str "directory."
                ]
            )
          ]
    }
  [ Para [ Str "Hello" ] ]
% pandoc -s -t native --data-dir=command/5876 --metadata-file=does-not-exist.yaml
Hello
^D
Could not find metadata file does-not-exist.yaml
% pandoc -s -t native --metadata-file=does-not-exist.yaml
Hello
^D
Could not find metadata file does-not-exist.yaml