swift - 在 Swift 标记语言中重命名默认呈现的标题,如 "Example"

标签 swift markup swift-playground

原始标记

enter image description here

渲染标记

enter image description here

如何将“渲染标记”中的单词 Example 更改为我想要的任何内容?

最佳答案

自定义标注

您可以使用 Custom Callout

/*:
 # Hello, playground!

 The print() function in Swift
 
 * callout(Custom Title):
    print("Hello, playground!")
 
*/

呈现为(使用 Dusk 主题)

enter image description here


额外的预定义标注

如果您不喜欢自定义标注的颜色,还有一些其他标注(除了示例)可用于 playground

/*:
 # Hello, playground!

 The print() function in Swift
 
 * Example:
    print("Hello, playground!")
 
 * Experiment:
    print("Hello, playground!")
 
 * Important:
    print("Hello, playground!")
 
 * Note:
    print("Hello, playground!")
 
*/

enter image description here

有关更多详细信息,请参阅 the Markup Formatting Reference - Markup Functionality .

关于swift - 在 Swift 标记语言中重命名默认呈现的标题,如 "Example",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38923167/

相关文章:

html - 如何处理子页面上的多个h1元素

Swift Playground - 如何将带逗号的字符串转换为带小数的字符串

ios - 为什么这个 dispatch_after 会立即触发?

ios - SpriteKit 纹理图集文件夹结构

xcode - 为什么某些 Swift 标准库函数在 playground 中无法识别?

ios - 关闭然后打开 iOS 应用程序到特定的 ViewController

javascript - 更改 <input> 字段的显示

asp.net - 如何计算 asp 转发器中的项目数?

swift - 无法在 Xcode Playgrounds 中初始化 UICollectionView

ios - 来自 Apple Review Team 的 EXC_BREAKPOINT (SIGTRAP) 崩溃报告