New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow placing custom readers and writers in data subdir #8112
Conversation
6bc7791
to
25b66e6
Compare
25b66e6
to
e47e3c6
Compare
src/Text/Pandoc/Class/PandocMonad.hs
Outdated
@@ -668,6 +669,29 @@ withPaths (p:ps) action fp = | |||
catchError ((p </> fp,) <$> action (p </> fp)) | |||
(\_ -> withPaths ps action fp) | |||
|
|||
-- | If @fp@ doesn't exist, but the data file relative to @/subdir/@ | |||
-- does, then return that; otherwise return @fp@. | |||
findFile :: PandocMonad m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to revise my original suggestion, but what about findFileWithDataFallback
?
findFile
should be reserved for something less special-purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, could we use this function to simplify readMetadataFile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both done
e47e3c6
to
2f87d25
Compare
2f87d25
to
128b95d
Compare
128b95d
to
55ae676
Compare
This looks good to go. |
be sought in the readers/writers subdirectory of the user data directory if not found relative to the working directory. Documents #8112.
No description provided.