You are here: PSPad forum > English discussion forum > Re: TWIG highlighter help

Re: TWIG highlighter help

#1 TWIG highlighter help

Posted by: kr37 | Date: 2015-05-24 19:57 | IP: IP Logged

Hello, does anybody have a highlighter ini for Twig? If not, I would like to make one, but could use a little guidance.

It is a simple language, but the delimiters are different from what PSPad seems to know about. Mainly there are three types of delimiter: {{ {# {%


{{ foo }}
{# comment #}
{% if foo %}{% endif %}

Twig files can look like this:

<!DOCTYPE html>
<html>
<head>
{# This is a comment #}
{{ category }}
{% block head %}
<link rel="stylesheet" href="style.css" />
<title>{% block title %}{% endblock %} - My Webpage</title>
{% endblock %}
</head>
<body>
<div id="content">{% block content %}{% endblock %}</div>
<div id="footer">
{% block footer %}
&copy; Copyright 2011 by <a href="http://domain.invalid/">you</a>.
{% endblock %}
</div>
</body>
</html>

Thank you for any help!

Edited 2 time(s). Last edit at 2015-05-24 19:59 by kr37.

Options: Reply | Quote | Up ^


#2 Re: TWIG highlighter help

Posted by: pspad | Date: 2015-05-24 20:15 | IP: IP Logged

Use standard HTML highlighter
Go to menu Settings / Highlighter settings
On the page "specification" check Smarty nad Django support

Options: Reply | Quote | Up ^


#3 Re: TWIG highlighter help

Posted by: kr37 | Date: 2015-05-25 23:38 | IP: IP Logged

Thank you, that's a great help. Is there any (relatively easy) way I could get that Enable Smart/Django support on a user-defined Twig.INI?

Options: Reply | Quote | Up ^


#4 Re: TWIG highlighter help

Posted by: pspad | Date: 2015-05-26 01:06 | IP: IP Logged

No, cause thewre is no way how to define user highlighter based on HTML with another included bracket based tags

Options: Reply | Quote | Up ^


#5 Re: TWIG highlighter help

Posted by: kr37 | Date: 2015-05-29 06:46 | IP: IP Logged

OK, thanks for the clear answer. Anyway it's already a help with the Django info.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR