Hi Tom,
I am not on the Jira team but I will try to help.
If your goal is to display code in various fields in Jira (like description, comments, etc.) then you can do so using the wiki-style markup.
https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=advanced
Eg.
{code:title=Bar.java|borderStyle=solid}
// Some comments here
public String getFoo()
{
return foo;
}
{code}
If you can't use this markup then you (or your admin) may need to configure the correct renderer.
I hope that helps!
Thanks Martyn!
Is there anyway to add a language?
It would be nice to have PowerShell.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tom,
that page I linked to mentions the following
"Makes a preformatted block of code with syntax highlighting. All the optional parameters of {panel} macro are valid for {code} too. 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."
I think the closest to PowerShell will be bash.
You could try
{code:bash}
...
{code}
I hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is very confusing because in Confluence markup-style code blocks are used (backticks)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The code block is for simple syntax highlighting of code or text. Jira hasn't caught up to Confluence yet (even after many years), so there are no "advanced" features, like line numbering, theming, support for many languages, or showing it in a collapsible panel.
Basically, what it does for you is shows you the literal text (without having to escape Wiki markup) inside the panel, in a distinctive font, and supports some syntax highlighting for a few of the most popular development languages. You can also control the color of the main text, the background color of the panel, and give your panel a header with a title for easy reference. But nothing fancy beyond coloring a few keywords from the language you've specified.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.