Jump to content

Help:Extension:Linter/cs: Difference between revisions

From mediawiki.org
Content deleted Content added
No edit summary
No edit summary
Line 24: Line 24:


* Které jsou chybné (např. falešné možnosti obrázků – obvykle způsobené překlepy nebo tím, že [[phab:T163582|parsování možností médií v MediaWiki je křehké]]).
* Které jsou chybné (např. falešné možnosti obrázků – obvykle způsobené překlepy nebo tím, že [[phab:T163582|parsování možností médií v MediaWiki je křehké]]).
* které jsou zastaralé (např.: [[phab:T134423|samozavírací tagy]])
* Které jsou zastaralé (např.: [[phab:T134423|samozavírací tagy]])
* které se mohou přerušit kvůli změnám v parsovacím kanálu (např.: [[Special:MyLanguage/Parsing/Replacing Tidy|nahrazení Tidy za RemexHTML]])
* které se mohou přerušit kvůli změnám v parsovacím kanálu (např.: [[Special:MyLanguage/Parsing/Replacing Tidy|nahrazení Tidy za RemexHTML]])
* které již nejsou platné v HTML5 (např. zastaralé tagy jako center, font)
* které již nejsou platné v HTML5 (např. zastaralé tagy jako center, font)

Revision as of 09:44, 27 April 2025

Rozšíření Linter identifikuje vzory wikitextu, které je nutné nebo lze na stránkách opravit, spolu s pokyny, jaké jsou problémy s těmito vzory a jak je opravit.

Stránka Chyby nalezené Lintem seskupuje chyby podle typu. Některé z těchto problémů se dají snadněji najít na stránce Substituce šablon. Na této stránce budeme klasifikovat problémy s Linterem podle závažnosti problému vzhledem k cílům, které tyto problémy blokují. Více informací a diskuse k tomuto tématu je uvedeno níže.

Ve spodní části stránky Chyby nalezené Lintem je nová funkce "Zobrazit všechny chyby Linteru pro konkrétní stránku", která umožňuje editorovi zobrazit přehled všech chyb na jedné stránce. Zpráva obsahuje kategorii a další užitečné informace a každá chyba má klikatelný odkaz, který načte stránku a chybu zvýrazní. (Poznámka: Pokud má váš editor zdrojového kódu povoleno zvýrazňování syntaxe, nemusí zvýrazňování fungovat). Pokud budete postupovat od konce seznamu směrem nahoru, změny na stránce nezneplatní posuny znaků dřívějších chyb a je to doporučený způsob práce, pokud opravujete všechny chyby na stránce.

Budeme i nadále vylepšovat funkčnost, abychom eliminovali šum, opravili chyby a zvýšili praktičnost výstupu Linteru, ale aktuální výstup je připraven k použití a akci.

Dokumentace problémů s lintováním

Hlavní stránka: Help:Lint errors

Proč a co opravit

Do budoucna plánuje parsovací tým využít rozšíření Linter k identifikaci vzorů wikitextu:

  • Které jsou chybné (např. falešné možnosti obrázků – obvykle způsobené překlepy nebo tím, že parsování možností médií v MediaWiki je křehké).
  • Které jsou zastaralé (např.: samozavírací tagy)
  • které se mohou přerušit kvůli změnám v parsovacím kanálu (např.: nahrazení Tidy za RemexHTML)
  • které již nejsou platné v HTML5 (např. zastaralé tagy jako center, font)
  • Které jsou potenciálně poškozené a analyzátor je může špatně interpretovat oproti tomu, co editor zamýšlel (např. neuzavřené HTML tagy, špatně vnořené HTML tagy)

Not all of them need to be fixed promptly or even ever (depending on your tolerance for lint). Different goals are advanced by fixing different subsets of the above lint issues. We (the parsing team) will try to be transparent about these goals and will provide guidance about which goals are advanced by fixing which issues.

Simplified instructions are provided in the FAQ page.

As part of addressing technical debt in the parsing pipeline of MediaWiki, we replaced Tidy with a HTML5-based tool. However, doing so would have broken the rendering of a small subset of pages unless certain wikitext patterns were fixed. Specifically, issues found in the deletable-table-tag, pwrap-bug-workaround, self-closed-tag, tidy-whitespace-bug, html5-misnesting, and tidy-font-bug categories. In order to do a timely replacement of Tidy, we classified all these issues as high priority.

Right now, the HTML generated by the PHP parser is used for read views and the HTML generated by Parsoid is used by editing tools and the Android app among others. The parsing team, as one of its long-term objectives, wants to enable the use of Parsoid's output for both read views as well as for editing. Since Parsoid and RemexHTML are both HTML5-based tools, the lint categories that affect RemexHTML's rendering also affect Parsoid's rendering. We haven't yet identified any newer lint issues that affect Parsoid's rendering at this time, but will update this list as we identify any such.

This is a somewhat complex goal and we haven't yet arrived at an understanding about how important it is to pursue this goal or how far we should go with this. Additionally, it is not yet clear what mechanisms we wish to leverage towards this goal. For example, based on a bunch of discussions in different venues, User:Legoktm/HTML+MediaWiki outlines a proposal for handling the html5-deprecated big tag. In any case, fixing issues in the obsolete-tag, self-closed-tag categories advance this goal. Given lack of clarity around this goal, we have accordingly marked the obsolete-tag category as a low-priority goal.

Goal: Clarifying editor intent

Getting markup right is hard. Errors inadvertently creep through. While the parser does its best in recovering from these errors, in many cases, what the parser does might not truly reflect the editor's original intent. Given that, we recommend that it is best to fix the issues identified here to clarify the editor's intention. Issues in the bogus-image-options, fostered-content, misnested-tag, missing-end-tag categories seem to affect this goal. Since this is a fairly important goal, we have marked most of them with medium priority. However, we have marked the missing-end-tag category with a low priority since in a vast majority of cases, the parser does seem to recover fairly accurately. Nevertheless, we recommend fixing whatever can be fixed without too much effort, if only to assist comprehension by other human editors and tools.

Goal: Clean markup

Getting markup right is hard. Even in the presence of errors, the parser does a fairly decent job in most cases in figuring out accurately how that piece of markup is supposed to render. But, in much the same way that typos, punctuation and minor grammatical errors can feel unsettling, some editors or those with a developer-mindset might find lint issues in these categories unsettling. We don't recommend spending an inordinate amount of time fixing these issues and, in many scenarios, bots might be able to fix these up as well. misnested-tag, missing-end-tag, stripped-tag lint categories affect this goal.

Goal: Improve content portability and presentation

Writing templates for content that works across different devices, different browser resolutions, different skins (and their themes e.g. dark mode), different websites (e.g. Wikiwand, Kiwix, Wikimedia Apps) is tricky. While skins do their best to adapt to content, they are restricted in what they can do given the myriad of templates used across our sites. Where we can, issues are flagged for editors to assist. night-mode-unaware-background-color, large-tables, lint categories affect this goal.

FAQ

When are lint errors for a page updated?

Currently, all lint categories are populated by errors identified by Parsoid while parsing a page. When a page (or, template transcluded on a page) is edited, ChangeProp requests a re-parse of that page from Parsoid, which will send the fresh results to the Linter extension.

This means that when a new category is introduced (or a correction is made to a previous category), it may take a while for all the results to be updated (if ever for pages that are rarely touched). Making a null edit would speed up the process individually. However, in phab:T161556, we're exploring ways to reprocess all pages.

Should pages in X namespace (e.g. talk) be fixed

The priority is content namespaces. The rest largely depend on the wiki. A lot of pages are used as a sandbox, and as such deliberately contain errors.

Tools

See also