Code Blocks - DeveloperHub.io
Code Blocks - DeveloperHub.io
io/support-center/code-blocks
Code Blocks
Code blocks allow you to write in pretty formatted code that has syntax highlighting in multiple coding languages.
• Type /
Supported Languages
The following languages are currently supported for syntax highlighting:
Bash , C , C-Like , C++ , C# , CSS , CSV , D , Dart , Django , Docker , Go , Groovy , 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!
Info
" Syntax error highlighting only shows while editing
- Correct?
No Formatting
Titled 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
}
]
Collapsing Contents
Code block contents will collapse automatically (if possible) if there are more than 100 lines in the code block. All
lines will be folded except the first line. Example:
YAML
▾ paths:
▸ /page/{id}: ...
▸ /documentation/{id}/page: ...
You may use the widely adopted keyboard shortcuts in a code block to expand or collapse:
• Expand: Ctrl + I
• Collapse: Ctrl + Y
• For each tab, you could enable showing line numbers from the tab options.
• Globally, you could enable showing line numbers for all code blocks in the project. See option
code.showLineNumbers in advanced settings.
Highlight Code
Lines of code can be highlighted. From the tab option menu, you can write down the line numbers to be
highlighted. The syntax for highlighting is as such:
For example:
return $converter->convert($html);
blocks
Related pages
Callouts #
Images #
Tables #
Videos #
Custom HTML #