Extension:校对页面

This page is a translated version of the page Extension:Proofread Page and the translation is 54% complete.
MediaWiki扩展手册
Proofread Page
发行状态: 稳定版
实现 页面操作 , ContentHandler , 标签 , API , 数据库
描述 The Proofread Page extension can render a book either as a column of OCR text beside a column of scanned images, or broken into its logical organization (such as chapters or poems) using transclusion.
作者 ThomasV (original author)
Tpt (current maintainer)
最新版本 continuous updates
兼容性政策 快照跟随MediaWiki发布。 master分支不向后兼容。
MediaWiki current master
PHP 7.0+
数据库更改
Composer mediawiki/proofread-page
pr_index
许可协议 GNU通用公眾授權條款2.0或更新版本
下載
帮助 Help:Extension:ProofreadPage
示例 s:Index:Wind in the Willows (1913).djvu
Page, Index
  • $wgProofreadPagePageJoiner
  • $wgProofreadPagePageSeparator
  • $wgProofreadPageNamespaceIds
  • $wgProofreadPageEnableEditInSequence
  • $wgProofreadPageBookNamespaces
  • $wgProofreadPageUseStatusChangeTags
  • $wgProofreadPagePageSeparatorPlaceholder

  • pagequality
  • pagequality-admin
  • pagequality-validate
前往translatewiki.net翻譯Proofread Page扩展
問題 开启的任务 · 报告错误

Proofread Page extension

2020 Coolest Tool
Award Winner

in the category
Impact


Proofread Page這個擴充功能可以創建一本書:

  1. 若不是,變成為一列OCR文字,放在一列掃瞄的影像旁邊
  2. 那就是,拆成數個章節或段落,文件的內容會出現在MediaWiki頁面之中(透過嵌入)

这个扩展用于让对比文本和数字化原件更简单。

此擴充功能以多種方式顯示文字,但不需實際地複製原始文字。[1]

使用

此擴充功能被安裝在所有維基文庫的wiki。 有关语法,请参阅维基文库校對頁面的帮助文档。 它之前也被用在维基别库上。

需求和建議


安裝

扩展

  • 下载文件,并将解压后的ProofreadPage文件夹移动到extensions/目录中。
    开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ProofreadPage
  • 将下列代码放置在您的LocalSettings.php 的底部:
    wfLoadExtension( 'ProofreadPage' );
    
  • 运行更新脚本,它将自动创建此扩展必须依赖的数据库表。
  •   完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。

產生縮圖

該擴充功能可直接連結至那些時常是不存在的圖片縮圖。 您必須去捕捉404錯誤並產生遺失的縮圖。 您可以使用這些解決方案中的任何「一個」:

  • 設定Apache在.htaccess中的RewriteRule為thumb.php ,用於縮圖遺失的情況:
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/page([0-9]+)-?([0-9]+)px-.*$ /w/thumb.php?f=$1&p=$2&w=$3 [L,QSA]
  • 」將Apache 404處理器設定為Wikimedia的thumb-handler。 這是一個通用的404處理器,內含維基媒體專屬的程式碼,「並非」是一個單純的縮圖產生器。
    ErrorDocument 404 /w/extensions/upload-scripts/404.php
  • 對於MediaWiki >= 1.20,您可以簡單地重定向到thumb_handler.php:
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/page([0-9]+)-?([0-9]+)px-.*$ /w/thumb_handler.php [L,QSA]
  • 或在apache2.conf中:
    ErrorDocument 404 /w/thumb_handler.php
  警告: 在images目錄內有.htaccess檔案,可能會干擾您安裝的任何.htaccess規則。

如果您遇到類似以下的問題:

  • phab:T301291 – 維基共享資源上的PDF和DjVu檔案處理失敗(無縮圖、無頁面),但在其他方面有效
  • phab:T298417 – 未刪除的DjVu檔案顯示不正確的metadata: 0x0大小、無頁碼資訊
  • phab:T299521 – 在維基共享資源中,PDF檔案上傳新版本後的影像大小為0x0,而頁數卻是正確無誤

請尝试以下步骤:

  1. repair thumbnails for DjVu files of the core MediaWiki (for PDF use mimetype application/pdf )
    php maintenance/refreshImageMetadata.php --verbose --mime image/vnd.djvu --force
    
  2. needed for actualization info about the pages counts of the Special:IndexPages
    php maintenance/refreshLinks.php --namespace 252
    

命名空間

ProofreadPage create by default two custom namespaces named "Page" and "Index" in English with respectively ids 250 and 252.

Their names are translated if your wiki use another language. 完整列表.

You can customize their name or their ID: Create namespaces by hand and set their IDs in Manual:LocalSettings.php using $wgProofreadPageNamespaceIds global. You will do something like:

define( 'NS_PROOFREAD_PAGE', 250);
define( 'NS_PROOFREAD_PAGE_TALK', 251);
define( 'NS_PROOFREAD_INDEX', 252);
define( 'NS_PROOFREAD_INDEX_TALK', 253);
$wgExtraNamespaces[NS_PROOFREAD_PAGE] = 'Page';
$wgExtraNamespaces[NS_PROOFREAD_PAGE_TALK] = 'Page_talk';
$wgExtraNamespaces[NS_PROOFREAD_INDEX] = 'Index';
$wgExtraNamespaces[NS_PROOFREAD_INDEX_TALK] = 'Index_talk';
$wgProofreadPageNamespaceIds = array(
    'index' => NS_PROOFREAD_INDEX,
    'page' => NS_PROOFREAD_PAGE
);

Namespace id customization is not recommended and might not be supported in the future.

配置

The names of these categories must be defined in MediaWiki:Proofreadpage_quality0_category to MediaWiki:Proofreadpage_quality4_category.

Configuration of index namespace

有关详细信息,请参阅Extension:Proofread Page/Index data configuration

This page is a template that receive as parameter entries of the edition form.

This new configuration page overrides MediaWiki:Proofreadpage_index_attributes and MediaWiki:Proofreadpage_js_attributes.

The configuration is a JSON array of properties. Here is the structure of a property in the array, all the parameters are optional, the default value are set:

{
  "ID": { //id of the metadata (first parameter of proofreadpage_index_attributes)
    "type": "string", //the property type (for compatibility reasons the values have not to be of this type). Possibles values: string, number, page. If set, the newly set values should be valid according to the type (e.g. for a number a valid number, for a page an existing wiki page...)
    "size": 1, //only for the type string : number of lines of the input (third parameter of proofreadpage_index_attributes)
    "values":  {"a":"A", "b":"B","c":"C", "d":"D"}, //an array values : label that list the possible values (for compatibility reasons the stored values have not to be one of these)
    "default": "", //the default value
    "header": false, //add the property to MediaWiki:Proofreadpage_header_template template (true is equivalent to being listed in proofreadpage_js_attributes)
    "label": "ID", //the label in the form (second parameter of proofreadpage_index_attributes)
    "help": "", //a short help text
    "delimiter": [], //list of delimiters between two part of values. By example ["; ", " and "] for strings like "J. M. Dent; E. P. Dutton and A. D. Robert"
    "data": "" //proofreadpage's metadata type that the property is equivalent to
  }
}

The data parameter can have for value:

"type", "language", "title", "author", "translator", "illustrator", "editor", "school", "year", "publisher", "place", "progress"

Page separator

The extension puts a separator between every transcluded page and the next, which is defined by wgProofreadPagePageSeparator. The default value is   (a whitespace). Set wgProofreadPagePageSeparator = "" to suppress the separator.

Join hyphenated words across pages

When a word is hyphenated between a page and the next, the extension joins together the two halves of the word. Example: his- and tory becomes history. The "joiner" character is defined by wgProofreadPagePageJoiner and defaults to '-' (the ASCII hyphen character).

Configure change tagging (optional)

See Change tagging to set up change tags.

用法

Creating your first page (example with DjVu)

  • (when and in which namespace is the DjVu file itself uploaded?)
  • Create a page in the "Page" namespace (or the internationalized name if you use an not-English wiki).

For example if your namespace is 'Page' create Page:Carroll - Alice's Adventures in Wonderland.djvu

  • Create the index page Index:Carroll - Alice's Adventures in Wonderland.djvu
    • Insert the tag ‎<pagelist /> in the Pages field to visualize the page list
  • To edit page 5 of the book navigate to 'Page:Carroll - Alice's Adventures in Wonderland/5' and click edit

語法

此扩展引入了以下标记: ‎<pages>, ‎<pagelist>

注释

  1. 由於這些頁面並不在主命名空間中,因此不會在文字單位的統計計數的涵蓋範圍內。

參見