02-05-2021



Syntax highlighting in markdown

Last updated by Dan Quinney on August 08, 2016 16:33

Markup uses simple Markdown-like character delimiter syntax with custom extensions. There are four types of elements: Single line elements format a line of text such as creating a heading. Multiline elements format multiple lines of text such as creating lists or callouts. Span elements format a span of characters such as adding. Markdown is a lightweight and easy-to-use syntax for styling all forms of writing on the GitHub platform. What you will learn: How the Markdown format makes styled collaborative editing easy; How Markdown differs from traditional formatting approaches; How to use Markdown to format text; How to leverage GitHub’s automatic Markdown rendering.

Codebase allows you to use markdown in various places such as ticket updates and notebook pages. Markdown is great because of its support of code blocks. We've tied this in with Codebase's powerful syntax highlighting to provide language specific code blocks

To use the syntax highlighting, you'll need to specify the language that you're using. For example:

Pdf

or:

Here's a full list of supported languages:

  • Cucumber ('*.feature')
  • abap ('*.abap')
  • ada ('*.adb', '*.ads', '*.ada')
  • ahk ('*.ahk', '*.ahkl')
  • apacheconf ('.htaccess', 'apache.conf', 'apache2.conf')
  • applescript ('*.applescript')
  • as ('*.as')
  • as3 ('*.as')
  • asy ('*.asy')
  • bash ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass')
  • bat ('*.bat', '*.cmd')
  • befunge ('*.befunge')
  • blitzmax ('*.bmx')
  • boo ('*.boo')
  • brainfuck ('*.bf', '*.b')
  • c ('*.c', '*.h')
  • cfm ('*.cfm', '*.cfml', '*.cfc')
  • cheetah ('*.tmpl', '*.spt')
  • cl ('*.cl', '*.lisp', '*.el')
  • clojure ('*.clj', '*.cljs')
  • cmake ('*.cmake', 'CMakeLists.txt')
  • coffeescript ('*.coffee')
  • console ('*.sh-session')
  • control ('control')
  • cpp ('*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx', '*.pde')
  • csharp ('*.cs')
  • css ('*.css')
  • cython ('*.pyx', '*.pxd', '*.pxi')
  • d ('*.d', '*.di')
  • delphi ('*.pas')
  • diff ('*.diff', '*.patch')
  • dpatch ('*.dpatch', '*.darcspatch')
  • duel ('*.duel', '*.jbst')
  • dylan ('*.dylan', '*.dyl')
  • erb ('*.erb')
  • erl ('*.erl-sh')
  • erlang ('*.erl', '*.hrl')
  • evoque ('*.evoque')
  • factor ('*.factor')
  • felix ('*.flx', '*.flxh')
  • fortran ('*.f', '*.f90')
  • gas ('*.s', '*.S')
  • genshi ('*.kid')
  • glsl ('*.vert', '*.frag', '*.geo')
  • gnuplot ('*.plot', '*.plt')
  • go ('*.go')
  • groff ('*.(1234567)', '*.man')
  • haml ('*.haml')
  • haskell ('*.hs')
  • html ('*.html', '*.htm', '*.xhtml', '*.xslt')
  • hx ('*.hx')
  • hybris ('*.hy', '*.hyb')
  • ini ('*.ini', '*.cfg')
  • io ('*.io')
  • ioke ('*.ik')
  • irc ('*.weechatlog')
  • jade ('*.jade')
  • java ('*.java')
  • js ('*.js')
  • jsp ('*.jsp')
  • lhs ('*.lhs')
  • llvm ('*.ll')
  • logtalk ('*.lgt')
  • lua ('*.lua', '*.wlua')
  • make ('*.mak', 'Makefile', 'makefile', 'Makefile.*', 'GNUmakefile')
  • mako ('*.mao')
  • maql ('*.maql')
  • mason ('*.mhtml', '*.mc', '*.mi', 'autohandler', 'dhandler')
  • markdown ('*.md')
  • modelica ('*.mo')
  • modula2 ('*.def', '*.mod')
  • moocode ('*.moo')
  • mupad ('*.mu')
  • mxml ('*.mxml')
  • myghty ('*.myt', 'autodelegate')
  • nasm ('*.asm', '*.ASM')
  • newspeak ('*.ns2')
  • objdump ('*.objdump')
  • objectivec ('*.m')
  • objectivej ('*.j')
  • ocaml ('*.ml', '*.mli', '*.mll', '*.mly')
  • ooc ('*.ooc')
  • perl ('*.pl', '*.pm')
  • php ('*.php', '*.php(345)')
  • postscript ('*.ps', '*.eps')
  • pot ('*.pot', '*.po')
  • pov ('*.pov', '*.inc')
  • prolog ('*.prolog', '*.pro', '*.pl')
  • properties ('*.properties')
  • protobuf ('*.proto')
  • py3tb ('*.py3tb')
  • pytb ('*.pytb')
  • python ('*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript', '*.tac')
  • rb ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx', '*.duby')
  • rconsole ('*.Rout')
  • rebol ('*.r', '*.r3')
  • redcode ('*.cw')
  • rhtml ('*.rhtml')
  • rst ('*.rst', '*.rest')
  • sass ('*.sass')
  • scala ('*.scala')
  • scaml ('*.scaml')
  • scheme ('*.scm')
  • scss ('*.scss')
  • smalltalk ('*.st')
  • smarty ('*.tpl')
  • sourceslist ('sources.list')
  • splus ('*.S', '*.R')
  • sql ('*.sql')
  • sqlite3 ('*.sqlite3-console')
  • squidconf ('squid.conf')
  • ssp ('*.ssp')
  • tcl ('*.tcl')
  • tcsh ('*.tcsh', '*.csh')
  • tex ('*.tex', '*.aux', '*.toc')
  • text ('*.txt')
  • v ('*.v', '*.sv')
  • vala ('*.vala', '*.vapi')
  • vbnet ('*.vb', '*.bas')
  • velocity ('*.vm', '*.fhtml')
  • vim ('*.vim', '.vimrc')
  • xml ('*.xml', '*.xsl', '*.rss', '*.xslt', '*.xsd', '*.wsdl')
  • xquery ('*.xqy', '*.xquery')
  • xslt ('*.xsl', '*.xslt')
  • yaml ('*.yaml', '*.yml')

Tracker uses a version of Markdown (“Tracker-Flavored Markdown”) for description, comments, tasks, blockers and titles. It is very similar to GitHub-Flavored Markdown, which improves upon Standard Markdown in many ways.

Markdown utilizes an easily consumable plaintext syntax to denote rich content elements such as bold/italic items, numbered and bulleted lists, code blocks, headers, and images. Getting started with Markdown is fairly easy. If you’re not familiar with Markdown, it may be worth your while to read Daring Fireball’s Markdown Syntax Guide.

Preview markdown

When you use markdown in a story or epic description or comment field, you can click the Preview tab to see how the markdown will render after you save your changes.

Edit modePreview mode

Basic syntax

The following overview will introduce you to some of the most commonly used Markdown Syntax, which can be used in story descriptions, comments, tasks, blockers and titles (though some fields offer limited support, see Where you can use Markdown).

Styling text

StyleSyntaxExampleOutput
Strikethrough~~ ~~~~I didn't mean to write this~~I didn’t mean to write this
Bold** ** or __ __**I love Tracker** or __I love Tracker__I love Tracker
Italic* * or _ _*I love Tracker* or _I love Tracker_I love Tracker
Bold and Italic*** *** or ___ ___***I love Tracker*** or ___I love Tracker___I love Tracker

Blockquotes

Quote your text with a greater-than angle bracket >

Links

Create inline links by wrapping text in brackets [ ], then wrapping the URL in parenthesis ( )

Lists

Create bulleted lists by preceding lines of text with - or *

Create numbered lists by preceding each line with a number. Note that lists beginning with an arbitrary number will automatically be converted to start with 1

Create unordered combination and nested ordered lists by indenting lines with four spaces

Headers

Use anywhere from 1-6 hash # characters at the start of the line, corresponding to header levels 1-6

Inline images

Insert inline images using the following syntax

Inline code blocks

To fence off a span of code, wrap the text with backticks

The word `code` has been fenced off with backticks.

You can add syntax highlighting for quite a few languages, including Gherkin, by adding a language name after the opening three backticks of your fenced code block. See our post “Syntax Highlighting- now with more Gherkin” for more details.

For more on mastering Markdown please see Daring Fireball’s Markdown Syntax Guide as well as GitHub’s Guide to Mastering Markdown.

Tables

Add tables by using three or more hyphens to create a header for each column (---), and separate those columns using pipes (|). Optionally, you can use pipes on either end of your table.

The output will render similar to this:

Syntax
Cat BreedsTemperament
Maine CoonGentle giant
SiameseChatty Cathy
PantherLess gentle giant

The cell widths can vary and will not affect the rendered output.

Align the text in your columns to the left, right, or center by adding a colon (:) to the left, right, or on both sides of the hyphens within the header row.

Here’s how the above alignment choices will render:

Github Markdown Cheatsheet

Cat BreedsColorTemperament
Maine CoonAll typesGentle giant
SiameseBlack and tanChatty Cathy
PantherBlack or tanLess gentle giant

Where you can use Markdown

Description: full Tracker-Flavored Markdown

Activity: full Tracker-Flavored Markdown

Title: only bold, italic, strikethrough, and links

Tasks: only inline Markdown (such as bold, italic, strikethrough, links, story tags, inline code blocks, etc.)

Blockers: full Tracker-Flavored Markdown

Project Profile: full Tracker-Flavored Markdown

Differences from Standard Markdown

New lines

With Standard Markdown, new lines are stripped out between elements, which often causes unintentional formatting issues. Like GitHub-Flavored Markdown, Tracker renders line breaks between content elements as </br> tags, and double line breaks as new paragraphs.

Multiple underscores in words

Markdown interprets * or _ wrapped words and phrases as bold and italic emphasis. Since underscores are often used within text to define method names and variables (e.g., some_method_name), Tracker ignores interior _ and * characters.

URL Auto-linking

Tracker automatically links URLs beginning with http:// or https://. This differs from Standard Markdown, which requires distinct tagging for URLs.

Fenced code blocks and code highlighting

As with GitHub, Tracker enables fenced code blocks by wrapping content with three backticks, whereas Standard Markdown converts text elements prefixed with a tab or spaced text elements to code blocks.

Note:

By default, Tracker does not highlight syntax in code blocks. To enable syntax highlighting, add the language name next to the first line of backticks.

Markdown Syntax Cheatsheet

@mention autocompletes

Tracker supports mentioning of team members within comments. Tracker will attempt to autocomplete team members’ names when prefixed with the @ symbol.

Story and epic tagging

Tracker also supports hyperlinking of stories and epics by IDs. Story IDs prefixed with # (e.g., #12345) will link to that story. Epic IDs prefixed with ## (e.g., ##54321) will link to that epic.

Markdown Syntax Image

Similarly, Tracker will detect story URLs and condense them into their associated IDs.