mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +02:00
doc: switch from prettify to pygments for syntax highlighting
This commit is contained in:
@@ -40,6 +40,10 @@ Bug fixes::
|
||||
* irc: fix parsing of CAP message when there is no prefix (issue #1707)
|
||||
* irc: fix parsing of TAGMSG message when there is a colon before the channel
|
||||
|
||||
Documentation::
|
||||
|
||||
* doc: switch from prettify to pygments for syntax highlighting
|
||||
|
||||
Tests::
|
||||
|
||||
* core: add build with CMake and Ninja in CI
|
||||
|
||||
+1
-1
@@ -1263,7 +1263,7 @@ if test "x$enable_man" = "xyes" -o "x$enable_doc" = "xyes"; then
|
||||
enable_man="no"
|
||||
enable_doc="no"
|
||||
fi
|
||||
ASCIIDOCTOR_ARGS="-a experimental -a 'prewrap!' -a icons=font -a sectanchors -a source-highlighter=prettify"
|
||||
ASCIIDOCTOR_ARGS="-a experimental -a 'prewrap!' -a icons=font -a sectanchors -a source-highlighter=pygments -a pygments-style=native"
|
||||
AC_SUBST(ASCIIDOCTOR)
|
||||
AC_SUBST(ASCIIDOCTOR_ARGS)
|
||||
fi
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ if(ENABLE_MAN OR ENABLE_DOC)
|
||||
find_package(Asciidoctor)
|
||||
if(ASCIIDOCTOR_FOUND)
|
||||
# common asciidoctor arguments
|
||||
set(ASCIIDOCTOR_ARGS -a experimental -a "prewrap!" -a icons=font -a revnumber="${VERSION}" -a sectanchors -a source-highlighter=prettify)
|
||||
set(ASCIIDOCTOR_ARGS -a experimental -a "prewrap!" -a icons=font -a revnumber="${VERSION}" -a sectanchors -a source-highlighter=pygments -a pygments-style=native)
|
||||
|
||||
# sed arguments used to replace links in ChangeLog and release notes
|
||||
set(SED_LINKS_ARGS
|
||||
|
||||
@@ -3941,7 +3941,7 @@ bestätigt wurde (siehe Option <<option_relay.network.websocket_allowed_origins,
|
||||
|
||||
Ein WebSocket kann in HTML5, mit einer JavaScript Zeile, geöffnet werden:
|
||||
|
||||
[source,js]
|
||||
[source,javascript]
|
||||
----
|
||||
websocket = new WebSocket("ws://server.com:9000/weechat");
|
||||
----
|
||||
|
||||
@@ -35,4 +35,14 @@ kbd {
|
||||
margin: 0 .2em;
|
||||
font-family: monospace;
|
||||
}
|
||||
/* syntax highlighting tuning */
|
||||
pre.pygments .tok-cp {
|
||||
color: #ed4848;
|
||||
}
|
||||
pre.pygments .tok-nc, pre.pygments .tok-nf {
|
||||
color: #649fef;
|
||||
}
|
||||
pre.pygments .tok-gu, pre.pygments .tok-nc, pre.pygments .tok-nn {
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
+16
-16
@@ -511,7 +511,7 @@ directory:
|
||||
|
||||
Example in C:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* weechat.c - core functions for WeeChat
|
||||
@@ -549,7 +549,7 @@ Some basic rules you *must* follow when you write C code:
|
||||
|
||||
Example:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* Checks if a string with boolean value is valid.
|
||||
@@ -580,7 +580,7 @@ foo ()
|
||||
Exception: in `for` loops, where variables like "i" or "n" are OK.
|
||||
* Initialize local variables after declaration, in body of function, example:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
void
|
||||
foo ()
|
||||
@@ -598,7 +598,7 @@ foo ()
|
||||
* Place curly brackets `+{ }+` alone on lines, and indent them with number of
|
||||
spaces used for line above opening curly bracket (the `if` in example):
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
if (nicks_count == 1)
|
||||
{
|
||||
@@ -609,7 +609,7 @@ if (nicks_count == 1)
|
||||
* Use empty lines to separate many different blocks inside functions, and if
|
||||
possible add a comment for each one, like this:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* Sends a message from out queue.
|
||||
@@ -652,7 +652,7 @@ irc_server_outqueue_send (struct t_irc_server *server)
|
||||
* Indent the `if` conditions, and use parentheses around conditions with an
|
||||
operator (not needed for single boolean), like this:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
if (something)
|
||||
{
|
||||
@@ -676,7 +676,7 @@ else
|
||||
|
||||
* Indent the `switch` statements like this:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
switch (string[0])
|
||||
{
|
||||
@@ -694,7 +694,7 @@ switch (string[0])
|
||||
|
||||
* Use `typedef` for function prototypes but not for structures:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
typedef int (t_hook_callback_fd)(void *data, int fd);
|
||||
|
||||
@@ -776,7 +776,7 @@ Structures have name _t_X_Y_ or _t_X_Y_Z_:
|
||||
|
||||
Example: an IRC nick (from _src/plugins/irc/irc-nick.h_):
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_irc_nick
|
||||
{
|
||||
@@ -806,7 +806,7 @@ _X_ is name of variable, using singular form).
|
||||
|
||||
Example: windows (from _src/gui/gui-window.c_):
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_gui_window *gui_windows = NULL; /* first window */
|
||||
struct t_gui_window *last_gui_window = NULL; /* last window */
|
||||
@@ -826,7 +826,7 @@ Naming convention for functions is the same as
|
||||
|
||||
Example: creation of a new window (from _src/gui/gui-window.c_):
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* Creates a new window.
|
||||
@@ -862,7 +862,7 @@ and next node.
|
||||
|
||||
Example: list of buffers (from _src/gui/gui-buffer.h_):
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_gui_buffer
|
||||
{
|
||||
@@ -877,7 +877,7 @@ struct t_gui_buffer
|
||||
|
||||
Then the two list pointers, to the head and tail of list:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_gui_buffer *gui_buffers = NULL; /* first buffer */
|
||||
struct t_gui_buffer *last_gui_buffer = NULL; /* last buffer */
|
||||
@@ -1067,7 +1067,7 @@ Then some macros are defined to call these functions.
|
||||
For example, function _hook_timer_ is defined in structure _t_weechat_plugin_
|
||||
like this:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_hook *(*hook_timer) (struct t_weechat_plugin *plugin,
|
||||
long interval,
|
||||
@@ -1080,7 +1080,7 @@ struct t_hook *(*hook_timer) (struct t_weechat_plugin *plugin,
|
||||
|
||||
And the macro used to call this function is:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
#define weechat_hook_timer(__interval, __align_second, __max_calls, \
|
||||
__callback, __data) \
|
||||
@@ -1091,7 +1091,7 @@ And the macro used to call this function is:
|
||||
|
||||
So in a plugin, the call to function will be for example:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
server->hook_timer_sasl = weechat_hook_timer (timeout * 1000,
|
||||
0, 1,
|
||||
|
||||
+617
-617
File diff suppressed because it is too large
Load Diff
@@ -3853,7 +3853,7 @@ WebSocket if required headers are found in handshake and if origin is allowed
|
||||
|
||||
A WebSocket can be opened in a HTML5 with a single line of JavaScript:
|
||||
|
||||
[source,js]
|
||||
[source,javascript]
|
||||
----
|
||||
websocket = new WebSocket("ws://server.com:9000/weechat");
|
||||
----
|
||||
|
||||
+16
-16
@@ -513,7 +513,7 @@ fichiers sont dans le répertoire _po/_ :
|
||||
|
||||
Exemple en C :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* weechat.c - core functions for WeeChat
|
||||
@@ -554,7 +554,7 @@ Quelques règles basiques que vous *devez* suivre quand vous écrivez du code C
|
||||
|
||||
Exemple :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* Checks if a string with boolean value is valid.
|
||||
@@ -587,7 +587,7 @@ foo ()
|
||||
* Initialisez les variables locales après la déclaration, dans le corps de la
|
||||
fonction, exemple :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
void
|
||||
foo ()
|
||||
@@ -607,7 +607,7 @@ foo ()
|
||||
nombre d'espaces utilisés sur la ligne au dessus de l'accolade ouvrante (le
|
||||
`if` dans l'exemple) :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
if (nicks_count == 1)
|
||||
{
|
||||
@@ -618,7 +618,7 @@ if (nicks_count == 1)
|
||||
* Utilisez des lignes vides pour séparer différents blocs dans les fonctions, et
|
||||
si possible ajoutez un commentaire pour chacun, comme ceci :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* Sends a message from out queue.
|
||||
@@ -662,7 +662,7 @@ irc_server_outqueue_send (struct t_irc_server *server)
|
||||
conditions avec un opérateur (pas nécessaire pour un booléen simple), comme
|
||||
ceci :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
if (something)
|
||||
{
|
||||
@@ -686,7 +686,7 @@ else
|
||||
|
||||
* Indentez les `switch` comme ceci :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
switch (string[0])
|
||||
{
|
||||
@@ -705,7 +705,7 @@ switch (string[0])
|
||||
* Utilisez `typedef` pur les prototypes de fonctions mais pas pour les
|
||||
structures :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
typedef int (t_hook_callback_fd)(void *data, int fd);
|
||||
|
||||
@@ -787,7 +787,7 @@ Les structures ont le nom _t_X_Y_ ou _t_X_Y_Z_ :
|
||||
|
||||
Exemple : un pseudo IRC (de _src/plugins/irc/irc-nick.h_) :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_irc_nick
|
||||
{
|
||||
@@ -817,7 +817,7 @@ _last_X_ (où _X_ est le nom de la variable, en utilisant le singulier).
|
||||
|
||||
Exemple : fenêtres (de _src/gui/gui-window.c_) :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_gui_window *gui_windows = NULL; /* first window */
|
||||
struct t_gui_window *last_gui_window = NULL; /* last window */
|
||||
@@ -837,7 +837,7 @@ La convention pour les noms des fonctions est le même que celui des
|
||||
|
||||
Exemple : création d'une nouvelle fenêtre (de _src/gui/gui-window.c_) :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* Creates a new window.
|
||||
@@ -875,7 +875,7 @@ pointeur vers le nœud précédent/suivant.
|
||||
|
||||
Exemple : liste des tampons (de _src/gui/gui-buffer.h_) :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_gui_buffer
|
||||
{
|
||||
@@ -890,7 +890,7 @@ struct t_gui_buffer
|
||||
|
||||
Et les deux pointeurs vers la tête et la fin de liste :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_gui_buffer *gui_buffers = NULL; /* first buffer */
|
||||
struct t_gui_buffer *last_gui_buffer = NULL; /* last buffer */
|
||||
@@ -1086,7 +1086,7 @@ Et puis des macros sont utilisées pour appeler ces fonctions.
|
||||
Par exemple, la fonction _hook_timer_ est définie dans la structure
|
||||
_t_weechat_plugin_ comme ceci :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_hook *(*hook_timer) (struct t_weechat_plugin *plugin,
|
||||
long interval,
|
||||
@@ -1099,7 +1099,7 @@ struct t_hook *(*hook_timer) (struct t_weechat_plugin *plugin,
|
||||
|
||||
Et la macro utilisée pour appeler cette fonction est :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
#define weechat_hook_timer(__interval, __align_second, __max_calls, \
|
||||
__callback, __data) \
|
||||
@@ -1110,7 +1110,7 @@ Et la macro utilisée pour appeler cette fonction est :
|
||||
|
||||
Donc dans une extension, l'appel à cette fonction sera par exemple :
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
server->hook_timer_sasl = weechat_hook_timer (timeout * 1000,
|
||||
0, 1,
|
||||
|
||||
+617
-617
File diff suppressed because it is too large
Load Diff
@@ -3982,7 +3982,7 @@ poignée de main et si l'origine est autorisée (voir l'option
|
||||
Un WebSocket peut être ouvert dans une page HTML5 avec une seule ligne de
|
||||
JavaScript :
|
||||
|
||||
[source,js]
|
||||
[source,javascript]
|
||||
----
|
||||
websocket = new WebSocket("ws://server.com:9000/weechat");
|
||||
----
|
||||
|
||||
+617
-617
File diff suppressed because it is too large
Load Diff
@@ -4143,7 +4143,7 @@ WebSocket if required headers are found in handshake and if origin is allowed
|
||||
|
||||
A WebSocket can be opened in a HTML5 with a single line of JavaScript:
|
||||
|
||||
[source,js]
|
||||
[source,javascript]
|
||||
----
|
||||
websocket = new WebSocket("ws://server.com:9000/weechat");
|
||||
----
|
||||
|
||||
+16
-16
@@ -555,7 +555,7 @@ WeeChat とプラグインの翻訳は gettext で行います、ファイルは
|
||||
** 電子メールアドレス、
|
||||
** ライセンス。
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* weechat.c - core functions for WeeChat
|
||||
@@ -593,7 +593,7 @@ C 言語のコードを書く際には以下の基本的なルールを *必ず*
|
||||
|
||||
例:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* Checks if a string with boolean value is valid.
|
||||
@@ -624,7 +624,7 @@ foo ()
|
||||
例外: `for` ループのカウンタ変数に "i" や "n" を使うのは問題ありません。
|
||||
* 関数内で行うローカル変数の初期化は宣言の後に行ってください、例:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
void
|
||||
foo ()
|
||||
@@ -642,7 +642,7 @@ foo ()
|
||||
* 中括弧 `+{ }+` は制御文の次の行に単独で置き、制御文 (以下の `if` です)
|
||||
と同じ空白文字の数だけインデントしてください:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
if (nicks_count == 1)
|
||||
{
|
||||
@@ -652,7 +652,7 @@ if (nicks_count == 1)
|
||||
|
||||
* 関数内部でブロックを分けるには空行を使ってください、可能であればそれぞれのブロックにコメントを付けてください:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* Sends a message from out queue.
|
||||
@@ -695,7 +695,7 @@ irc_server_outqueue_send (struct t_irc_server *server)
|
||||
* `if` 条件はインデントし、演算子を含む条件は丸括弧で括ってください
|
||||
(単独のブール値を評価する場合は不要)、例:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
if (something)
|
||||
{
|
||||
@@ -719,7 +719,7 @@ else
|
||||
|
||||
* `switch` 文は以下の様にインデントしてください:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
switch (string[0])
|
||||
{
|
||||
@@ -737,7 +737,7 @@ switch (string[0])
|
||||
|
||||
* 関数プロトタイプには `typedef` を使い、構造体を使わないでください:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
typedef int (t_hook_callback_fd)(void *data, int fd);
|
||||
|
||||
@@ -819,7 +819,7 @@ _wee-command.c_ のヘッダファイルは _wee-command.h_ です
|
||||
|
||||
例: IRC のニックネーム (_src/plugins/irc/irc-nick.h_ より):
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_irc_nick
|
||||
{
|
||||
@@ -849,7 +849,7 @@ struct t_irc_nick
|
||||
|
||||
例: ウィンドウ (_src/gui/gui-window.c_ より):
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_gui_window *gui_windows = NULL; /* first window */
|
||||
struct t_gui_window *last_gui_window = NULL; /* last window */
|
||||
@@ -868,7 +868,7 @@ struct t_gui_window *gui_current_window = NULL; /* current window */
|
||||
|
||||
例: 新しいウィンドウの作成 (_src/gui/gui-window.c_ より):
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
/*
|
||||
* Creates a new window.
|
||||
@@ -904,7 +904,7 @@ WeeChat のほとんどの連結リストは双方向連結リストです: 各
|
||||
|
||||
例: バッファのリスト (_src/gui/gui-buffer.h_ より):
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_gui_buffer
|
||||
{
|
||||
@@ -919,7 +919,7 @@ struct t_gui_buffer
|
||||
|
||||
さらにリストの最初と最後を示す 2 つのポインタがあります:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_gui_buffer *gui_buffers = NULL; /* first buffer */
|
||||
struct t_gui_buffer *last_gui_buffer = NULL; /* last buffer */
|
||||
@@ -1110,7 +1110,7 @@ API 関数を簡単に呼び出すためのマクロが定義されています
|
||||
例えば、関数 _hook_timer_ は以下のように構造体
|
||||
_t_weechat_plugin_ で定義されています:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
struct t_hook *(*hook_timer) (struct t_weechat_plugin *plugin,
|
||||
long interval,
|
||||
@@ -1123,7 +1123,7 @@ struct t_hook *(*hook_timer) (struct t_weechat_plugin *plugin,
|
||||
|
||||
この関数を呼び出すマクロは:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
#define weechat_hook_timer(__interval, __align_second, __max_calls, \
|
||||
__callback, __data) \
|
||||
@@ -1134,7 +1134,7 @@ struct t_hook *(*hook_timer) (struct t_weechat_plugin *plugin,
|
||||
|
||||
このため、プラグイン内での関数の呼び出しは以下の例の様に行います:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
server->hook_timer_sasl = weechat_hook_timer (timeout * 1000,
|
||||
0, 1,
|
||||
|
||||
+615
-615
File diff suppressed because it is too large
Load Diff
@@ -3961,7 +3961,7 @@ origin が許可されていれば WebSocket 用のソケットが準備され
|
||||
|
||||
HTML5 を使えばたった 1 行の JavaScript で WebSocket をオープンすることが可能です:
|
||||
|
||||
[source,js]
|
||||
[source,javascript]
|
||||
----
|
||||
websocket = new WebSocket("ws://server.com:9000/weechat");
|
||||
----
|
||||
|
||||
@@ -3888,7 +3888,7 @@ transmisji WebSocket jeśli wymagane nagłówki znajdują się w żądaniu oraz,
|
||||
|
||||
WebSocket może zostać otworzony w HTML5 za pomocą jednej linii w JavaScript:
|
||||
|
||||
[source,js]
|
||||
[source,javascript]
|
||||
----
|
||||
websocket = new WebSocket("ws://server.com:9000/weechat");
|
||||
----
|
||||
|
||||
@@ -556,7 +556,7 @@ _WeeChat ≥ 3.3._
|
||||
|
||||
Прототип:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
char *weechat_string_cut (const char *string, int length, int count_suffix, int screen, const char *cut_suffix);
|
||||
----
|
||||
@@ -575,7 +575,7 @@ char *weechat_string_cut (const char *string, int length, int count_suffix, int
|
||||
|
||||
C пример:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
char *str = weechat_string_cut ("this is a test", 5, 1, 1, "…"); /* result: "this…" */
|
||||
/* ... */
|
||||
@@ -3867,7 +3867,7 @@ _WeeChat ≥ 3.3._
|
||||
|
||||
Прототип:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
int weechat_file_copy (const char *from, const char *to);
|
||||
----
|
||||
@@ -3883,7 +3883,7 @@ int weechat_file_copy (const char *from, const char *to);
|
||||
|
||||
C пример:
|
||||
|
||||
[source,C]
|
||||
[source,c]
|
||||
----
|
||||
if (weechat_file_copy ("/tmp/test.txt", "/path/to/test2.txt"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user