gitbook 插件 提示与强调

简介: gitbook 插件 提示与强调

提示与强调

文章目录

提示与强调

1. alerts 插件

1.1 安装

1.2 配置

1.3 效果

2. flexible-alerts 插件

2.1 安装

2.2 配置

2.3 扩展配置

2.4 效果1

2.5 自定义一个COMMENT类型

2.6. 效果2

3. emphasize 插件

3.1 安装

3.2 配置

3.3 效果

1. alerts 插件

alerts 插件功能是告警级别信息提示。这个GitBook插件将块引用转换为漂亮的警报。

1.1 安装

npm i gitbook-plugin-alerts

1.2 配置

book.json配置:

{
    "plugins": ["alerts"]
}

1.3 效果

  • info 信息样式
> **[info] For info**
>
> Use this for infomation messages.

[info] For info

Use this for infomation messages.

  • warning 警告造型
> **[warning] For warning**
>
> Use this for warning messages.

[warning] For warning

Use this for warning messages.、

  • danger 危险造型
> **[danger] For danger**
>
> Use this for danger messages.

[danger] For danger

Use this for danger messages.

  • success 成功造型
> **[success] For success**
>
> Use this for success messages.

[success] For success

Use this for success messages.

2. flexible-alerts 插件

flexible-alerts 插件将块引用转换为漂亮的警报,相比 alerts 具有更多的拓展功能。


可以在全局和警报特定级别配置外观,因此输出确实符合您的需求(如下图)。此外,您还可以提供自己的警报类型(比如最后的comment)。


Github地址:https://github.com/zanfab/gitbook-plugin-flexible-alerts#readme

2.1 安装

npm i gitbook-plugin-flexible-alerts

2.2 配置

book.json配置:

{
  "plugins": [
    "flexible-alerts"
  ],
  "pluginsConfig": {
    "flexible-alerts": {
      "note": {
        "label": "Hinweis"
      },
      "tip": {
        "label": "Tipp"
      },
      "warning": {
        "label": "Warnung"
      },
      "danger": {
        "label": "Achtung"
      }
    }
  }
}

2.3 扩展配置

语法:

> [!type|style:xx|label:xx|icon:xx|className:xx|labelVisibility:xx|iconVisibility:xx]
> 内容部分

字段介绍,如果不设置的表示选择默认,除了!type都不是必需

1671261899697.png效果对比:

> [!NOTE]
> 这是一个简单的Note类型的使用,所有的属性都是默认值。
> [!NOTE|style:flat|lable:Mylable|iconVisibility:hidden]
> "!type":`NOTE`、"style":`flat`、"lable":`自定义标签`、图标不可见

默认的 NOTE

[!NOTE]

这是一个简单的Note类型的使用,所有的属性都是默认值。

添加设置的 NOTE

[!NOTE|style:flat|lable:Mylable|iconVisibility:hidden]

“!type”:NOTE、“style”:flat、“lable”:自定义标签、图标不可见

2.4 效果1

1832b220aa754cd18c504acc7686a560.png

2.5 自定义一个COMMENT类型

在book.json中添加以下内容。然后执行gitbook install,或者使用NPM安装(单独安装推荐NPM)npm install gitbook-plugin-flexible-alerts,也可以从源码GitHub地址中下载,放到node_modules文件夹里(GitHub地址在进入插件地址右侧的GitHub链接):

{
  "plugins": [
    "flexible-alerts"
  ],
  "pluginsConfig": {
    "flexible-alerts": {
      "style": "callout",
      "comment": {
        "label": "Comment",
        "icon": "fa fa-comments",
        "className": "info"
      }
    }
  }
}

自定义COMMENT

> [!COMMENT]
> An alert of type 'comment' using style 'callout' with default settings.

[!COMMENT]

An alert of type ‘comment’ using style ‘callout’ with default settings.

2.6. 效果2

  • Info styling
Info styling
> [!NOTE]
> An alert of type 'note' using global style 'callout'.

Info styling

[!NOTE]

An alert of type ‘note’ using global style ‘callout’.

  • Info flat
Info flat
> [!NOTE|style:flat]
> An alert of type 'note' using alert specific style 'flat' which overrides global style 'callout'.

Info flat

[!NOTE|style:flat]

An alert of type ‘note’ using alert specific style ‘flat’ which overrides global style ‘callout’.

  • Tip style
Tip style
> [!TIP|style:flat|label:My own heading|iconVisibility:hidden]
> An alert of type 'tip' using alert specific style 'flat' which overrides global style 'callout'.
> In addition, this alert uses an own heading and hides specific icon.

Tip style


[!TIP|style:flat|label:My own heading|iconVisibility:hidden]

An alert of type ‘tip’ using alert specific style ‘flat’ which overrides global style ‘callout’.

In addition, this alert uses an own heading and hides specific icon.

  • Warning styling
Warning styling
> **[!WARNING] For warning**
> Use this for warning messages.

Warning styling

[!WARNING] For warning

Use this for warning messages.

  • danger styling
danger styling
> **[!DANGER] For danger**
> Use this for danger messages.

danger styling

[!DANGER] For danger

Use this for danger messages.

3. emphasize 插件

emphasize 插件功能是为文字加上底色

3.1 安装

npm i gitbook-plugin-simple-page-toc

3.2 配置

{
    "plugins": [
        "emphasize"
    ]
}

3.3 效果

在 markdown / asciidoc 内容中,使用以下内容突出显示一些文本:

- This text is {% em %}highlighted !{% endem %}
- This text is {% em %}highlighted with **markdown**!{% endem %}
- This text is {% em type="green" %}highlighted in green!{% endem %}
- This text is {% em type="red" %}highlighted in red!{% endem %}
- This text is {% em color="#ff0000" %}highlighted with a custom color!{% endem %}

效果:


This text is highlighted !

This text is highlighted with markdown!

This text is highlighted in green!

This text is highlighted in red!

This text is highlighted with a custom color!


相关文章
|
JSON 缓存 Java
Springboot 之 Filter 实现超大响应 JSON 数据压缩
Springboot 之 Filter 实现超大响应 JSON 数据压缩
769 0
|
11月前
|
算法 编译器 C语言
【2026最新】MinGW64官网下载安装保姆级教程(附安装包+图文并茂)
MinGW-w64 是 Windows 下的轻量级 GNU 编译器集合,支持 C/C++ 编译,无需虚拟机即可生成独立 exe 文件。它体积小、免安装、静态链接运行库,兼容 Win10/11 与旧系统,配置简单,广泛用于算法开发、刷题及教学场景。
17206 5
|
11月前
|
人工智能 搜索推荐 数据可视化
引入了AI大模型开发客服对话质量评估助手
摘要: 本文介绍了基于JBoltAI开发的“客服对话质量智能评估助手”项目,旨在解决传统人工质检效率低、标准不一、隐性问题难识别及数据沉淀困难等痛点。系统通过多渠道对话自动采集、AI驱动的语义解析与情感分析、多维度智能评分及个性化整改建议生成,实现了全量对话的高效、客观评估。项目采用低侵入式架构,无缝对接现有Java客服系统,显著提升质检效率(日均千条对话1小时内完成评估)、统一评估标准、精准识别服务短板,并通过结构化数据支撑团队优化。上线后用户投诉下降35%,后续将拓展语音情绪分析、智能培训推荐等功能。
965 3
|
12月前
|
传感器 算法 定位技术
基于C++的GPS INS组合导航程序
基于C++的GPS/INS(捷联惯性导航系统)组合导航程序
531 0
|
安全 Windows
修改Windows鼠标滚轮方向
本文介绍了如何在Windows系统中自定义鼠标滚轮方向。通过设备管理器识别鼠标硬件信息,找到对应的注册表项,修改`FlipFlopWheel`键值即可实现滚轮方向反转。操作简单,适用于单/多鼠标用户,提升操作体验。
2006 5
|
7月前
|
人工智能 前端开发 JavaScript
AI Agent(智能体)的输出格式应该从 Markdown 转向 HTML吗?
Anthropic工程师提出AI输出应从Markdown转向HTML,强调其高信息密度、交互性与易分享优势;但HTML存在Token消耗大、Diff困难等短板。未来更可能是“分工协作”:HTML主导前端交互(UI/Artifact),Markdown坚守后端通信(Prompt/知识结构),二者共存演进。
437 0
|
8月前
|
人工智能 安全 API
淘宝 API 技术架构与实战指南:从实时数据流到 AIGC 融合的电商开发新范式
本文系统解析2025年淘宝API 5.0技术跃迁:以实时数据流、GraphQL按需取数、隐私合规为新三角,融合6G、边缘计算与AIGC,实现毫秒级响应与智能服务。涵盖八大模块、安全架构、开发实战及行业案例,助开发者进阶电商创新。(239字)
|
前端开发 Docker 容器
写作利器,一款极简的Markdown 编辑器
WeChat Markdown Editor 是一款高度简洁的微信 Markdown 编辑器:支持 Markdown 语法、色盘取色、多图上传、一键下载文档、自定义 CSS 样式、一键重置等特性。
1439 70
写作利器,一款极简的Markdown 编辑器
|
人工智能 自然语言处理 语音技术
2025年国内主流智能客服系统:技术架构与能力深度解析
本文分析了2025年国内智能客服市场的技术格局与系统能力,从核心技术栈(NLP、知识图谱、语音技术等)到市场梯队划分,深入探讨了第一梯队的综合型平台和第二梯队的场景化服务。以合力亿捷为例,剖析其端到端AI技术栈、大模型融合、全渠道融合及运营优化能力,并对比国际顶尖通用AI在语义理解、多模态交互和自主学习方面的启示。最后为企业提供选择智能客服系统的五大考量因素,强调技术与业务场景的深度融合,助力企业实现更高效、智能的客户服务体验。
2530 2

热门文章

最新文章