Extension:TextExtracts/pt
From Linux Web Expert
<translate> This {{<tvar name=1>#if:|{{{type}}}</tvar>|extension}} [[<tvar name=mwversion>Special:MyLanguage/MediaWiki 1.34#Bundled extensions</tvar>|comes with MediaWiki <tvar name=mwversion2>1.34</tvar>]] and above.</translate> <translate> Thus you do not have to download it again.</translate> <translate> However, you still need to follow the other instructions provided.</translate>
This extension is under code stewardship review and not actively maintained (<translate> task <tvar name=1>T256505</tvar></translate>). No new feature requests will be considered during this period.
File:OOjs UI icon information-progressive.svg | For obtaining summaries in production environments, the Page Content Service is recommended and used by Wikimedia products. |
TextExtracts Estado de lançamento: estável |
|
---|---|
Implementação | API |
Descrição | Fornece API com texto simples ou extratos de HTML limitados do conteúdo da página |
Autor(es) | Max Semenik (MaxSemtalk) |
Política de compatibilidade | Lançamentos de capturas de ecrã junto com o MediaWiki. Original não é compatível com versões anteriores. |
MediaWiki | |
Alterações à base de dados | Não |
Licença | Licença não especificada |
Transferência | |
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Traduza a extensão TextExtracts se ela estiver disponível em translatewiki.net | |
Problemas | Tarefas em aberto · Reportar um erro |
A extensão TextExtracts fornece uma API que permite obter texto simples ou extratos de HTML limitado (HTML com conteúdo para algumas classes de CSS removidas) do conteúdo de página.
Instalação
- <translate> [[<tvar name=2>Special:ExtensionDistributor/TextExtracts</tvar>|Download]] and move the extracted <tvar name=name>
TextExtracts
</tvar> folder to your <tvar name=ext>extensions/
</tvar> directory.</translate>
<translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/TextExtracts - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'TextExtracts' );
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
Definições de Configuração
$wgExtractsRemoveClasses
é uma matriz de <tag>, <tag>.class, .<class>, #<id> que irá ser excluída da extração.- Por exemplo,
$wgExtractsRemoveClasses[] = 'dl';
remove o texto indentado, normalmente utilizado para "hatnotes" de não modelos que não desejados nos resumos.
- Por exemplo,
- extension.json defines as predefinições, das quais a classe "noexcerpt" é uma - isto poderá ser adicionado a qualquer modelo para excluí-lo.
$wgExtractsExtendOpenSearchXml
defines se "TextExtracts" deverá fornecer os seus extratos para o módulo da API Opensearch. A predefinição é "false
".
API
extracts | |
---|---|
Devolve texto simples ou extrações de HTML limitadas das páginas indicadas <translate> This module cannot be used as a [[<tvar|1>Special:MyLanguage/API:Query#Generators</>|generator]].</translate> | |
<translate> Prefix</translate> | ex |
<translate> Required rights</translate> | <translate> none</translate> |
<translate> Post only?</translate> | <translate> No</translate> |
<translate> Generated help</translate> | <translate> Current</translate> |
File:Oxygen480-categories-preferences-system.svg | <translate> The following documentation is the output of <tvar name=special>Special: |
Module "query+extracts" not found.
Outro exemplo
api.php? action=query& prop=extracts& exchars=100& explaintext& titles=Earth [<translate> try in ApiSandbox</translate>]
<translate> Result</translate> |
---|
{
"query": {
"pages": {
"9228": {
"pageid": 9228,
"ns": 0,
"title": "Earth",
"extract": "Earth, also called the world and, less frequently, Gaia, (or Terra in some works of science fiction)..."
}
}
}
}
|
Caveats
There are various things to be aware of when using the API or software that uses the API e.g. Extension:Popups .
- We do not recommend the usage of `exsentences`.
It does not work for HTML extracts and there are many edge cases for which it doesn't exist. For example "Arm. gen. Ing. John Smith was a soldier." will be treated as 4 sentences. We do not plan to fix this.
- Inline images are stripped from the response (even in HTML mode). This means if you are using the Math extension and using formulae in your lead section they may not appear in the summary output.
- In HTML mode we cannot guarantee well formed HTML. Resulting HTML may be invalid or malformed.
- In plaintext mode:
- citations may not be stripped (see phab:T197266)
- if a paragraph ends with an HTML tag e.g. ref tag, new lines may be dropped (see phab:T201946)
- new lines may be dropped after lists phab:T208132
- Articles must begin with the lead paragraph for an extract to be generated. The use of any template, and/or unclosed or empty HTML element may result in no preview for the article. E.g. "<div></div>hello" will give an empty extract.
FAQ
How can I remove content from a page preview/extract?
TextExtracts will strip any element that is marked with the class .noexcerpt
.
This is provided by the $wgExtractsRemoveClasses
configuration variable (which also defines some other excluded elements).
Consulte também
File:Wikimedia-logo black.svg | <translate> This {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is being used on one or more [[<tvar name=2>m:Special:MyLanguage/Wikimedia projects</tvar>|Wikimedia projects]].</translate> <translate> This probably means that the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is stable and works well enough to be used by such high-traffic websites.</translate> <translate> Look for this {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension's|skin's}} name in Wikimedia's <tvar name=2>CommonSettings.php</tvar> and <tvar name=3>InitialiseSettings.php</tvar> configuration files to see where it's installed.</translate> <translate> A full list of the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extensions|skins}} installed on a particular wiki can be seen on the wiki's <tvar name=ver>Special:Version</tvar> page.</translate> |
File:OOjs UI icon information-progressive.svg |
Categories:
- Pages with script errors
- Extensions bundled with MediaWiki 1.34/pt
- Pages with broken file links
- Stable extensions/pt
- API extensions/pt
- Extensions without MediaWiki version
- Extensions with no license specified/pt
- Extensions in Wikimedia version control/pt
- All extensions/pt
- Extensions not in ExtensionJson
- Extensions used on Wikimedia/pt