Syntax Highlight

DocsApp support all major programming language syntax highlight.

Example

JavaScript

function fibonacci(n) {
   return n < 1 ? 0
        : n <= 2 ? 1
        : fibonacci(n - 1) + fibonacci(n - 2);
}

console.log(fibonacci(4));

Python

def fib(n):
 a,b = 1,1
 for i in range(n-1):
  a,b = b,a+b
 return a
 
print fib(5)

Golang

package main

import "fmt"

// fib returns a function that returns
// successive Fibonacci numbers.
func fib() func() int {
	a, b := 0, 1
	return func() int {
		a, b = b, a+b
		return a
	}
}

func main() {
	f := fib()
	// Function calls are evaluated left-to-right.
	fmt.Println(f(), f(), f(), f(), f())
}

Scala

package recursion

/**
 * Calculating a Fibonacci sequence recursively using Scala.
 */
object Fibonacci extends App {

    println(fib(1, 2))
  
    def fib(prevPrev: Int, prev: Int) {
        val next = prevPrev + prev
        println(next)
        if (next > 1000000) System.exit(0)
        fib(prev, next)
    }
}

Supported Syntax

Common Syntax

Apache Bash C# C++
CSS CoffeeScript Diff HTML, XML
HTTP Ini JSON Java
JavaScript Makefile Markdown Nginx
Objective-C PHP Perl Python
Ruby SQL

Additional Syntax

1C ARM Assembly AVR Assembler Access log
ActionScript Ada AppleScript Arduino
AsciiDoc AspectJ Augmented Backus-Naur Form AutoHotkey
AutoIt Awk Axapta Backus–Naur Form
Basic Brainfuck C/AL CMake
CSP Caché Object Script Cap’n Proto Ceylon
Clojure Clojure REPL Coq Crystal
D DNS Zone file DOS .bat Dart
Delphi Device Tree Django Dockerfile
Dust ERB (Embedded Ruby) Elixir Elm
Erlang Erlang REPL Excel Extended Backus-Naur Form
F# FIX Fortran G-code (ISO 6983)
GAMS GAUSS GLSL Gherkin
Go Golo Gradle Groovy
HSP HTMLBars Haml Handlebars
Haskell Haxe IRPF90 Inform 7
Intel x86 Assembly Julia Kotlin LDIF
Lasso Less Linden Scripting Language Lisp
LiveCode LiveScript Lua MEL
MIPS Assembly Mathematica Matlab Maxima
Mercury Mizar Mojolicious Monkey
MoonScript NSIS Nimrod Nix
OCaml OpenSCAD Oracle Rules Language Oxygene
Parser3 Pony PowerShell Processing
Prolog Protocol Buffers Puppet PureBASIC
Python profile Q QML R
RenderMan RIB RenderMan RSL Roboconf Rust
SCSS SML SQF STEP Part 21
Scala Scheme Scilab Smali
Smalltalk Stan Stata Stylus
SubUnit Swift TP Tagger Script
Tcl TeX Test Anything Protocol Thrift
Twig TypeScript VB.NET VBScript
VBScript in HTML VHDL Vala Verilog
Vim Script XL XQuery YAML
Zephir crmsh dsconfig pf