wiki:plugins-demo/NoteBoxMacro

NoteBoxMacro: 使用不同的颜色区域和图标表示各类消息

示例

使用 [[NoteBox(note,说明信息)]] 这样的写法表示一个说明信息.

使用 [[NoteBox(tip,提示信息)]] 这样的写法表示一个提示信息.

使用 [[NoteBox(warn,警告信息)]] 这样的写法表示一个警告信息.

注意事项

  1. 第二个参数(说明文本)前面如果加上空格, 会缩进显示, 也就是说图标和文字间的距离会变大, 例如:

    一个空格

    两个空格

  2. 第二个参数中间如果存在逗号(,), 需要使用 \, 来进行转义;

使用文档

[[NoteBox]]

The NoteBox macro will render a small colored box with an icon and text.

To display a NoteBox on a page, you must call the NoteBox macro and pass the style and text as arguments. The text may contain wiki formatting, however it is not possible to embed other wiki macros within the macro. Also, commas must be escaped with a backslash.

A third optional argument allows the width of the NoteBox to be specified. The width can be specified in pixels as a percent of the page width. The default width is 70%.

The following styles are available: warn, tip and note.

Examples:

[[NoteBox(warn,If you don't run `update` before `commit`\, your checkin may fail.)]]
[[NoteBox(tip,The !NoteBox macro can bring '''attention''' to text within a page.,50%)]]
[[NoteBox(note,More styles may be added in a ''future'' release.,350px)]]

If you don't run update before commit, your checkin may fail.

The NoteBox macro can bring attention to text within a page.

More styles may be added in a future release.

Last modified 5 years ago Last modified on 2013-01-05T00:07:37+08:00