$ cp dokuwiki/conf/mime.conf dokuwiki/conf/mime.conf.bak $ tar jcvf dokuwiki_20220804_1.tar.bz2 dokuwiki/
svg image/svg+xml
$ php -v
PHP 7.4.29 (cli) (built: Apr 12 2022 10:55:38) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.29, Copyright (c), by Zend Technologies
$ rpm -qa | sort | grep php
php-7.4.29-1.fc36.remi.x86_64 php-cli-7.4.29-1.fc36.remi.x86_64 php-common-7.4.29-1.fc36.remi.x86_64 php-fedora-autoloader-1.0.1-8.fc36.noarch php-fpm-7.4.29-1.fc36.remi.x86_64 php-gd-7.4.29-1.fc36.remi.x86_64 php-json-7.4.29-1.fc36.remi.x86_64 php-mbstring-7.4.29-1.fc36.remi.x86_64 php-mysqlnd-7.4.29-1.fc36.remi.x86_64 php-opcache-7.4.29-1.fc36.remi.x86_64 php-pdo-7.4.29-1.fc36.remi.x86_64 php-pear-1.10.13-2.fc36.noarch php-pecl-apcu-5.1.21-1.fc36.remi.7.4.x86_64 php-pecl-apcu-bc-1.0.5-5.fc36.remi.7.4.x86_64 php-pecl-mcrypt-1.0.4-5.fc36.remi.7.4.x86_64 php-pecl-zip-1.20.1-1.fc36.remi.7.4.x86_64 php-process-7.4.29-1.fc36.remi.x86_64 php-sodium-7.4.29-1.fc36.remi.x86_64 php-xml-7.4.29-1.fc36.remi.x86_64
$ sudo dnf install dnf-plugins-core
メタデータの期限切れの最終確認: 0:07:58 時間前の 2022年08月04日 03時51分10秒 に実施しました。 パッケージ dnf-plugins-core-4.2.1-1.fc36.noarch は既にインストールされています。 依存関係が解決しました。 行うべきことはありません。 完了しました!
$ sudo dnf config-manager --set-enabled remi
$ sudo dnf module reset php -y
Remi's RPM repository - Fedora 36 - x86_64 636 B/s | 833 B 00:01 依存関係が解決しました。 行うべきことはありません。 完了しました!
$ sudo dnf module install php:remi-8.1 -y
メタデータの期限切れの最終確認: 0:00:33 時間前の 2022年08月04日 03時59分35秒 に実施しました。 エラー: 問題: 競合するリクエスト - php-common-8.1.8-1.fc36.remi.x86_64 と php-common-7.4.29-1.fc36.remi.x86_64 どちらもインストールできません - php-common-8.1.9-1.fc36.remi.x86_64 と php-common-7.4.29-1.fc36.remi.x86_64 どちらもインストールできません - パッケージ php-pecl-apcu-bc-1.0.5-5.fc36.remi.7.4.x86_64 には php(api) = 20190902-64 が必要ですが、どのプロバイダー からもインストールできません - パッケージ php-pecl-apcu-bc-1.0.5-5.fc36.remi.7.4.x86_64 には php(zend-abi) = 20190902-64 が必要ですが、どのプロバイダーからもインストールできません - インストール済パッケージの問題 php-pecl-apcu-bc-1.0.5-5.fc36.remi.7.4.x86_64 - パッケージ php-common-7.4.29-1.fc36.remi.x86_64 はモジュラーフィルタリングに一致しません - パッケージ php-common-7.4.30-1.fc36.remi.x86_64 はモジュラーフィルタリングに一致しません (競合するパッケージを置き換えるには、コマンドラインに '--allowerasing' を追加してみてください または、'--skip-broken' を追加して、インストール不可のパッケージをスキップしてください)
$ sudo dnf module install php:remi-8.1 -y --allowerasing
メタデータの期限切れの最終確認: 0:00:54 時間前の 2022年08月04日 03時59分35秒 に実施しました。 依存関係が解決しました。 ======================================================================================================================== パッケージ アーキテクチャー バージョン リポジトリー サイズ ======================================================================================================================== アップグレード: php x86_64 8.1.9-1.fc36.remi remi-modular 1.7 M php-cli x86_64 8.1.9-1.fc36.remi remi-modular 5.3 M php-common x86_64 8.1.9-1.fc36.remi remi-modular 829 k 置き換え php-json.x86_64 7.4.29-1.fc36.remi php-fpm x86_64 8.1.9-1.fc36.remi remi-modular 1.8 M php-gd x86_64 8.1.9-1.fc36.remi remi-modular 62 k php-mbstring x86_64 8.1.9-1.fc36.remi remi-modular 517 k php-mysqlnd x86_64 8.1.9-1.fc36.remi remi-modular 216 k php-opcache x86_64 8.1.9-1.fc36.remi remi-modular 613 k php-pdo x86_64 8.1.9-1.fc36.remi remi-modular 115 k php-pecl-apcu x86_64 5.1.21-1.fc36.remi.8.1 remi-modular 75 k php-pecl-mcrypt x86_64 1.0.5-1.fc36.remi.8.1 remi-modular 35 k php-pecl-zip x86_64 1.21.0-3.fc36.remi.8.1 remi-modular 70 k php-process x86_64 8.1.9-1.fc36.remi remi-modular 65 k php-sodium x86_64 8.1.9-1.fc36.remi remi-modular 58 k php-xml x86_64 8.1.9-1.fc36.remi remi-modular 210 k 依存関係パッケージの削除: php-pecl-apcu-bc x86_64 1.0.5-5.fc36.remi.7.4 @remi-modular 49 k モジュールプロファイルのインストール中: php/common モジュールストリームの有効化中: php remi-8.1 トランザクションの概要 ======================================================================================================================== アップグレード 15 パッケージ 削除 1 パッケージ ダウンロードサイズの合計: 12 M パッケージのダウンロード: (1/15): php-common-8.1.9-1.fc36.remi.x86_64.rpm 728 kB/s | 829 kB 00:01 (2/15): php-8.1.9-1.fc36.remi.x86_64.rpm 1.2 MB/s | 1.7 MB 00:01 (3/15): php-fpm-8.1.9-1.fc36.remi.x86_64.rpm 2.5 MB/s | 1.8 MB 00:00 (4/15): php-gd-8.1.9-1.fc36.remi.x86_64.rpm 170 kB/s | 62 kB 00:00 (5/15): php-cli-8.1.9-1.fc36.remi.x86_64.rpm 2.8 MB/s | 5.3 MB 00:01 (6/15): php-mbstring-8.1.9-1.fc36.remi.x86_64.rpm 3.2 MB/s | 517 kB 00:00 (7/15): php-mysqlnd-8.1.9-1.fc36.remi.x86_64.rpm 592 kB/s | 216 kB 00:00 (8/15): php-opcache-8.1.9-1.fc36.remi.x86_64.rpm 1.6 MB/s | 613 kB 00:00 (9/15): php-pdo-8.1.9-1.fc36.remi.x86_64.rpm 465 kB/s | 115 kB 00:00 (10/15): php-pecl-apcu-5.1.21-1.fc36.remi.8.1.x86_64.rpm 650 kB/s | 75 kB 00:00 (11/15): php-pecl-mcrypt-1.0.5-1.fc36.remi.8.1.x86_64.rpm 308 kB/s | 35 kB 00:00 (12/15): php-pecl-zip-1.21.0-3.fc36.remi.8.1.x86_64.rpm 597 kB/s | 70 kB 00:00 (13/15): php-process-8.1.9-1.fc36.remi.x86_64.rpm 568 kB/s | 65 kB 00:00 (14/15): php-sodium-8.1.9-1.fc36.remi.x86_64.rpm 506 kB/s | 58 kB 00:00 (15/15): php-xml-8.1.9-1.fc36.remi.x86_64.rpm 1.6 MB/s | 210 kB 00:00 ------------------------------------------------------------------------------------------------------------------------ 合計 3.8 MB/s | 12 MB 00:03 トランザクションの確認を実行中 トランザクションの確認に成功しました。 トランザクションのテストを実行中 トランザクションのテストに成功しました。 トランザクションを実行中 準備 : 1/1 scriptletの実行中: php-common-8.1.9-1.fc36.remi.x86_64 1/1 scriptletの実行中: php-common-8.1.9-1.fc36.remi.x86_64 1/32 アップグレード中 : php-common-8.1.9-1.fc36.remi.x86_64 1/32 警告: /etc/php.ini は /etc/php.ini.rpmnew として作成されました アップグレード中 : php-pdo-8.1.9-1.fc36.remi.x86_64 2/32 アップグレード中 : php-cli-8.1.9-1.fc36.remi.x86_64 3/32 アップグレード中 : php-fpm-8.1.9-1.fc36.remi.x86_64 4/32 scriptletの実行中: php-fpm-8.1.9-1.fc36.remi.x86_64 4/32 アップグレード中 : php-mbstring-8.1.9-1.fc36.remi.x86_64 5/32 アップグレード中 : php-opcache-8.1.9-1.fc36.remi.x86_64 6/32 アップグレード中 : php-sodium-8.1.9-1.fc36.remi.x86_64 7/32 アップグレード中 : php-xml-8.1.9-1.fc36.remi.x86_64 8/32 アップグレード中 : php-8.1.9-1.fc36.remi.x86_64 9/32 アップグレード中 : php-mysqlnd-8.1.9-1.fc36.remi.x86_64 10/32 アップグレード中 : php-gd-8.1.9-1.fc36.remi.x86_64 11/32 アップグレード中 : php-pecl-apcu-5.1.21-1.fc36.remi.8.1.x86_64 12/32 アップグレード中 : php-pecl-mcrypt-1.0.5-1.fc36.remi.8.1.x86_64 13/32 アップグレード中 : php-pecl-zip-1.21.0-3.fc36.remi.8.1.x86_64 14/32 アップグレード中 : php-process-8.1.9-1.fc36.remi.x86_64 15/32 整理 : php-7.4.29-1.fc36.remi.x86_64 16/32 削除 : php-pecl-apcu-bc-1.0.5-5.fc36.remi.7.4.x86_64 17/32 整理 : php-pecl-apcu-5.1.21-1.fc36.remi.7.4.x86_64 18/32 整理 : php-pecl-zip-1.20.1-1.fc36.remi.7.4.x86_64 19/32 整理 : php-pecl-mcrypt-1.0.4-5.fc36.remi.7.4.x86_64 20/32 整理 : php-cli-7.4.29-1.fc36.remi.x86_64 21/32 scriptletの実行中: php-fpm-7.4.29-1.fc36.remi.x86_64 22/32 整理 : php-fpm-7.4.29-1.fc36.remi.x86_64 22/32 整理 : php-mbstring-7.4.29-1.fc36.remi.x86_64 23/32 整理 : php-opcache-7.4.29-1.fc36.remi.x86_64 24/32 整理 : php-sodium-7.4.29-1.fc36.remi.x86_64 25/32 整理 : php-xml-7.4.29-1.fc36.remi.x86_64 26/32 整理 : php-process-7.4.29-1.fc36.remi.x86_64 27/32 整理 : php-mysqlnd-7.4.29-1.fc36.remi.x86_64 28/32 整理 : php-pdo-7.4.29-1.fc36.remi.x86_64 29/32 整理 : php-gd-7.4.29-1.fc36.remi.x86_64 30/32 整理 : php-common-7.4.29-1.fc36.remi.x86_64 31/32 廃止 : php-json-7.4.29-1.fc36.remi.x86_64 32/32 scriptletの実行中: php-json-7.4.29-1.fc36.remi.x86_64 32/32 検証 : php-8.1.9-1.fc36.remi.x86_64 1/32 検証 : php-7.4.29-1.fc36.remi.x86_64 2/32 検証 : php-cli-8.1.9-1.fc36.remi.x86_64 3/32 検証 : php-cli-7.4.29-1.fc36.remi.x86_64 4/32 検証 : php-common-8.1.9-1.fc36.remi.x86_64 5/32 検証 : php-common-7.4.29-1.fc36.remi.x86_64 6/32 検証 : php-json-7.4.29-1.fc36.remi.x86_64 7/32 検証 : php-fpm-8.1.9-1.fc36.remi.x86_64 8/32 検証 : php-fpm-7.4.29-1.fc36.remi.x86_64 9/32 検証 : php-gd-8.1.9-1.fc36.remi.x86_64 10/32 検証 : php-gd-7.4.29-1.fc36.remi.x86_64 11/32 検証 : php-mbstring-8.1.9-1.fc36.remi.x86_64 12/32 検証 : php-mbstring-7.4.29-1.fc36.remi.x86_64 13/32 検証 : php-mysqlnd-8.1.9-1.fc36.remi.x86_64 14/32 検証 : php-mysqlnd-7.4.29-1.fc36.remi.x86_64 15/32 検証 : php-opcache-8.1.9-1.fc36.remi.x86_64 16/32 検証 : php-opcache-7.4.29-1.fc36.remi.x86_64 17/32 検証 : php-pdo-8.1.9-1.fc36.remi.x86_64 18/32 検証 : php-pdo-7.4.29-1.fc36.remi.x86_64 19/32 検証 : php-pecl-apcu-5.1.21-1.fc36.remi.8.1.x86_64 20/32 検証 : php-pecl-apcu-5.1.21-1.fc36.remi.7.4.x86_64 21/32 検証 : php-pecl-mcrypt-1.0.5-1.fc36.remi.8.1.x86_64 22/32 検証 : php-pecl-mcrypt-1.0.4-5.fc36.remi.7.4.x86_64 23/32 検証 : php-pecl-zip-1.21.0-3.fc36.remi.8.1.x86_64 24/32 検証 : php-pecl-zip-1.20.1-1.fc36.remi.7.4.x86_64 25/32 検証 : php-process-8.1.9-1.fc36.remi.x86_64 26/32 検証 : php-process-7.4.29-1.fc36.remi.x86_64 27/32 検証 : php-sodium-8.1.9-1.fc36.remi.x86_64 28/32 検証 : php-sodium-7.4.29-1.fc36.remi.x86_64 29/32 検証 : php-xml-8.1.9-1.fc36.remi.x86_64 30/32 検証 : php-xml-7.4.29-1.fc36.remi.x86_64 31/32 検証 : php-pecl-apcu-bc-1.0.5-5.fc36.remi.7.4.x86_64 32/32 アップグレード済み: php-8.1.9-1.fc36.remi.x86_64 php-cli-8.1.9-1.fc36.remi.x86_64 php-common-8.1.9-1.fc36.remi.x86_64 php-fpm-8.1.9-1.fc36.remi.x86_64 php-gd-8.1.9-1.fc36.remi.x86_64 php-mbstring-8.1.9-1.fc36.remi.x86_64 php-mysqlnd-8.1.9-1.fc36.remi.x86_64 php-opcache-8.1.9-1.fc36.remi.x86_64 php-pdo-8.1.9-1.fc36.remi.x86_64 php-pecl-apcu-5.1.21-1.fc36.remi.8.1.x86_64 php-pecl-mcrypt-1.0.5-1.fc36.remi.8.1.x86_64 php-pecl-zip-1.21.0-3.fc36.remi.8.1.x86_64 php-process-8.1.9-1.fc36.remi.x86_64 php-sodium-8.1.9-1.fc36.remi.x86_64 php-xml-8.1.9-1.fc36.remi.x86_64 削除しました: php-pecl-apcu-bc-1.0.5-5.fc36.remi.7.4.x86_64 完了しました!
$ php -v
PHP 8.1.9 (cli) (built: Aug 2 2022 13:02:24) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.1.9, Copyright (c) Zend Technologies with Zend OPcache v8.1.9, Copyright (c), by Zend Technologies
$ rpm -qa | sort | grep php
php-8.1.9-1.fc36.remi.x86_64 php-cli-8.1.9-1.fc36.remi.x86_64 php-common-8.1.9-1.fc36.remi.x86_64 php-fedora-autoloader-1.0.1-8.fc36.noarch php-fpm-8.1.9-1.fc36.remi.x86_64 php-gd-8.1.9-1.fc36.remi.x86_64 php-mbstring-8.1.9-1.fc36.remi.x86_64 php-mysqlnd-8.1.9-1.fc36.remi.x86_64 php-opcache-8.1.9-1.fc36.remi.x86_64 php-pdo-8.1.9-1.fc36.remi.x86_64 php-pear-1.10.13-2.fc36.noarch php-pecl-apcu-5.1.21-1.fc36.remi.8.1.x86_64 php-pecl-mcrypt-1.0.5-1.fc36.remi.8.1.x86_64 php-pecl-zip-1.21.0-3.fc36.remi.8.1.x86_64 php-process-8.1.9-1.fc36.remi.x86_64 php-sodium-8.1.9-1.fc36.remi.x86_64 php-xml-8.1.9-1.fc36.remi.x86_64
$ rpm -qa | sort | grep php
php-7.4.29-1.fc36.remi.x86_64 php-cli-7.4.29-1.fc36.remi.x86_64 php-common-7.4.29-1.fc36.remi.x86_64 php-fedora-autoloader-1.0.1-8.fc36.noarch php-fpm-7.4.29-1.fc36.remi.x86_64 php-gd-7.4.29-1.fc36.remi.x86_64 php-json-7.4.29-1.fc36.remi.x86_64 php-mbstring-7.4.29-1.fc36.remi.x86_64 php-mysqlnd-7.4.29-1.fc36.remi.x86_64 php-opcache-7.4.29-1.fc36.remi.x86_64 php-pdo-7.4.29-1.fc36.remi.x86_64 php-pear-1.10.13-2.fc36.noarch php-pecl-apcu-5.1.21-1.fc36.remi.7.4.x86_64 php-pecl-apcu-bc-1.0.5-5.fc36.remi.7.4.x86_64 php-pecl-mcrypt-1.0.4-5.fc36.remi.7.4.x86_64 php-pecl-zip-1.20.1-1.fc36.remi.7.4.x86_64 php-process-7.4.29-1.fc36.remi.x86_64 php-sodium-7.4.29-1.fc36.remi.x86_64 php-xml-7.4.29-1.fc36.remi.x86_64
$ sudo reboot
$ sudo dnf module reset php -y $ sudo dnf module install php:remi-8.2 $ sudo systemctl restart php-fpm $ sudo systemctl restart httpd
[stylesheets]
css/custom.less = screen
@font-face {
font-family: "HackGenNerd";
font-display: swap;
src: url("/fonts/hackgen_v2.6.3/HackGenNerd-Regular.woff2") format("woff2"),
url("/fonts/hackgen_v2.6.3/HackGenNerd-Regular.woff") format("woff")
}
@font-face {
font-family: "HackGenNerd Console";
font-display: swap;
src: url("/fonts/hackgen_v2.6.3/HackGenNerdConsole-Regular.woff2") format("woff2")
url("/fonts/hackgen_v2.6.3/HackGenNerdConsole-Regular.woff") format("woff")
}
pre, code, samp, kbd {
font-family: "HackGenNerd Console", "Sawarabi Gothic", "Helvetica Neue", Helvetica, /*"Open Sans", "M PLUS 1p", */"ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, Osaka, "MS Pゴシック", "MS PGothic", Arial, sans-serif;
font-size: 12px;
}
@media (min-width: 980px) {
pre, code, samp, kbd {
font-size: 10px;
}
}
body {
font-family: "Sawarabi Gothic", "Helvetica Neue", Helvetica, /*"Open Sans", "M PLUS 1p", */"ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, Osaka, "MS Pゴシック", "MS PGothic", Arial, sans-serif;
}
$ cd dokuwiki/lib/tpl/ $ cp -r bootstrap3 bs3tomoyannet
$ cd bs3tomoyannet $ nano template.info.txt
base bs3tomoyannet author Tomoyan596 email tomoyan@tomoyan.net date 2022-08-04 name Bootstrap3 Tomoyan.NET Template desc Bootstrap-based template for Dokuwiki Tomoyan.NET url https://www.dokuwiki.org/template:bootstrap3 build stable/20220727
base bootstrap3
author Giuseppe Di Terlizzi
email giuseppe.diterlizzi@gmail.com
date 2022-07-27
name Bootstrap3 Template
desc Bootstrap-based template for Dokuwiki
url https://www.dokuwiki.org/template:bootstrap3
build stable/20220727
$cp template_dir/css/custom.less bs3tomoyannet/css/custom.less
$ nano style.ini
[stylesheets]
; DokuWiki core styles
...
; Template styles
...
; Tomoyan.NET Custom (追記登録)
css/custom.less = all
...
...
...
...
...
...
...
...
...
...
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: normal;
font-display: swap;
src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"),
url("/fonts/OpenSans-Regular-webfont.woff") format("woff");
}
=== 参考文献 ===
[[https://developer.mozilla.org/ja/docs/Web/CSS/@font-face|@font-face - CSS: カスケーディングスタイルシート | MDN]]\\
==== ブロックに HackGen (白源) フォントを適用 ====
[[open_source:fonts#hackgen|HackGen (白源)]]\\
[[web:web_font#woffconverter|WOFFConverter]]\\
**** ブロックは HTML の **pre** タグであるため、**pre** タグのフォントを変更する。\\
...
...
==== Apache MIME タイプの設定 ====
Apache に Web フォントの MIME タイプ定義を追加する。\\
$ sudo vi /etc/httpd/conf/httpd.conf
...
...
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
# Web Font
AddType application/font-sfnt otf ttf
AddType application/font-woff woff
AddType application/font-woff2 woff2
AddType application/vnd.ms-fontobject eot
...
Web フォントを配信するに当たって Apache のキャッシュ期間を設定する。\\
$ sudo vi dokuwiki/.htaccess
...
ExpiresActive On
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/font-woff2 "access plus 1 month"
ExpiresByType application/font-sfnt "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
...
Apache をリロードして設定を反映させる。\\
$ sudo systemctl reload httpd
===== Open Graph プロトコル =====
[[https://www.dokuwiki.org/plugins?plugintag=opengraph#extension__table|plugins (opengraph) [DokuWiki]]]\\
[[https://dokuwiki.org/plugin:socialcards|SocialCards Plugin]]\\
[[https://www.dokuwiki.org/ja:plugin:semantic|Semantic Plugin]]\\
\\
[[https://cards-dev.twitter.com/validator|Twitter Card Validator]]\\
[[https://developers.facebook.com/tools/debug/|シェアデバッガー - Facebook for Developers]]\\
[[https://validator.schema.org|スキーマ マークアップ検証ツール]]\\
[[https://developers.google.com/search/docs/advanced/structured-data|構造化データマークアップをテストする | Google検索セントラル | Google Developers]]\\
===== REST API =====
==== API Plugin ====
[[https://www.dokuwiki.org/plugin:api|plugin:api [DokuWiki]]]\\
GitHub: [[https://github.com/gerardnico/dokuwiki-plugin-api/|gerardnico/dokuwiki-plugin-api: A rest api interface for Dokuwiki]]\\
==== Call DokuWiki REST API ====
URL: [[https://www.tomoyan.net/lib/exe/ajax.php?call=api|]]\\
Return:\\
{"api":"api","version":"2019-06-21"}
^ 機能 (fn) ^ 引数 ^ 説明 ^
| version | - | DokuWiki のバージョンを取得する。 |
| wiki | - | |
URL: [[https://www.tomoyan.net/lib/exe/ajax.php?call=api&fn=version|]]\\
URL: [[https://www.tomoyan.net/lib/exe/ajax.php?call=api&fn=wiki|]]\\
URL: [[https://www.tomoyan.net/lib/exe/ajax.php?call=api&fn=pages&limit=10|]]\\
URL: [[https://www.tomoyan.net/lib/exe/ajax.php?call=api&fn=page&id=linux|]]\\
=== Vue.js + axios で DokuWiki REST API をコールする ===
[[javascript:vuejs:dokuwiki_rest_api_sample|DokuWiki REST API Vue.js サンプルアプリ]]\\
===== DokuWiki REST API Vue.js サンプルアプリ =====
Vue.js version: {{ vue_ver }}
Response Data(status: {{ response.status }}):
{{ response.data }}
axios response:
{{ response }}
※Vue.js, REST API バージョンを表示するだけの簡単なサンプルアプリケーション。\\
===== XML-RPC =====
[[https://www.dokuwiki.org/devel:xmlrpc|devel:xmlrpc [DokuWiki]]]\\
^ XML-RPC の機能 ^
^ 関数名 ^
| dokuwiki.getPagelist |
| dokuwiki.getVersion |
| dokuwiki.getTime |
| dokuwiki.getXMLRPCAPIVersion |
| dokuwiki.login |
| dokuwiki.search |
| dokuwiki.getTitle |
| dokuwiki.appendPage |
| dokuwiki.setLocks |
| dokuwiki.deleteUsers |
| wiki.getRPCVersionSupported |
| wiki.aclCheck |
| wiki.getPage |
| wiki.getPageVersion |
| wiki.getPageVersions |
| wiki.getPageInfo |
| wiki.getPageInfoVersion |
| wiki.getPageHTML |
| wiki.getPageHTMLVersion |
| wiki.putPage |
| wiki.listLinks |
| wiki.getAllPages |
| wiki.getBackLinks |
| wiki.getRecentChanges |
| wiki.getRecentMediaChanges |
| wiki.getAttachments |
| wiki.getAttachment |
| wiki.getAttachmentInfo |
| wiki.putAttachment |
| wiki.deleteAttachment |
| plugin.acl.addAcl |
| plugin.acl.delAcl |
==== Call DokuWiki XML-RPC ====
URL: [[https://www.tomoyan.net/lib/exe/xmlrpc.php|]]\\
===== 以前のリビジョン =====
==== 特定のリビジョンを削除する方法 ====
/data/attic// を削除する。\\
は dokuwiki.1437393935.txt.gz の様に、 になっている。\\
\\
/data/meta//.changes というメタファイルを編集します。\\
メタファイルも行ごとに連番が振られているので、上記で削除した連番の行を削除します。\\
1376793743 122.249.153.239 E linux:dokuwiki tomoyan
1437393935 127.0.0.1 E linux:dokuwiki 外部編集 0
1546495335 127.0.0.1 E linux:dokuwiki tomoyan [geeklogのDokuWiki Plugi(注意: 以下>は古い情報です)] 1
==== サーバーキャッシュのパージ ====
公式: [[https://www.dokuwiki.org/caching|caching [DokuWiki]]] [[gtr>https://www.dokuwiki.org/caching|翻訳]]\\
$ touch dokuwiki/conf/local.php
===== アップグレード =====
**[[http://www.dokuwiki.org/plugin:upgrade|DokuWiki Upgrade Plugin]]** で DokuWiki をアップグレードする。\\
===== 参考文献 =====
DokuWiki 高速化に関する議論\\
[[https://forum.dokuwiki.org/d/7766-optimizing-dokuwiki-load-time/5|]]\\
テンプレート カスタマイズ\\
[[https://itlogs.net/dokuwiki-css/|DokuWikiのCSS(スタイルシート)カスタマイズ方法を解説 | 俺の開発研究所]]\\
===== トラブルシューティング =====
==== アップロードしたメディアの css や js の MIME タイプが "application/octet-stream" になる🤪 ====
{{:linux:css_js_application_octet-stream.png|MIME タイプ エラー}}
メディアファイルの配信は DokuWiki によって行われ、conf/mime.conf
に定義されている🤔\\
定義が足りていない場合は追加する😉\\
$ nano conf/mime.conf
1 # Allowed uploadable file extensions and mimetypes are defined here.
2 # To extend this file it is recommended to create a mime.local.conf
3 # file. Mimetypes that should be downloadable and not be opened in the
4 # should be prefixed with a !
5
6 jpg image/jpeg
7 jpeg image/jpeg
8 gif image/gif
9 png image/png
10 webp image/webp
11 ico image/vnd.microsoft.icon
12
13 mp3 audio/mpeg
14 ogg audio/ogg
15 wav audio/wav
16 webm video/webm
17 ogv video/ogg
18 mp4 video/mp4
19 vtt text/vtt
20
21 tgz !application/octet-stream
22 tar !application/x-gtar
23 gz !application/octet-stream
24 bz2 !application/octet-stream
25 zip !application/zip
26 rar !application/rar
27 7z !application/x-7z-compressed
28
29 pdf application/pdf
30 ps !application/postscript
31
32 rpm !application/octet-stream
33 deb !application/octet-stream
34
35 doc !application/msword
36 xls !application/msexcel
37 ppt !application/mspowerpoint
38 rtf !application/msword
39
40 docx !application/vnd.openxmlformats-officedocument.wordprocessingml.document
41 xlsx !application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
42 pptx !application/vnd.openxmlformats-officedocument.presentationml.presentation
43
44 sxw !application/soffice
45 sxc !application/soffice
46 sxi !application/soffice
47 sxd !application/soffice
48
49 odc !application/vnd.oasis.opendocument.chart
50 odf !application/vnd.oasis.opendocument.formula
51 odg !application/vnd.oasis.opendocument.graphics
52 odi !application/vnd.oasis.opendocument.image
53 odp !application/vnd.oasis.opendocument.presentation
54 ods !application/vnd.oasis.opendocument.spreadsheet
55 odt !application/vnd.oasis.opendocument.text
56
57 svg image/svg+xml
58
59 # You should enable HTML and Text uploads only for restricted Wikis.
60 # Spammers are known to upload spam pages through unprotected Wikis.
61 # Note: Enabling HTML opens Cross Site Scripting vulnerabilities
62 # through JavaScript. Only enable this with trusted users. You
63 # need to disable the iexssprotect option additionally to
64 # adding the mime type here
65 #html text/html
66 #htm text/html
67 #txt text/plain
68 #conf text/plain
69 #xml text/xml
70 #csv text/csv
71 css text/css
72 js text/javascript
73
74 # Also flash may be able to execute arbitrary scripts in the website's
75 # context
76 #swf application/x-shockwave-flash
77
==== GOTO Plugin リダイレクトしているページが Google Search Console がソフト 404 エラーを通知する場合の対処 ====
送信された URL はソフト 404 エラーのようです
[[https://support.google.com/webmasters/answer/181708|ソフト 404 エラー - Search Console ヘルプ]]\\
**原因:**\\
古い URL をブックマークしているユーザーを考慮して、このページが存在しないことを表示して GOTO Plugin で移設先へ適切にリダイレクトするようにしたい。しかし、Google のクローラーのことを考慮すると本来であればこのようなページは 301 (移動した) スタータスを返すべきであるが、GOTO Plugin は一旦 200 (OK) ステータスを返してから一定時間経過後にリダイレクトする。\\
つまり、このようなページは検索エンジンには登録されるべきではないので、以下のような対策を行う。\\
GOTO Plugin と HtmlMetaTags Plugin を併用して、ユーザーには移動したことをお知らせしつつリダイレクトして、Google のクローラーには検索エンジンには登録しないように通知する。\\
{{htmlmetatags>metatag-robots=(noindex,nofollow)}}
~~GOTO>windows:regex~~
==== DokuWiki バージョンアップ後に svg イメージが表示されない ====
**dokuwiki/conf/mime.conf** が更新時に上書きされているので、以下の設定が存在しないのが原因である。\\
svg image/svg+xml
バックアップなどから **mime.conf** を復元するか、上記の設定をし直す。\\
==== DokuWiki バージョンアップ後に JavaScript が動作しない ====
Indexmenu Plugin で **dTree is not defined** スクリプトエラーが発生する。(Plugin が最新ではない場合)\\
または、以下のエラーが表示される。\\
Indexmenu Plugin: If you use the 'js'-option of the indexmenu plugin, you have to disable the 'defer_js'-setting. This setting is temporary, in the future the indexmenu plugin will be improved.
様々な Plugin で **jQuery not defined** スクリプトエラーが発生する。(Chrome のデベロッパーツール Ctrl + Shift + I の Console)\\
対処方法:\\
[管理] - [サイト設定] - **機能フラグ** の **defer_js** オプションを**オフ**にする。\\
===== crypt(2009-02-17) プラグイン =====
js が「addInitEvent is not defined」エラーになるので、addInitEvent を jQuery に修正する。\\
register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, '_hookjs');
}
function _hookjs(&$event, $param) {
$event->data['script'][]=array('type'=>'text/javascript','charset'=>'utf-8'
// ,'_data'=>'','_data'=>"addInitEvent(function() { return(decryptEditSetup()); });");
,'_data'=>'','_data'=>"jQuery(function() { return(decryptEditSetup()); });");
}
}
js が「locktimer is not defined」エラーになるので、locktimer を dw_locktimer に修正する。\\
function decryptEditSetup(msg) {
var editform=null, wikitext=null, hiddentext=null, preview=null;
if(!(editform=document.getElementById('dw__editform'))) {
// alert("no form dw__editform\n");
return(true);
}
if(!(wikitext=document.getElementById('wiki__text'))) {
// alert("no wiki__text");
return(false);
}
// if there is no preview button, then assume this is a
// "Recover draft" page, dont do anything.
if(!(preview=document.getElementById('edbtn__preview'))) {
return(false);
}
// create a hidden element with id 'wiki__text_submit' and
// name wikitext_edit (same as the wiki__text. move the real
// wikI__text element out of the form (so it is not submitted and
// any text left unencrypted
if(!(hiddentext=document.createElement('input'))) {
return(false);
}
hiddentext.setAttribute('id', 'wiki__text_submit');
hiddentext.setAttribute('name', 'wikitext');
hiddentext.setAttribute('type','hidden');
editform.insertBefore(hiddentext,null);
editform.parentNode.insertBefore(wikitext,editform);
if(!(decryptButton=document.createElement('input'))) {
return(false);
}
decryptButton.setAttribute('id', 'decryptButton');
decryptButton.setAttribute('name', 'decryptButton');
decryptButton.setAttribute('type','Button');
decryptButton.setAttribute('value','DecryptSecret');
// decryptButton.setAttribute('onclick',decryptEditForm);
decryptButton.onclick=decryptEditForm;
decryptButton.setAttribute('class','button');
decryptButton.setAttribute('className','button'); // required for IE
preview.parentNode.insertBefore(decryptButton,preview);
editform.onsubmit = function() {return editFormOnSubmit();};
// the following is taken from lib/scripts/edit.js to make drafts work
dw_locktimer.refresh = function(){
var now = new Date();
// refresh every minute only
if(now.getTime() - dw_locktimer.lasttime.getTime() > 30*1000){ //FIXME decide on time
var params = 'call=lock&id='+encodeURIComponent(dw_locktimer.pageid);
if(dw_locktimer.draft){
var dwform = $('dw__editform');
// begin plugin modified code
if(encryptForSubmit()===false) { return(false); }
// end plugin modified code
params += '&prefix='+encodeURIComponent(dwform.elements.prefix.value);
params += '&wikitext='+encodeURIComponent(dwform.elements.wikitext.value);
params += '&suffix='+encodeURIComponent(dwform.elements.suffix.value);
params += '&date='+encodeURIComponent(dwform.elements.date.value);
}
dw_locktimer.sack.runAJAX(params);
dw_locktimer.lasttime = now;
}
};
}
===== geeklog の DokuWiki Plugin =====
==== インストール ====
[[http://geeklog.fr/downloads/index.php/59|Free Content Management System GPL - Geeklog France]] からインストールできます。
==== Geeklog Dokuwiki Plugin で SyntaxHighlighter3 を使えるようにする ====
geeklog 1.8.0 では、Javascript をフッターのテーマ変数{plg_footercode}で実行するようになったらしく、SyntaxHighlighter3 が動作しない。\\
そのため lib-common.php とテーマのヘッダーテンプレートを改造する。\\
※この改造による影響の有無は不明です。暫くこれで運用してみます。\\
\\
COM_siteFooter関数内1,514行目(*1)付近(フッターに出力しているscriptを止める)\\
*1 - 1.8.0 の行番号, 2.0.0 では 1,570行目付近。
// Retrieve any JavaScript libraries, variables and functions
//$footercode = $_SCRIPTS->getFooter();
COM_siteHeader関数内1,286行目(*2)付近(ヘッダーの新たなテーマ変数plg_extrascriptにscriptを出力する)\\
*2 - 1.8.0 の行番号, 2.0.0 では 1,337行目付近。
$headercode = $_SCRIPTS->getHeader() . $headercode;
$header->set_var( 'plg_headercode', $headercode );
// Retrieve any JavaScript libraries, variables and functions
$header->set_var('plg_extrascript', $_SCRIPTS->getFooter());
使っているテーマの header.thtml に追記する。
{doctype}
{page_title_and_site_name}
{feed_url}
{rel_links}
{plg_headercode}
{plg_extrascript}
==== forum.css の修正 ====
Geeklog Forum Plugin の forum.css が Dokuwiki の syntaxhighlighter3 に悪影響するので修正\\
**%%/path/to/public_html/forum/forum/layout/forum.css%%**
/* CSS Declarations for Code block feature - default will use the .php one */
.pluginSolidOutline div .php { max-height:400px; overflow:auto; height:auto; width:auto; min-height:100px; }
.pluginSolidOutline div .html { height:300px; overflow:auto; width:auto; min-height:100px; }
.pluginSolidOutline div .css { height:300px; overflow:auto; width:auto; min-height:100px; }
===== ☢️古い資料です (Obsolete)☢️ =====
==== geeklogのDokuWiki Plugin ====
=== 管理者用のサイト設定 ===
使用言語: ja で日本語化されない場合は、/dokuwiki/conf/local.protected.phpにて追加設定を行う。\\
**local.protected.php** に __**$conf['lang'] = 'ja';**__ を追加\\
===== 参考文献 =====
[[https://dokuwiki.oreda.net/plugin/list.html|DokuWikiおすすめプラグイン一覧。まとめ [DokuWikiで情報発信]]]\\
[[qita>ruddy95/items/e12498ab7c0eb56611a2|WEBページをコンテントセキュリティポリシー(CSP)対応させる - Qiita]]\\
[[qita>tearoom6/items/30e3aacaa432860d4b36|HTTP CSP について - Qiita]]\\
[[https://you84815.blogspot.com/2017/01/dokuwikicontent-security-policy.html|tobijibu-ashiato: DokuWikiのContent-Security-Policy対応方法]]\\
[[https://laboradian.com/show-text-immediately-using-font-display/|Webフォントを使う場合に font-display 記述子を使ってすぐにテキストを表示させる – ラボラジアン]]\\
[[https://www.achiachi.net/blog/index.html|トップページ [あちあち情報局]]]\\
==== 付録 ====
[[tw>tomoyan596/status/1462064104101888002|これはDokuWikiの編集画面ですけど、CSSも埋められますけど、LESSでスタイル定義できたり...🤤PHP?🤔テーマファイルはcustom.lessとかコンパイルされますけど、編集しながら試したいのでlessphp呼び出してしまえばねぇ可能な訳でつい😅💦 / Twitter]]\\
[[tw>tomoyan596/status/1490051770806005760|😱😱😱CodeMirror Pluginががががが😥
多分テンプレートのモバイルCSSと相性宜しくない😅]]\\
[[tw>tomoyan596/status/1492593642459914240|またもや、CodeMirrorプラグインがテーマのドラフトステータスによりヤラレテル😱😱😱これはテーマ側での対処は速いけど、どのテーマとも相性出るならCodeMirrorプラグイン側に対処を入れるべきか❓🤔自分のサイト専用カスタムのcustom.lessで対処入れられるか❓🤔編集側にしか影響は無いけど…😅]]\\
[[tw>tomoyan596sp/status/1514366405139103747|AVIFもWebPのように、このような対応が良いですね🥰]]\\
[[tw>tomoyan596sp/status/1554871221518422016|サーバーをPHP 8へ移行してる🤤Wikiを移行してるだけだけど😅先ずはフルバックアップしてPHP 8対応版の Release 2022-07-31 "Igor" へアップグレード完了した🤔PHP 7.4 から PHP 8系へシステムのパッケージを入れ替える😃移行ははじめてですけど...🤔]]\\
[[tw>tomoyan596sp/status/1569795203896320000|Bootstrapテーマの目次の折り畳みがおかしいのは、TocTweakプラグインとテーマが喧嘩⚔️してるから😅テーマやプラグインは確かに便利で楽だけど、組み合わせはユーザーが自由にやるので、作者さんも全てのパターンに対処しきれません🤔 !important 重要☝😅]]\\