Title
Create new category
Edit page index title
Edit category
Edit link
Shared Database Mode
Code blocks allow you to write in pretty formatted code that has syntax highlighting in multiple coding languages.
Supported Languages
The following languages are currently supported for syntax highlighting:
Bash, C , C-Like, C++, C#, CSS, CSV, D, Dart, Django, Docker, Go, HTML, HTTP, Javascript, Java, JSON, JSX, Kotlin, Lua, Markdown, Markup, Objective-C, Pascal, Perl, PHP, Powershell, Python, R, Rust, Ruby, Sass, Scss, Scala, SQL, Squirrel, Swift, Typescript, VB.NET, Visual Basic, XML.
If you need more languages, we'd be happy to support them. Give us a nudge!
Syntax error highlighting only shows while editing
Warning
Error
Success
Code Block Example
Here is how to write the fibonacci sequence in different languages:
function fibonacci(num, memo) { memo = memo || {}; if (memo[num]) return memo[num]; if (num <= 1) return 1; return memo[num] = fibonacci(num - 1, memo) + fibonacci(num - 2, memo);}Multi Language Code Blocks
You can add multiple languages for each code block that will show as tabs, such as the example above.
No Formatting Code Block
Code blocks can have no formatting if language "None" is selected. Also, if only language "None" was provided for the code block, then the language selector will disappear unless if the tab has a title. For example:
This is a code block with no formatting- Correct?And another one with title:
A titled code block without formatting keeps its titleTitled Tabs
You can also provide titles for each tab, which is a great way to identify and group the content. For example:
[ { "id": 4, "published": true, "name": "v1.0", "created": "2019-03-20T19:02:14+0000", "updated": "2019-03-20T19:02:14+0000", "slug": "developerhub.io-api", "ordr": 4 }]