Is it possible to add a highlighted code to Jira comment? I want to write something like this:
The comment text and JSON doc:
{
"key": 100
}
I've found only one example:
{code:javascript}
{
"key": 100
}
{code}
But it does not really highlight my code. I see only the grey block.
Select Import & Export > External System Import to open the Import external projects page. Select JSON to open the JSON File import page. Choose your JSON file. Click the Begin Import button when you are ready to begin importing your JSON file into Jira.
Go to > General Configuration > Configure Code Macro. Choose Add a new language. Locate your language file and enter a Name for the new language (this will appear when selecting the language). Choose Add.
Jira Code Macro The languages supported are: ActionScript, Ada, AppleScript, bash, C, C#, C++, CSS, Erlang, Go, Groovy, Haskell, HTML, JavaScript, JSON, Lua, Nyan, Objc, Perl, PHP, Python, R, Ruby, Scala, SQL, Swift, VisualBasic, XML and YAML. Java is the default language format used by the {code} block.
You can try to add only {code}
at the beginning and end of your code block.
Example:
{code}
{
"key": 100
}
{code}
Recent Jira 7.5+ starts supporting more languages, including JSON.
Simply use:
{code:json}
...
{code}
See syntax highlighting in https://confluence.atlassian.com/jirasoftware/jira-software-7-5-x-release-notes-934719297.html#JIRASoftware7.5.xreleasenotes-tweaksMoreimprovements.
See documentation: https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all
The default language is Java but you can specify others too, including ActionScript, Ada, AppleScript, bash, C, C#, C++, CSS, Erlang, Go, Groovy, Haskell, HTML, JavaScript, JSON, Lua, Nyan, Objc, Perl, PHP, Python, R, Ruby, Scala, SQL, Swift, VisualBasic, XML and YAML.
Default JIRA highlighting syntax list
If you have the syntax highlighting plugin you have more, but no JSON as per its homepage and this ticket asking for JSON-specific support.
Confluence doesn't have JSON-specific highlighting as per the Confluence formatting docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With