如何在Confluence中这样格式化内联代码?我的意思是,不是一个单独的代码块,而只是内联类名。


当前回答

若要在文本内格式化代码,请使用' "字符将代码括起来。通常位于键盘上“1”键的左边。

例子:

`printf("Hello World");`

与Stack Exchange相同的分隔符!

其他回答

我发现做到这一点的最简单的方法是从行开始写markdown。按Ctrl+D(打开标记输入对话框的快捷键)并键入markdown。普通的维基编辑器似乎不太适合精确格式化。它似乎不太了解字符样式,只知道段落样式。

如果你有WinWord,你可以复制你需要的东西到它,修改结果,然后粘贴到Confluence。我发现它比其他解简单。

对我来说最简单的方法是插入标记。

然后在文本框中输入花括号之间的文本。

它将在新行中插入格式化的文本,但您可以在任何地方复制它,甚至内联。

若要在文本内格式化代码,请使用' "字符将代码括起来。通常位于键盘上“1”键的左边。

例子:

`printf("Hello World");`

与Stack Exchange相同的分隔符!

用{{}}包围内联文本。

警告:

You have to hit the spacebar after }} You can't copy inline preformatted text and maintain it's look. If you do copy it you might not be able to add {{ }} to fix it. Just retype it or paste without formatting (Cmd ⌘+Shift+V on Mac) then add {{ }} and hit space. If you add the {{ }} 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 {{ }}.