Boost C++ Libraries Home Libraries People FAQ More


Editor Support 編輯器的支持

Scintilla Text Editor  Scintilla 文本編輯器
KDE Support  KDE 的支持

Editing quickbook files is usually done with text editors both simple and powerful. The following sections list the settings for some editors which can help make editing quickbook files a bit easier.
編輯 quickbook 文件通常都是用簡單又強大的文本編輯器。以下章節列出一些編輯器的設置,它們可以使得 quickbook 文件的編輯容易一點。

Section contributed by Dean Michael Berris
本節由 Dean Michael Berris 貢獻

The Scintilla Text Editor (SciTE) is a free source code editor for Win32 and X. It uses the SCIntilla source code editing component.
Scintilla 文本編輯器(SciTE)是一個用於 Win32 和 X 的免費源代碼編輯器。它使用了 SCIntilla 源代碼編輯組件。

You can use the following settings to highlight quickbook tags when editing quickbook files.
你可以用以下設置來使得在編輯 quickbook 文件時對 quickbook 標籤高亮顯示。


boost::hs::quickbook is a syntax highlighting designed to work with Katepart. It can be used in KWrite, Kate, Konqueror and KDevelop, and supports all the constructs of Quickbook 1.4 including tables, list, templates and macros.
boost::hs::quickbook 是一個用於 Katepart 的語法高亮設計。它可用於 KWrite, Kate, Konqueror 和 KDevelop,並且支持 Quickbook 1.4 的所有結構,包括表格、列表、模板和宏。

.qbk loaded in a text editor 裝入到一個文本編輯器中的 .qbk


.qbk loaded with boost::hs support 用 boost::hs 支持裝入的 .qbk


html generated from this .qbk file 由該 .qbk 文件生成的 html

Table 28.7. Code examples




for loop

for(int k=0; k<10; k++) v+=k;

Sums some numbers.

while loop

{ int k; while( k < 10 ) { v+=k; k++ } }

Same effect.

infinite loop

while( true ) { v+=1; }

Not a good example.

Code Folding 代碼折疊

boost::hs goes far beyond simple coloring. One useful thing you can get the editor to do is to mark regions. They appear in a small grey line and each region can be folded or unfolded independently.
boost::hs 遠遠超出簡單的語法著色。你可以從編輯器獲得的一個有用的東西是對區域進行標誌。它們顯示為一個小的灰色行,每個區域可以獨立地折疊或展開。

Auto Comment / Uncomment 自動註釋/去註釋

Another important feature is the possibility to auto-comment or uncomment some piece of code (Tools - Comment). Commented regions can be uncommented simple calling the uncomment command while being in it.
另一個重要的特性是,可以對一段代碼進行自動註釋或去註釋(Tools - Comment)。被註釋的區域可以簡單地通過調用 uncomment 命令進行去註釋。

Styles reference 風格參考

Name 名稱

Style 風格

Description 說明

plain text

normal black

Plain text at each level.

formatted text

formatted black

Bold, italic, underline and mixes. Teletype, replaceable, strikeout.


light blue

All quickbook structures characters ([, ], [block-type, simple formating boundaries, lists keywords (*, #)



Names in macro definitions, macros insertion if it is used the __xxx__ proposed sintaxis.



Names in template definitions



All the keywords that are used to link quickbooks together.


italic light gray

Inside the commentaries.


HTML like

Reveal the structure, bold title, higlighted HTML like columns titles.

variable lists

HTML like

Reveal the structure, bold title, bold HTML like items names.

c++ code

cpp Kate syntax

Code blocks and inline code.



Image, files and web paths

IDE specific

dark blue

IDE commands

About boost::hs  關於 boost::hs


boost::hs::quickbook is a component of boost::hs, a syntax highlighting for C++, doxygen, Boost.Build jamfiles and QuickBook. boost::hs has his own page here.
boost::hs::quickbook 是 boost::hs 的一個組件,一個用於 C++, doxygen, Boost.Build jamfiles 和 QuickBook 的語法高亮。boost::hs 具有自己的網頁 在此

[Note] Note 備註

boost::hs::cpp support QuickBook code import comments style!
boost::hs::cpp 支持 QuickBook 的代碼導入註釋風格!

Installing boost::hs 安裝 boost::hs

There exist an ongoing effort to push boost::hs upstream to the KatePart project. In a few months KDE may have native Quickbook support! For the moment you must download and install it.
我們正在不斷努力將 boost::hs 推高至 KatePart 項目。幾個月之後的 KDE 也許會帶有原生的 Quickbook 支持!目前你還是需要下載並安裝它。

You can download boost::hs from here.
你可以從 這裡 下載 boost::hs。

[Note] Note 備註

A copy of boost::hs::quickbook and boost::hs::cpp is available in boost/tools/quickbook/extra/katepart.
boost/tools/quickbook/extra/katepart 中也有 boost::hs::quickbook 和 boost::hs::cpp 的復件。

In order to install it you must copy the content in the folder katepart/syntax/ to the appropriate katepart syntax folder in your machine. In general this folder will be in /usr/share/apps/katepart/syntax. A bash script named is included that copy the files to this folder.
為了安裝它,你必須將文件夾 katepart/syntax/ 中的內容複製到你機器中的適當的 katepart 語法文件夾中。通常,該文件夾位於 /usr/share/apps/katepart/syntax。已含的一個名為 的 bash 腳本可以將這些文件複製到該文件夾中。