Articles in this section
Category / Section

How to Write Articles With Code Blocks

Published:

The code blocks are used to highlight the codes across the entire article.

How to use the code blocks

Follow the given steps to insert the code block on Markdown or WYSIWYG,

  1. Choose the Insert Code from the Markdown or WYSIWYG Editor toolbar.

In Markdown:

Markdown.png

In WYSIWYG:

WYSIWYG.png

  1. Select a language identifier for your code block to enable syntax highlighting in a different language.

change_language.png

  1. Enter or copy the code into the dialog box, then click Insert.

code dialog.png

  1. Add a blank line before and after code sections in the editor to improve the readability of raw formatting.

Note: If you are not sure about the exact language identifiers, choose “Others”. It will automatically identify styles based on the relevant code.

How to change the highlighted language in the WYSIWYG editor

  1. Select the Edit icon by drifting over the code block in the WYSIWYG editor.

edit_code.png

  1. Choose a different language identifier and click Update.

change_editor_language.png

Supported highlight languages

Language Identifiers
1C 1c
ABNF abnf
Access logs accesslog
Ada ada
Arduino (C++ w/Arduino libs) arduino, ino
ARM assembler armasm, arm
AVR assembler avrasm
ActionScript actionscript, as
AngelScript angelscript, asc
Apache apache, apacheconf
AppleScript applescript, osascript
Arcade arcade
AsciiDoc asciidoc, adoc
AspectJ aspectj
AutoHotkey autohotkey
AutoIt autoit
Awk awk, mawk, nawk, gawk
Bash bash, sh, zsh
Basic basic
BNF bnf
Brainfuck brainfuck, bf
C# csharp, cs
C c, h
C++ cpp, hpp, cc, hh, c++, h++, cxx, hxx
C/AL cal
Cache Object Script cos, cls
CMake cmake, cmake. in
Coq coq
CSP csp
CSS css
Cap’n Proto capnproto, capnp
Clojure clojure, clj
CoffeeScript coffeescript, coffee, cson, iced
Crmsh crmsh, crm, pcmk
Crystal crystal, cr
D d
Dart dart
Delphi dpr, dfm, pas, pascal
Diff diff, patch
Django django, jinja
DNS Zone file dns, zone, bind
Dockerfile dockerfile, docker
DOS dos, bat, cmd
dsconfig dsconfig
DTS (Device Tree) dts
Dust dust, dst
EBNF ebnf
Elixir elixir
Elm elm
Erlang erlang, erl
Excel excel, xls, xlsx
F# fsharp, fs
FIX fix
Fortran fortran, f90, f95
G-Code gcode, nc
Gams gams, gms
GAUSS gauss, gss
Gherkin gherkin
Go go, golang
Golo golo, gololang
Gradle gradle
GraphQL graphql
Groovy groovy
HTML, XML xml, html, xhtml, rss, atom, xjb, xsd, xsl, plist, svg
HTTP http, https
Haml haml
Handlebars handlebars, hbs, html.hbs, html.handlebars
Haskell haskell, hs
Haxe haxe, hx
Hy hy, hylang
Ini, TOML ini, toml
Inform7 inform7, i7
IRPF90 irpf90
JSON json
Java java, jsp
JavaScript javascript, js, jsx
Julia julia, julia-repl
Kotlin kotlin, kt
LaTeX tex
Leaf leaf
Lasso lasso, ls, lassoscript
Less less
LDIF ldif
Lisp lisp
LiveCode Server livecodeserver
LiveScript livescript, ls
Lua lua
Makefile makefile, mk, mak, make
Markdown markdown, md, mkdown, mkd
Mathematica mathematica, mma, wl
Matlab matlab
Maxima maxima
Maya Embedded Language mel
Mercury mercury
Mizar mizar
Mojolicious mojolicious
Monkey monkey
Moonscript moonscript, moon
N1QL n1ql
NSIS nsis
Nginx nginx, nginxconf
Nim nim, nimrod
Nix nix
OCaml ocaml, ml
Objective C objectivec, mm, objc, obj-c, obj-c++, objective-c++
OpenGL Shading Language glsl
OpenSCAD openscad, scad
Oracle Rules Language ruleslanguage
Oxygene oxygene
PF pf, pf.conf
PHP php
Parser3 parser3
Perl perl, pl, pm
Plaintext plaintext, txt, text
Pony pony
PostgreSQL & PL/pgSQL pgsql, postgres, postgresql
PowerShell powershell, ps, ps1
Processing processing
Prolog prolog
Properties properties
Protocol Buffers protobuf
Puppet puppet, pp
Python python, py, gyp
Python profiler results profile
Python REPL python-repl, pycon
Q k, kdb
QML qml
R r
ReasonML reasonml, re
RenderMan RIB rib
RenderMan RSL rsl
Roboconf graph, instances
Ruby ruby, rb, gemspec, podspec, thor, irb
Rust rust, rs
SAS SAS, sas
SCSS scss
SQL sql
STEP Part 21 p21, step, stp
Scala scala
Scheme scheme
Scilab scilab, sci
Shell shell, console
Smali smali
Smalltalk smalltalk, st
SML sml, ml
Stan stan, stanfuncs
Stata stata
Stylus stylus, styl
SubUnit subunit
Swift swift
Tcl tcl, tk
Test Anything Protocol tap
Thrift thrift
TP tp
Twig twig, craftcms
TypeScript typescript, ts, tsx
VB.Net vbnet, vb
VBScript vbscript, vbs
VHDL vhdl
Vala vala
Verilog verilog, v
Vim Script vim
X++ axapta, x++
x86 Assembly x86asm
XL xl, tao
XQuery xquery, xpath, xq
YAML yml, yaml
Zephir zephir, zep
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied