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

.INCLUDE directive inside a statement block? #19

Closed
tmm1 opened this issue Jul 26, 2023 · 4 comments
Closed

.INCLUDE directive inside a statement block? #19

tmm1 opened this issue Jul 26, 2023 · 4 comments

Comments

@tmm1
Copy link

tmm1 commented Jul 26, 2023

hi, thanks for a great project

i'm trying to use .INCLUDE inside a statement block but can't quite figure it out. is it supported?

@tmm1
Copy link
Author

tmm1 commented Jul 26, 2023

I think the answer is no, as explained here:

the .INCLUDE directive is a 'compile-time' feature, but the % directive is a runtime feature

@TekWizely
Copy link
Owner

Hi @tmm1 you figured it out yes the issue is compiletime vs runtime.

You might also have a read here where the user uses bash-tpl as a static site generator tool.

I came up with a strategy (and a makefile) to host a directory of bash-tpl templates that all compile to a directory of .sh/source scripts and you include them using the source at runtime.

See if anything there might be useful and lemme know your thoughts!

Thanks for taking the time to report an issue and for your interest in my project!

-TW

@TekWizely
Copy link
Owner

Hey @tmm1 just checking in to see if you got my reply - lemme know if you wanna continue the discussion !

@TekWizely
Copy link
Owner

Hi @tmm1 I'm going to close this issue, but wanted to add one last comment.

I moved the Makefile example mentioned earlier into the Discussion area:

You can use a source path/to/file in your statement block to include a file at runtime. In the case for a template you would be sourcing the compiled template.

I am working on an idea to add a .SOURCE directive for sourcing other compiled templates that could easily send the current line indent information along so that output generated from the sourced template would be consistent.

Thanks again for your interest in my project and taking the time to report an issue.

-TW

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