Closed CreepySkeleton closed 4 years ago
I think we can leave environment variable interpolation as a job for later. Maybe create an issue for it and if people find it necessary it can be implemented on demand... Thoughts?
If the syntax is simple $IDENT
than I could implement it in no-brainer mode 😄 , not a big burden. But if you want to support ${IDENT}
- well, this is where things get complicated...
There we go! Sorry for the delay, my spare time suddenly disappeared two days ago :(
I implemented the env interpolation as $IDENT
plus \\
and \$
escapes.
Also, I performed a little refactoring, replacing Regex
with a wrapper of our on. This does break your public API since the type is different, but I believe this is justifiable change because:
Plus docs and tests.
Nobody seems to depend on your lib anyway, no offense.
Lol, none taken! It's an executable, so the command-line arguments and configuration part of the public interface but the crate should be considered unstable internals used by the binary.
The entire crate is very specific to a mdbook
application, so I doubt people would want to depend on it anyway 😋
Thanks for all the hard work @CreepySkeleton! I've merged this PR and will make a release the day after tomorrow when I'm back in civilisation.
Closes #22
What is implemented
Bugs fixed
exclude
array properly, for example, if one was a prefix of the another, they would be considered equal (hint:Iterator::zip
is short-cutting 😄 ). This is fixed.What is not implemented
Environment variables interpolation. I agree this is pretty easy to implement, but I'd like to clarify the syntax.
$
+ ident? maybe also\$
escape...Further improvements
In my opinion, it would be better to use some wrapper in place of
Regex
, implementing string-basedHash
,Serialize
,Deserialize
,PartialEq
for it. It would greatly simplify certain parts of the code, but that would be a breaking change since you'd already put aRegex
in the public API (theexclude
array).TODO
Tests (how should they look like?) and documentation.