--- title: Syntax highlighting page-title: Syntax highlighting layout: default ---

HTML

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Title</title>
    </head>
    <body>
        <!-- Your content -->
    </body>
</html>

JavaScript

require(['hljs', 'jquery'], function(hljs, $){
    $(document).ready(function(){
        $('pre[data-highlight]').each(function(i, block) {
            hljs.highlightBlock(block);
        });
    });
});

SCSS

.link-overlay {
	position: relative;

	&:hover {
		.link-overlay-bg {
			opacity: 1;
		}
	}
}

JSON

[
  {
    "title": "apples",
    "count": [12000, 20000],
    "description": {"text": "...", "sensitive": false}
  },
  {
    "title": "oranges",
    "count": [17500, null],
    "description": {"text": "...", "sensitive": false}
  }
]

C++

#include <iostream>

int main(int argc, char *argv[]) {

  /* An annoying "Hello World" example */
  for (auto i = 0; i < 0xFFFF; i++)
    cout << "Hello, World!" << endl;

  char c = '\n';
  unordered_map <string, vector<string> > m;
  m["key"] = "\\\\"; // this is an error

  return -2e3 + 12l;
}

SQL

CREATE TABLE "topic" (
    "id" serial NOT NULL PRIMARY KEY,
    "forum_id" integer NOT NULL,
    "subject" varchar(255) NOT NULL
);
ALTER TABLE "topic"
ADD CONSTRAINT forum_id FOREIGN KEY ("forum_id")
REFERENCES "forum" ("id");

-- Initials
insert into "topic" ("forum_id", "subject")
values (2, 'D''artagnian');