Skip to content
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

Feature Request : Ability to "Parse In Place" via persisting delimiters (comment tags) #4

Open
kerns opened this issue Apr 5, 2021 · 1 comment

Comments

@kerns
Copy link

kerns commented Apr 5, 2021

Exactly the project I needed. Though it seems like the directory structure of the source folder (in your example resources/config/* is flattened after processing and isn't respecting the original structure.

This is highly undesirable for my use case where I have a templates folder that contains a dozen sub-folders organized by type and section. A "preserve structure" option would solve this for me.

But maybe more pressing –  my templates directory doesn't need to be moved anywhere. Everything that needs to be parsed is already in the location where it belongs.

This presents a problem when the tags used to indicate which strings need to be appended are overwritten in the appending :)

But Iif the delimiter tags were comments instead of template tags, then query strings that needed updating could always be located and updated/amended, and could also be parsed in place (without relocation).

So for example... instead of

<square70x70logo src="{{/images/logo70.png}}" />

Something like...

<!-- % -->
<square70x70logo src="/images/logo70.png?" />
<!-- % -->

...where your code is only scanning within any open and closing <!-- % --> for href and src – and then finally the ? at the end...updating it according to the manifest.

Even better, after the first run you can update the comment with a time stamp.

<!-- ## Last updated 12.02.21 ## -->
<square70x70logo src="/images/logo70.png?" />
<!-- #### -->

There are probably better ways to tackle it, but you get the idea. Could also be done with comment tags that don't end up in your html.

{{% <square70x70logo src="/images/logo70.png?" /> %}}

So an option for defining the comment or bracket style, together with a requirement and understanding that a ? needs to be at the end of your src or href for the initial parse, and that would do it.

Not easy, I know! But it would be much more broadly usable I think if you can pull it off.

@kerns kerns changed the title Feature Request – More Options! Feature Request : Ability to "Parse In Place" via persisting delimiters (comments!) Apr 5, 2021
@kerns kerns changed the title Feature Request : Ability to "Parse In Place" via persisting delimiters (comments!) Feature Request : Ability to "Parse In Place" via persisting delimiters (comment tags) Apr 5, 2021
@recursive-beast
Copy link
Owner

recursive-beast commented Apr 25, 2021

Sorry for the long wait.
Since other people are using this package, I actually wanted to rewrite it and use typescript to provide intelisence, maby somehow make the API more easy to extend (for cases like yours for example), and give it a better name too 😆 , because to be honest right now it's a mess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants