import Foundation

@objc class Person: Entity {
  var name: String!
  var age:  Int!

  init(name: String, age: Int) {
    /* /* ... */ */

  // Return a descriptive string for this person
  func description(offset: Int = 0) -> String {
    return "\(name) is \(age + offset) years old"




  1. 2014-07-08

    Version 8.1

    New languages:

    New styles:

    Other improvements:

    • The README is heavily reworked and brought up to date by Jeremy Hull.
    • Added listLanguages() method in the API.
    • Improved C/C++/C# detection.
    • Added a bunch of new language aliases, documented the existing ones. Thanks to Sindre Sorhus for background research.
    • Added phrasal English words to boost relevance in comments.
    • Many improvements to SQL definition made by Heiko August, Nikolay Lisienko and Travis Odom.
    • The shorter lang- prefix for language names in HTML classes supported alongside language-. Thanks to Jeff Escalante.
    • Ruby's got support for interactive console sessions. Thanks to Pascal Hurni.
    • Added built-in functions for R language. Thanks to Artem A. Klevtsov.
    • Rust's got definition for lifetime parameters and improved string syntax. Thanks to Roman Shmatov.
    • Various improvements to Objective-C definition by Matt Diephouse.
    • Fixed highlighting of generics in Java.
  2. 2014-01-08

    Version 8.0

    This new major release is quite a big overhaul bringing both new features and some backwards incompatible changes. However, chances are that the majority of users won't be affected by the latter: the basic scenario described in the README is left intact.

    Here's what did change in an incompatible way:

    • We're now prefixing all classes located in CSS classes reference with hljs-, by default, because some class names would collide with other people's stylesheets. If you were using an older version, you might still want the previous behavior, but still want to upgrade. To suppress this new behavior, you would initialize like so:

      <script type="text/javascript">
        hljs.configure({classPrefix: ''});
    • tabReplace and useBR that were used in different places are also unified into the global options object and are to be set using configure(options). This function is documented in our API docs. Also note that these parameters are gone from highlightBlock and fixMarkup which are now also rely on configure.

    • We removed public-facing (though undocumented) object hljs.LANGUAGES which was used to register languages with the library in favor of two new methods: registerLanguage and getLanguage. Both are documented in our API docs.

    • Result returned from highlight and highlightAuto no longer contains two separate attributes contributing to relevance score, relevance and keyword_count. They are now unified in relevance.

    Another technically compatible change that nonetheless might need attention:

    • The structure of the NPM package was refactored, so if you had installed it locally, you'll have to update your paths. The usual require('highlight.js') works as before. This is contributed by Dmitry Smolin.

    New features:

    • Languages now can be recognized by multiple names like "js" for JavaScript or "html" for, well, HTML (which earlier insisted on calling it "xml"). These aliases can be specified in the class attribute of the code container in your HTML as well as in various API calls. For now there are only a few very common aliases but we'll expand it in the future. All of them are listed in the [class reference][].

    • Language detection can now be restricted to a subset of languages relevant in a given context — a web page or even a single highlighting call. This is especially useful for node.js build that includes all the known languages. Another example is a StackOverflow-style site where users specify languages as tags rather than in the markdown-formatted code snippets. This is documented in the API docs (see methods highlightAuto and configure).

    • Language definition syntax streamlined with variants and beginKeywords.

    New languages and styles:

    Miscelleanous improvements:

    • Highlighting => prompts in Clojure.
    • Jeremy Hull fixed a lot of styles for consistency.
    • Finally, highlighting PHP and HTML mixed in peculiar ways.
    • Objective C and C# now properly highlight titles in method definition.
    • Big overhaul of relevance counting for a number of languages. Please do report bugs about mis-detection of non-trivial code snippets!
  3. 2013-11-20

    Version 7.5

    A catch-up release dealing with some of the accumulated contributions. This one is probably will be the last before the 8.0 which will be slightly backwards incompatible regarding some advanced use-cases.

    One outstanding change in this version is the addition of 6 languages to the hosted script: Markdown, ObjectiveC, CoffeeScript, Apache, Nginx and Makefile. It now weighs about 6K more but we're going to keep it under 30K.

    New languages:


    • Ruby's got support for characters like ?A, ?1, ?\012 etc. and %r{..} regexps.
    • Clojure now allows a function call in the beginning of s-expressions (($filter "myCount") (arr 1 2 3 4 5)).
    • Haskell's got new keywords and now recognizes more things like pragmas, preprocessors, modules, containers, FFIs etc. Thanks to Zena Treep for the implementation and to Jeremy Hull for guiding it.
    • Miscelleanous fixes in PHP, Brainfuck, SCSS, Asciidoc, CMake, Python and F#.
  4. 2013-11-10

    New core developers

    The latest long period of almost complete inactivity in the project coincided with growing interest to it led to a decision that now seems completely obvious: we need more core developers.

    So without further ado let me welcome to the core team two long-time contributors: Jeremy Hull and Oleg Efimov.

    Hope now we'll be able to work through stuff faster!

    P.S. The historical commit is here for the record.

  5. 2013-10-30

    Version 7.4

    This long overdue version is a snapshot of the current source tree with all the changes that happened during the past year. Sorry for taking so long!

    Along with the changes in code highlight.js has finally got its new home at, moving from its craddle on Software Maniacs which it outgrew a long time ago. Be sure to report any bugs about the site to

    On to what's new…

    New languages:

    New style themes:

    Other notable changes:

    • Corrected many corner cases in CSS.
    • Dropped Python 2 version of the build tool.
    • Implemented building for the AMD format.
    • Updated Rust keywords (thanks to Dmitry Medvinsky).
    • Literal regexes can now be used in language definitions.
    • CoffeeScript highlighting is now significantly more robust and rich due to input from Cédric Néhémie.
  6. 2012-10-13

    Version 7.3

    • Since this version highlight.js no longer works in IE version 8 and older. It's made it possible to reduce the library size and dramatically improve code readability and made it easier to maintain. Time to go forward!

    • New languages: AppleScript (by Nathan Grigg and Dr. Drang) and Brainfuck (by Evgeny Stepanischev).

    • Improvements to existing languages:

      • interpreter prompt in Python (>>> and ...)
      • @-properties and classes in CoffeeScript
      • E4X in JavaScript (by Oleg Efimov)
      • new keywords in Perl (by Kirk Kimmel)
      • big Ruby syntax update (by Vasily Polovnyov)
      • small fixes in Bash
    • Also Oleg Efimov did a great job of moving all the docs for language and style developers and contributors from the old wiki under the source code in the "docs" directory. Now these docs are nicely presented at

  7. 2012-08-27

    Version 7.2

    A regular bug-fix release without any significant new features. Enjoy!

  8. 2012-08-11

    Version 7.1

    A Summer crop:

    • Marc Fornos made the definition for Clojure along with the matching style Rainbow (which, of course, works for other languages too).
    • CoffeeScript support continues to improve getting support for regular expressions.
    • Yoshihide Jimbo ported to highlight.js five Tomorrow styles from the project by Chris Kempson.
    • Thanks to Casey Duncun the library can now be built in the popular AMD format.
    • And last but not least, we've got a fair number of correctness and consistency fixes, including a pretty significant refactoring of Ruby.
  9. 2012-06-05

    Version 7.0

    The reason for the new major version update is a global change of keyword syntax which resulted in the library getting smaller once again. For example, the hosted build is 2K less than at the previous version while supporting two new languages.

    Notable changes:

    • The library now works not only in a browser but also with node.js. It is installable with npm install highlight.js. API docs are available on our wiki.

    • The new unique feature (apparently) among syntax highlighters is highlighting HTTP headers and an arbitrary language in the request body. The most useful languages here are XML and JSON both of which highlight.js does support. Here's the detailed post about the feature.

    • Two new style themes: a dark "south" Pojoaque by Jason Tate and an emulation of XCode IDE by Angel Olloqui.

    • Three new languages: D by Aleksandar Ružičić, R by Joe Cheng and GLSL by Sergey Tikhomirov.

    • Nginx syntax has become a million times smaller and more universal thanks to remaking it in a more generic manner that doesn't require listing all the directives in the known universe.

    • Function titles are now highlighted in PHP.

    • Haskell and VHDL were significantly reworked to be more rich and correct by their respective maintainers Jeremy Hull and Igor Kalnitsky.

    And last but not least, many bugs have been fixed around correctness and language detection.

    Overall highlight.js currently supports 51 languages and 20 style themes.

  10. 2012-04-07

    Version 6.2

    A lot of things happened in highlight.js since the last version! We've got nine new contributors, the discussion group came alive, and the main branch on GitHub now counts more than 350 followers. Here are most significant results coming from all this activity: