Extension:校对页面
Proofread Page擴充功能可創建一本書:
- 若不是,變成在一column掃瞄的影像旁邊的一columnOCR文字
- 那就是,被拆成數個的章節或段落,文件的內容會出現在MediaWiki頁面之中(透過嵌入)
这个扩展用于让对比文本和数字化原件更简单。
此擴充功能以多種方式顯示文字,但不需實際地複製原始文字。[1]
使用
此擴充功能被安裝在所有維基文庫的wiki。 有关语法,请参阅维基文库校對頁面的帮助文档。 它之前也被用在维基别库上。
需求和建議
- 如果從網頁瀏覽器執行更新腳本(maintenance/update.php)失敗的話,則需要存取命令列 (請參閱更新文件和Update.php文件)。
- 如果想要使用DjVu檔案(此為可選但建議使用),則需要有原生的DjVu處理器可供設定。 请参阅Manual:如何在MediaWiki中使用DjVu。
- 此外,使用下列擴充功能可大幅提升ProofreadPage的使用效能:
- LabeledSectionTransclusion (強烈建議)
- Cite(引用) (預設的頁腳包含有
<references /> - Poem
- PdfHandler (可能需要额外的PHP包) — 增加PDF支持
- PagedTiffHandler
- ParserFunctions
- TemplateStyles(模板样式) (啟用Index-specific CSS)
- Scribunto (啟用Lua函式庫校對)
安裝
扩展
- 下载文件,并解压
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
如果您遇到類似以下的問題:
- phab:T301291 – 維基共享資源上的PDF和DjVu檔案處理失敗(無縮圖、無頁面),但在其他方面有效
- phab:T298417 – 未刪除的DjVu檔案顯示不正確的metadata: 0x0大小、無頁碼資訊
- phab:T299521 – 在維基共享資源中,PDF檔案上傳新版本後的影像大小為0x0,而頁數卻是正確無誤
請尝试以下步骤:
- 修復核心MediaWiki中DjVu檔案的縮圖(PDF檔案請使用MIME類型
application/pdf)php maintenance/refreshImageMetadata.php --verbose --mime image/vnd.djvu --force
- 用於實現
Special:IndexPages頁面數的所需資訊php maintenance/refreshLinks.php --namespace 252
命名空間
預設情況下,ProofreadPage 會建立兩個自訂命名空間,名稱分別為英文的「Page」和「Index」,其ID分別為250和252。
如果您的維基使用其他語言,這些名稱將會被翻譯。 完整列表.
您可以自訂其名稱或其ID:手動建立命名空間,並透過 $wgProofreadPageNamespaceIds 全域變數在 Manual:LocalSettings.php 中設定其 ID。 操作方式類似以下:
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
);
不建議自訂命名空間 ID,且此功能未來可能不再受支援。
配置
- 為了使用頁面品質系統,必須建立五個類別。 這些類別的名稱必須在 MediaWiki:Proofreadpage_quality0_category 至 MediaWiki:Proofreadpage_quality4_category 中定義。
- 請確認您已有安裝Extension:ParserFunctions
索引命名空間的組態
有关详细信息,请参阅Extension:Proofread Page/Index data configuration
- 您需要建立 MediaWiki:Proofreadpage_index_template 才能顯示索引頁面。 此頁面是一個模板,會接收編輯表單中的欄位作為參數。
- 您需要建立一個名為 MediaWiki:Proofreadpage_index_data_config.json 的變數,其中包含索引表單的組態。 此新的組態頁面會覆寫 MediaWiki:Proofreadpage_index_attributes 和 MediaWiki:Proofreadpage_js_attributes。
此組態為一個由屬性組成的JSON陣列。 以下是陣列中屬性的結構,所有參數皆為可選,並已設定預設值:
{
"ID": { //元資料的 ID(proofreadpage_index_attributes 的第一個參數)
"type": "string", //屬性類型(基於相容性考量,值不一定要是此類型)。 可能的值:字串、數字、頁面。 <span lang="en" dir="ltr" class="mw-content-ltr">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...)</span>
"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. <span lang="en" dir="ltr" class="mw-content-ltr">By example ["; ", " and "] for strings like "J. M. Dent; E. P. Dutton and A. D. Robert"</span>
"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)
- Before following these steps ensure you have followed the instructions in Manual:如何在MediaWiki中使用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 a not-English wiki). For example if your namespace is 'Page' create
Page:Carroll - Alice's Adventures in Wonderland.djvu - Create the corresponding file for this page commons:File:Carroll - Alice's Adventures in Wonderland.djvu (or set 手册:$wgUseInstantCommons to
true). - 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
- Insert the tag
- To edit page 5 of the book navigate to 'Page:Carroll - Alice's Adventures in Wonderland/5' and click edit
語法
此扩展引入了以下标记:
<pages>, <pagelist>
参阅
- Sections
- Index data configuration
- Change tagging
- Lua library reference
- Page viewer
- Edit-in-Sequence – A new system (as of 2022) for proofreading without having to reload the entire page.
- Roadmap of the development
- API
- Metadata API – The
proofreadmeta submodule - Proofread properties API – Proofreading-related properties of individual pages
- Index data API – Access index pages data (fields and categories)
- Index pagination API – List pages in a given index
- Metadata API – The
- Manual:如何在MediaWiki中使用DjVu
- PdfHandler – 添加PDF的支持到校對页面
- 目前的完整描述和说明(英文)可在以下网址找到: s:Help:Proofread
- 使用量的统计信息可以在这裏找到: https://wsstats.toolforge.org/
- ToDo and feature request list from the Community
- 正在撰写公有领域用户手册: Help:Extension:ProofreadPage
- MediaWiki:OCR.js – OCR脚本
注释
- ↑ 由於這些頁面並不在主命名空間中,因此不會在文字單位的統計計數的涵蓋範圍內。
| 此扩展用于一个或多个维基媒体项目。 这可能意味着扩展足够稳定、运作足够良好,可以用在这样的高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php配置文件中查找此扩展的名称以查看哪些网站安装了该扩展。 特定wiki上的已安装的扩展的完整列表位于Special:Version页面。 |
| 此扩展在以下wiki农场/托管网站和/或软件包中提供: |
- Stable extensions/zh
- Page action extensions/zh
- ContentHandler extensions/zh
- Tag extensions/zh
- API extensions/zh
- Database extensions/zh
- Extensions supporting Composer/zh
- Extensions which add rights/zh
- BeforePageDisplay extensions/zh
- CanonicalNamespaces extensions/zh
- ChangeTagsListActive extensions/zh
- CodeMirrorGetMode extensions/zh
- ContentHandlerDefaultModelFor extensions/zh
- EditFormPreloadText extensions/zh
- GetBetaFeaturePreferences extensions/zh
- GetDoubleUnderscoreIDs extensions/zh
- GetLinkColours extensions/zh
- GetPreferences extensions/zh
- ImageOpenShowImageInlineBefore extensions/zh
- InfoAction extensions/zh
- ListDefinedTags extensions/zh
- LoadExtensionSchemaUpdates extensions/zh
- MediaWikiServices extensions/zh
- MultiContentSave extensions/zh
- OutputPageParserOutput extensions/zh
- ParserFirstCallInit extensions/zh
- ParserTestGlobals extensions/zh
- RecentChange save extensions/zh
- ResourceLoaderRegisterModules extensions/zh
- ScribuntoExternalLibraries extensions/zh
- ScribuntoExternalLibraryPaths extensions/zh
- SkinTemplateNavigation::Universal extensions/zh
- WgQueryPages extensions/zh
- GPL licensed extensions/zh
- Extensions in Wikimedia version control/zh
- All extensions/zh
- Pages using deprecated NoteTA template
- Extensions used on Wikimedia/zh
- Extensions included in Miraheze/zh
- Extension:ProofreadPage/zh
- View page extensions/zh
- Image extensions/zh
- Transcription extensions/zh
