Community
    • Login

    How to: {{Moustache}} code highlighting for Notepad++

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 6.0k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Sam ZamS Offline
      Sam Zam
      last edited by Sam Zam

      Hi folks!

      I have some .php files with Moustache {{}} code in them, and would like the code to be “highlighted correctly” by Notepad++.

      At the moment all is black and unrecognised!

      What steps must I undertake to enable Moustache{{ }} code highliting?

      Please do a step by step as i’m not a seasoned programmer, just content writer who happens to have fall in love with Notepad++ ;)

      Thanks!

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Sam Zam
        last edited by

        @Sam-Zam

        npp uses scintilla as its syntax highlighting engine.
        In order to make this work, the php (and maybe the html ) lexer needs to be changed.
        I found a discussion from 2012 and the author of scintilla
        refused to implement this.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Sam ZamS Offline
          Sam Zam
          last edited by Sam Zam

          Dear Claudia

          Thank you for your answer. Does that mean that it is not possible let alone easy to have {{moustache}} syntax working in Notepad++?

          Greetings, Sam

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC Offline
            Claudia Frank @Sam Zam
            last edited by

            @Sam-Zam

            Does that mean that it is not possible let alone easy to have {{moustache}} syntax working in Notepad++?

            Yes, the only save way to make this happen is to change the lexer.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • Gogo NeatzaG Offline
              Gogo Neatza
              last edited by

              RegEx Helper as a plugin can offer some help (assuming that RegEx Helper is already installed):

              Open your file in Notepad++
              Set the language to Php
              Launch the plugin using Ctrl+F12
              Type in the “Regular Expression” window: ({{)|(}})
              Turn on the highlighting using ‘Mark’ button.

              Tested using this Moustache template:
              <strong>Hello, {{firstname}}</strong><br>
              <p>You are visitor number {{visitorNumber}}.</p>

              1 Reply Last reply Reply Quote 1

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors