-
-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Hi! I'm just trying to create a condition. If src/index.js
exists call apidocs for it and then if not exists check if index.js
on root exists and call apidocs.
I tried ifExists
helper, but it not worked as expected. Even always returns (somehow) truthy value. I expect (as read the code too) to return empty string if file not exist.
So the snippet in that if shouldn't be rendered, but it is.
{% if (ifExists('./src/inxxxxxxxxxdex.js')) { %}
## API
Review carefully the provided examples and the working [tests](./test.js).
{%= apidocs('src/index.js') %}
{% } %}
Even with .length
(which is surely falsey value, negative) it still renders the block that is inside the if
.
But even if it worked, it still be better if apidocs support such feature by default. What i imagine
## API
Review carefully the provided examples and the working [tests](./test.js).
{%= apidocs(['src/index.js', 'index.js']) %}
So when src/index.js
not exist, it will continue to the next one until it find existing file.
Also tried with require
helper to require the fs
and call existsSync
but it throws that it's not a function