tools & libs/IDES

[vscode] mustache template plugin

  • -
반응형

Spring 진영에서는 jsp를 버렸다!!

그 대안으로 밀고 있는 녀석은 Thymeleaf.

https://www.thymeleaf.org/

 

Thymeleaf

Integrations galore Eclipse, IntelliJ IDEA, Spring, Play, even the up-and-coming Model-View-Controller API for Java EE 8. Write Thymeleaf in your favourite tools, using your favourite web-development framework. Check out our Ecosystem to see more integrati

www.thymeleaf.org

개인적으로 Thymeleaf는 매우 매력적이다. 그냥 HTML이기 때문에 서버를 통하지 않고서도 페이지를 확인할 수 있는 점은 정~~ 말 매력적이다.

하지만.. 어렵다.ㅜㅜ

이에 대한 대안으로 mustache가 정말 매력적인것 같다.

mustache가 표방하는 것은 logic-less template이다. MVC의 사상에 정말 잘 어울리는 템플릿 엔진이라고 할 수 있다. Thymeleaf의 장점은 없지만 Spring Boot의 기본 템플릿 엔진으로 대우받고 있고 무지 쉽다. 이제부터 boot로 작업하면서 html이 필요하면 mustache를 써볼 계획이다.

https://mustache.github.io/

 

{{ mustache }}

Logic-less templates. Available in Ruby, JavaScript, Python, Erlang, Elixir, PHP, Perl, Raku, Objective-C, Java, C#/.NET, Android, C++, CFEngine, Go, Lua, ooc, ActionScript, ColdFusion, Scala, Clojure[Script], Clojure, Fantom, CoffeeScript, D, Haskell, XQu

mustache.github.io

 

한글로 멋지게 리뉴얼해주신 분들도 계시다.

Mustache 템플릿 문법 - 코드쓰는사람 (taegon.kim)

 

Mustache 템플릿 문법

Mustache는 제어 구조를 갖춘 것 중 (아마도) 가장 문법이 간단하고 (아마도) 가장 많은 언어로 포팅된 템플릿 엔진입니다. Mustache를 기반으로 이를 확장한 템플릿 엔진도 여럿 있는데 대표적으로는

taegon.kim

 

vs code에서 mustache 작성을 위한 플러그인 추천!!

제공되는 기능과 snippets

SnippetPurpose

layout html template
block {{$ name }} ... {{/ name }}
section {{# name }} ... {{/ name }}
inverted section {{^ name }} ... {{/ name }}
comment {{! comment }}
include {{> template }}
extends {{< template }}

 

반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.