--- description: components and formatting examples used in Docker's docs title: Code blocks toc_max: 3 --- # Code blocks Rouge provides lots of different code block "hints". If you leave off the hint, it tries to guess and sometimes gets it wrong. These are just a few hints that we use often. ## Raw Use the {% raw %}`{% raw %}`{% endraw %} markup tag to prevent Liquid from interpreting double braces as templating language. {% raw %} ```` {% raw %} ```none generic code block without syntax highlighting $ some command with {{double braces}} $ some other command ``` {% endraw %} ```` {% endraw %} ## Bash Use the `bash` language code block when you want to a Bash script: ```bash #!/usr/bin/bash echo "deb https://packages.docker.com/1.12/apt/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list ``` If you want to illustrate an interactive shell, use `console` instead. In cases where you use `console`, make sure to add a dollar character for the user sign: ```console $ echo "deb https://packages.docker.com/1.12/apt/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list ``` ## Go ```go incoming := map[string]interface{}{ "asdf": 1, "qwer": []interface{}{}, "zxcv": []interface{}{ map[string]interface{}{}, true, int(1e9), "tyui", }, } ``` ## PowerShell ```powershell Install-Module DockerMsftProvider -Force Install-Package Docker -ProviderName DockerMsftProvider -Force [System.Environment]::SetEnvironmentVariable("DOCKER_FIPS", "1", "Machine") Expand-Archive docker-18.09.1.zip -DestinationPath $Env:ProgramFiles -Force ``` ## Python ```python return html.format(name=os.getenv('NAME', "world"), hostname=socket.gethostname(), visits=visits) ``` ## Ruby ```ruby docker_service 'default' do action [:create, :start] end ``` ## JSON ```json "server": { "http_addr": ":4443", "tls_key_file": "./fixtures/notary-server.key", "tls_cert_file": "./fixtures/notary-server.crt" } ``` #### HTML ```html