-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Lua: add module "pandoc.path" #7053
Conversation
Documentation for the module can be found here: https://github.com/hslua/hslua-module-path |
d6eebd8
to
922744b
Compare
922744b
to
733df89
Compare
doc/lua-filters.md
Outdated
|
||
### directory (filepath) {#pandoc.path.directory} | ||
|
||
Get the directory name; move up one level. |
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.
I wasn't sure what was meant by "move up one level".
doc/lua-filters.md
Outdated
|
||
Normalizes a path. | ||
|
||
- `//` outside of the drive can be made blank |
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.
I wasn't sure what this meant...
|
||
Returns: | ||
|
||
- list of directories in search path (list of strings) |
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.
Should we say array? Table?
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.
The Lua manual section on the table
module uses "list" to refer to numerically indexed tables, so the terms seemed fitting to me. Do you think an alternative would be clearer?
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.
It's okay, then. I wasn't sure what the official terminology was.
@@ -0,0 +1,17 @@ | |||
local tasty = require 'tasty' | |||
local path = require 'pandoc.path' | |||
|
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.
Wouldn't hurt to add a few more tests here.
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.
I could copy the tests from hslua-module-path, but that seems redundant. Would checking for the existence of all documented functions be a good solution?
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.
I added these checks. I think it should be ok for us to rely on the module package's test suite to make sure that all functions work as expected. At least as long as we include the module without any changes.
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.
agreed.
Rely on tests in the module package to check the correctness of each function.
The module allows to work with file paths in a convenient and
platform-independent manner.