Drupal 8 Twig templates comments syntax

As a quick note, the Drupal 8 Twig template comment syntax looks like this:

{# this is a comment #}

The Twig multiline comment syntax uses the same characters:

   This is a comment.
   More comments ...
   Even more comments ...

Markdown comments syntax: Comments that won’t appear in generated output

Markdown FAQ: How do I create comments in Markdown? Especially comments that won’t appear in the generated output.

Part 1 of my answer is that technically there is no way — or at least no standard way — to create comments in Markdown documents, other than to use HTML comments like this:

Drupal 8: How to put a View or Block between the Content and Comments

I’m not going to discuss this code much, but in short, the source code below is for a Drupal 8 preprocess_node function that I use to set variables for (a) a custom view and (b) a custom block. I set the variables in this function, and then display them in my node.html.twig file like this:

{{ similar_by_terms }}

and this:

Play Framework template comments (syntax)

When you want to create Play Framework template comments, use the @* ... *@ syntax. Here's a one-line comment:


Here's a multiline comment:

 * Four score
 * and seven year ago
 * our fathers ...

(You can format that however you want.)

You can use comments as the first line of Play Framework templates (before the function declaration):

Comments in PHP - PHP comment syntax and examples

It's funny, when I first started working with PHP, the first thing I wanted to know is "What is the PHP comments syntax?" (It reminds me of learning to ride a motorcycle, where the first thing you want/need to learn is how to stop.)

Fortunately, if you have a Unix/Linux and/or C programming background, the PHP comment syntax will seem very familiar, and I'll share some simple PHP comment examples here.

Java comment examples

Question: How do I create a comment in Java?

Answer: There are two ways to create Java comments, and both are shown in the example code below:

// this is a one-line comment

 * this is also
 * a comment, but it can span multiple
 * lines.

The // syntax makes everything after it on the current line a Java comment, and the /** ... */ syntax lets you create multi-line Java comments.

AppleScript comments (comment syntax)

AppleScript comments FAQ: How do I create comments in AppleScript?

Answer: There are two ways to create comments in AppleScript, and here are examples of both approaches.

AppleScript comments with "--" or "#" syntax

First, you can use the "--" syntax. This lets you create a comment like this at the beginning of a line:

-- my comment
display dialog "yada"

You can also use the same syntax to put a comment at the end of a line, like this:

How to put comments in your code with Javadoc


One of the nice things about Java is javadoc. The javadoc utility lets you put your comments right next to your code, inside your ".java" source files. When you're satisfied with your code and comments, you simply run the javadoc command, and your HTML-style documentation is automatically created for you.

Wed, Aug 9, 2006 (Poor quality of the Targus Chill Pad)

While the Targus Chill Pad is a great idea, it is the worst manufactured piece of equipment I can ever recall using. I really can't remember buying anything that was made with such poor quality.

The rubber pads on the top of the Chill Pad constantly fall out. I've tried glueing them in to keep them in, and after the fourth attempt they seem to be staying in.