How can I format an inline code
in Confluence like this
? I mean, not a separate code block, but just inline classname
, for example.
相关问题
- First confluence servlet plugin, ClassCastExceptio
- Confluence REST API Authorization issue
- Logstash Shipper configuration for Jira
- How can I create a new page to confluence with Pyt
- Adding link to local file in Confluence
相关文章
- How can I create a new page to confluence with Pyt
- CURL | 上传多个HTML文件汇合(CURL | Upload multiple html
- 获取SLF4JLogFactory例外尝试从合流3.0访问Web服务(Getting SLF4JLo
- Adding link to local file in Confluence
- How to check if Remote API is enabled in your Conf
- Force PDF links within iframe to open in parent wi
- Failed to execute goal on project in Maven
- 如何转换HTML代码汇合式的维基标记?(How do I convert HTML code to
I found formatting with colors a bit trickier as Confluence (5.6.3) is very fussy about spaces around the {{monospace}} blocks.
To format code in-line within your text, use the '`' character to surround your code. Usually located to the left of the '1' key on your keyboard.
Example:
Same delimiter as Stack Exchange!
By default Confluence renders monospaced text with transparent background. You can edit global CSS to add grey color. From Confluence manual:
Custom CSS for displaying grey background in monospaced blocks:
If you're using Confluence OnDemand (cloud):
{style}
blockPaste the following:
After that you'll get nice and tidy stackoverflow-stylish inline code spans just by writing
{{sometext}}
.Surround your inline text with
{{ }}
.Caveats:
}}
{{ }}
to fix it. Just retype it or paste without formatting (Cmd ⌘+Shift+V on Mac) then add{{ }}
and hit space.{{ }}
to existing text later, it can not be surrounded by other characters, e.g. if you want parenthesis around your preformatted text, you cannot fix(my text)
by adding braces({{my text}})
. First add space around your text( my text )
then add the{{ }}
.To insert inline monospace font in Confluence, surround the text in double curly-braces.
This is an
{{example}}
.If you're using Confluence 4.x or higher, you can also just select the "Preformatted" option from the paragraph style menu.
Full reference here: https://confluence.atlassian.com/display/CONF56/Quick+Reference+Guide+for+the+Confluence+Editor
All of these other answers certainly sound like good ideas and I would recommend using them first, but I will go ahead and add one more to the list for completeness' sake.
You could simply use the html macro and then paste your content wrapped in
<pre> </pre>
tags.