Replies: 2 comments 2 replies
-
I've been using this Prettier plugin and it works well enough: Unfortunately it appears to be abandoned by its maintainer and presently it isn't compatible with Prettier 3+. Still, better than nothing! |
Beta Was this translation helpful? Give feedback.
-
Hey, I tried melody a long time ago too, but it don't seem maintained anymore. I have djLint in my to-try list. It looks very active and seems to provide some really nice features. Among those:
Here's a quick test with the online formatter: {% block html_head_container %}
{% include 'html-header.twig' %}
{% block head %}{% endblock %}
</head>
{% endblock %}
<body class="{{ body_class }}" data-template="base.twig">
<a class="skip-link screen-reader-text" href="#content">{{ _e("Skip to content") }}</a>
<header class="header">
{% block header %}
<div class="wrapper">
<h1 class="hdr-logo" role="banner">
<a class="hdr-logo-link" href="{{ site.url }}" rel="home">{{ site.name }}</a>
</h1>
<nav id="nav-main" class="nav-main" role="navigation">
{% include "menu.twig" with {'items': menu.get_items} %}
</nav>
<!-- #nav -->
</div>
{% endblock %}
</header>
<section id="content" role="main" class="content-wrapper">
{% if title %}<h1>{{ title }}</h1>{% endif %}
<div class="wrapper {{ sidebar_class }}">
{% block content %}Sorry, no content{% endblock %}
</div>
{% if sidebar %}
<aside class="layout-sidebar">
{{ sidebar }}
</aside>
{% endif %}
</section>
{% block footer %}
<footer id="footer">
{% include 'footer.twig' %}
</footer>
{{ function("wp_footer") }}
{% endblock %}
</body>
</html> Since I didn't try it yet, I'm interested in your feedback if you give it a shot! 😉 |
Beta Was this translation helpful? Give feedback.
-
Trying timber out for the first time. I had used Twig with GravCMS in the past and don't remember having much a problem formatting twig there.
Just installed the Timber Starter Theme and opened base.twig and formatted with the Twig Language 2 extension and got this:
I'm guessing the lack of some opening tags are throwing the parser for a ride.
Anyway, my question is what extensions are Timber + VSCode users using?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions