Skip to content

JavaScript example could indicate the language #59

Open

Description

@robbiemorrison

Regarding this tutorial page:

The activated example could add "javascript" following the first set of backslashes.

Adding the language context is usually good practice (although you may want to keep your example simple).

Hope this helps R

Activity

  1. Sampo-Kolu commented on Feb 19, 2026

    @Sampo-Kolu

    I recommend this, since most people who write code do have to learn this syntax. They are not officially called language identifiers in the spec though, since some interpreters use the label you give in codeblocks in different ways, so they are called info-strings. But since for 99.9% of use-cases, it is the name of the language, we could write a comment like this next to it when you are introduced to them (we could do so at the start of the section by putting some generic programming language name in the block like "Language") , like:

    In most cases, it is gennerally good practise to include the name of the programming language after the backticks on the same line.

    I dont know JS, but could someone who does please contribute to this? This was opened 3 years ago! Anyway, I hope I made this easier to contribute for that person by writting this comment.

  2. Sampo-Kolu commented on Feb 19, 2026

    @Sampo-Kolu

    I forgot to add that the example he is probably referring to is number 3. Also, I realised that I made a typo in my example instruction and that it didn't account for non-programming languages like JSON:

    In most cases, it is generally good practise to include the name of the language (JSON, JavaScript, Python etc.) after the backticks on the same line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions