Skip to main content Svelte Highlight v7.21.1

HOCON language preview

1. A basic config

dotted keys, durations, sizes, and substitutions
horizon-dark
# server configuration
app {
  name = "my-service"
  port = 8080
  timeout = 30s
  max-size = 512k

  db.url = ${?DATABASE_URL}
  db.retries += 1

  include required(classpath("defaults.conf"))
}
atom-one-dark
# server configuration
app {
  name = "my-service"
  port = 8080
  timeout = 30s
  max-size = 512k

  db.url = ${?DATABASE_URL}
  db.retries += 1

  include required(classpath("defaults.conf"))
}
github-dark
# server configuration
app {
  name = "my-service"
  port = 8080
  timeout = 30s
  max-size = 512k

  db.url = ${?DATABASE_URL}
  db.retries += 1

  include required(classpath("defaults.conf"))
}
dracula
# server configuration
app {
  name = "my-service"
  port = 8080
  timeout = 30s
  max-size = 512k

  db.url = ${?DATABASE_URL}
  db.retries += 1

  include required(classpath("defaults.conf"))
}
nord
# server configuration
app {
  name = "my-service"
  port = 8080
  timeout = 30s
  max-size = 512k

  db.url = ${?DATABASE_URL}
  db.retries += 1

  include required(classpath("defaults.conf"))
}
github
# server configuration
app {
  name = "my-service"
  port = 8080
  timeout = 30s
  max-size = 512k

  db.url = ${?DATABASE_URL}
  db.retries += 1

  include required(classpath("defaults.conf"))
}

2. Includes

the include forms and literal values
horizon-dark
include "base.conf"
include file("local.conf")
include url("https://example.com/shared.conf")

feature-flags {
  dark-mode = on
  beta-access = off
  telemetry = yes
}
atom-one-dark
include "base.conf"
include file("local.conf")
include url("https://example.com/shared.conf")

feature-flags {
  dark-mode = on
  beta-access = off
  telemetry = yes
}
github-dark
include "base.conf"
include file("local.conf")
include url("https://example.com/shared.conf")

feature-flags {
  dark-mode = on
  beta-access = off
  telemetry = yes
}
dracula
include "base.conf"
include file("local.conf")
include url("https://example.com/shared.conf")

feature-flags {
  dark-mode = on
  beta-access = off
  telemetry = yes
}
nord
include "base.conf"
include file("local.conf")
include url("https://example.com/shared.conf")

feature-flags {
  dark-mode = on
  beta-access = off
  telemetry = yes
}
github
include "base.conf"
include file("local.conf")
include url("https://example.com/shared.conf")

feature-flags {
  dark-mode = on
  beta-access = off
  telemetry = yes
}

3. Arrays and triple-quoted strings

array values and a multi-line string literal
horizon-dark
servers = ["a.example.com", "b.example.com"]

description = """
This is a multi-line
HOCON string value.
"""
atom-one-dark
servers = ["a.example.com", "b.example.com"]

description = """
This is a multi-line
HOCON string value.
"""
github-dark
servers = ["a.example.com", "b.example.com"]

description = """
This is a multi-line
HOCON string value.
"""
dracula
servers = ["a.example.com", "b.example.com"]

description = """
This is a multi-line
HOCON string value.
"""
nord
servers = ["a.example.com", "b.example.com"]

description = """
This is a multi-line
HOCON string value.
"""
github
servers = ["a.example.com", "b.example.com"]

description = """
This is a multi-line
HOCON string value.
"""