question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add basic smarty templating support

See original GitHub issue

I am using js-beautify to format smarty files. It would be helpful if I can extend/modify the Tokenizer prototype. I’ve noticed that the module is not exported. Is there some other way to do it?

I am seeking for an API to extend the Tokenizer functions.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bitwisemancommented, Sep 21, 2020

To be clear, you should be able to get the basic behavior you want if you take the start and end regular expressions you have here and integrate them into templatablepattern.js. This would prevent smarty tags from getting mangled.

1reaction
bitwisemancommented, Jul 23, 2020

@aswinkumar863
You need to at least run make js on your fork. If you commit the lib folder, then you might be able to run npm install myusername/repo#branchName. But as I said that is not what I would suggest.

Also, I looked at the changes in your fork. I would suggest you make changes in templatablepattern.js instead of adding the while loops. That class handles template tokenizing for the entire beautifier. Adding the smarty templating to it should get you exactly what you’re looking for.

Give it a try and if you run into problems, come over to the gitter.im channel and I’ll be happy to answer questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Smarty Template Support - Visual Studio Marketplace
Extension for Visual Studio Code - Smarty template support with formatting, folding, snippets, syntax highlighting and more.
Read more >
Chapter 3. Basic Syntax - Smarty Template Engine
In Smarty, all content outside of delimiters is displayed as static content, or unchanged. When Smarty encounters template tags, it attempts to interpret ......
Read more >
Get Started with Smarty Syntax - Cordial Knowledge Base
Cordial's template syntax is built on Smarty (a PHP based template language). It is a very powerful scripting language that can be used...
Read more >
Smarty PHP Template Engine in Visual Studio - YouTube
This video quickly guides you through the Smarty template engine and how the PHP Tools plugin helps you use it.
Read more >
Template Engine Basics - PHP Smarty - YouTube
This shows how to get started with PHP Smarty.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found