C# Класс WikiFunctions.Parse.MetaDataSorter

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
PossibleInterwikis List

Открытые методы

Метод Описание
IWMatchEval ( Match match ) : string

Interwikis ( string &articleText ) : string

Extracts all of the interwiki featured article and interwiki links from the article text Ignores interwikis in comments/nowiki tags

Interwikis ( string &articleText, bool linkFGAsInText ) : string

Extracts all of the interwiki featured article and interwiki links from the article text Ignores interwikis in comments/nowiki tags

MetaDataSorter ( ) : System
MoveExternalLinks ( string articleText ) : string

Ensures the external links section of an article is after the references section

MoveMaintenanceTags ( string articleText ) : string

Moves maintenance tags to the top of the article text. Deduplicates identical tags Does not move tags when only non-infobox templates are above the last tag For en-wiki apply this to zeroth section of article only

MoveMultipleIssues ( string articleText ) : string

Moves multiple issues template to the top of the article text. Does not move tags when only non-infobox templates are above the last tag For en-wiki apply this to zeroth section of article only

MovePortalTemplates ( string articleText ) : string

Moves any {{XX portal}} templates to the 'see also' section, if present (en only), per Template:Portal

MoveSeeAlso ( string articleText ) : string

Moves the 'see also' section to be above the 'references' section, subject to the limitation that the 'see also' section can't be the last level-2 section. Does not move section when two or more references sections in the same article

MoveSisterlinks ( string articleText ) : string

Moves sisterlinks such as {{wiktionary}} to the external links section

MoveTemplate ( string articleText, Regex templateRegex ) : string

Moves matching templates in the zeroth section to the top of the article (en only)

MoveTemplateToReferencesSection ( string articleText, Regex templateRegex ) : string

Moves the given template(s) from anywhere in the article to the references section.

MoveTemplateToReferencesSection ( string articleText, Regex TemplateRegex, bool onlyfromzerothsection ) : string

Moves given template to the references section from the zeroth section, if present (en only)

MoveTemplateToSeeAlsoSection ( string articleText, Regex TemplateToMove ) : string

Moves template calls to the top of the "see also" section of the article

RemoveCats ( string &articleText, string articleTitle ) : string

Extracts DEFAULTSORT + categories from the article text; removes duplicate categories, cleans whitespace and underscores

RemoveDisambig ( string &articleText ) : string

Removes any disambiguation templates from the article text, to be added at bottom later

RemovePersonData ( string &articleText ) : string

Extracts the persondata template from the articleText, along with the persondata comment, if present on the line before

RemoveStubs ( string &articleText ) : string

Extracts stub templates from the article text

Приватные методы

Метод Описание
CatKeyer ( IEnumerable list, string name ) : List

Key ( string what ) : string

ListToString ( ICollection items ) : string

Remove duplicates, and return List as string, one item per line

Load ( string what ) : List

LoadInterWikiFromCache ( ) : bool

Loads interwikis from local disk cache if available

LoadInterWikiFromNetwork ( ) : void

MoveTemplateToSection ( string articleText, Regex templateRegex, int section ) : string

Moves the given template(s) to the required section.

RemExtra ( string input ) : string

RemoveInterWikis ( string &articleText ) : List

Extracts all of the interwiki links from the article text, handles comments beside interwiki links (not inline comments)

RemoveLinkFGAs ( string &articleText ) : List

Gets a list of Link FA/GA's from the article

SaveInterWikiToCache ( ) : void

Sort ( string articleText, string articleTitle ) : string

Sorts article meta data, including optional whitespace fixing

Sort ( string articleText, string articleTitle, bool fixOptionalWhitespace ) : string

Sorts article meta data

TemplateExists ( List templatesFound, Regex r ) : bool

Returns whether the given regex matches any of the (first name upper) templates in the given list

Описание методов

IWMatchEval() публичный статический Метод

public static IWMatchEval ( Match match ) : string
match System.Text.RegularExpressions.Match
Результат string

Interwikis() публичный Метод

Extracts all of the interwiki featured article and interwiki links from the article text Ignores interwikis in comments/nowiki tags
public Interwikis ( string &articleText ) : string
articleText string Article text with interwiki and interwiki featured article links removed
Результат string

Interwikis() публичный Метод

Extracts all of the interwiki featured article and interwiki links from the article text Ignores interwikis in comments/nowiki tags
public Interwikis ( string &articleText, bool linkFGAsInText ) : string
articleText string Article text with interwiki and interwiki featured article links removed
linkFGAsInText bool
Результат string

MetaDataSorter() публичный Метод

public MetaDataSorter ( ) : System
Результат System

MoveExternalLinks() публичный статический Метод

Ensures the external links section of an article is after the references section
public static MoveExternalLinks ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

MoveMaintenanceTags() публичный статический Метод

Moves maintenance tags to the top of the article text. Deduplicates identical tags Does not move tags when only non-infobox templates are above the last tag For en-wiki apply this to zeroth section of article only
public static MoveMaintenanceTags ( string articleText ) : string
articleText string the article text
Результат string

MoveMultipleIssues() публичный статический Метод

Moves multiple issues template to the top of the article text. Does not move tags when only non-infobox templates are above the last tag For en-wiki apply this to zeroth section of article only
public static MoveMultipleIssues ( string articleText ) : string
articleText string the article text
Результат string

MovePortalTemplates() публичный статический Метод

Moves any {{XX portal}} templates to the 'see also' section, if present (en only), per Template:Portal
public static MovePortalTemplates ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

MoveSeeAlso() публичный статический Метод

Moves the 'see also' section to be above the 'references' section, subject to the limitation that the 'see also' section can't be the last level-2 section. Does not move section when two or more references sections in the same article
public static MoveSeeAlso ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

MoveSisterlinks() публичный статический Метод

Moves sisterlinks such as {{wiktionary}} to the external links section
public static MoveSisterlinks ( string articleText ) : string
articleText string The article text
Результат string

MoveTemplate() публичный статический Метод

Moves matching templates in the zeroth section to the top of the article (en only)
public static MoveTemplate ( string articleText, Regex templateRegex ) : string
articleText string The wiki text of the article.
templateRegex System.Text.RegularExpressions.Regex Regex matching the templates to be moved
Результат string

MoveTemplateToReferencesSection() публичный статический Метод

Moves the given template(s) from anywhere in the article to the references section.
public static MoveTemplateToReferencesSection ( string articleText, Regex templateRegex ) : string
articleText string /// Article text. ///
templateRegex System.Text.RegularExpressions.Regex /// Regex to match the template(s) to be moved ///
Результат string

MoveTemplateToReferencesSection() публичный статический Метод

Moves given template to the references section from the zeroth section, if present (en only)
public static MoveTemplateToReferencesSection ( string articleText, Regex TemplateRegex, bool onlyfromzerothsection ) : string
articleText string The wiki text of the article.
TemplateRegex System.Text.RegularExpressions.Regex A Regex to match the template to move
onlyfromzerothsection bool Whether to check only the zeroth section of the article for the template
Результат string

MoveTemplateToSeeAlsoSection() публичный статический Метод

Moves template calls to the top of the "see also" section of the article
public static MoveTemplateToSeeAlsoSection ( string articleText, Regex TemplateToMove ) : string
articleText string The article text
TemplateToMove System.Text.RegularExpressions.Regex The template calls to move
Результат string

RemoveCats() публичный Метод

Extracts DEFAULTSORT + categories from the article text; removes duplicate categories, cleans whitespace and underscores
public RemoveCats ( string &articleText, string articleTitle ) : string
articleText string The wiki text of the article.
articleTitle string Title of the article
Результат string

RemoveDisambig() публичный статический Метод

Removes any disambiguation templates from the article text, to be added at bottom later
public static RemoveDisambig ( string &articleText ) : string
articleText string The wiki text of the article.
Результат string

RemovePersonData() публичный статический Метод

Extracts the persondata template from the articleText, along with the persondata comment, if present on the line before
public static RemovePersonData ( string &articleText ) : string
articleText string The wiki text of the article.
Результат string

RemoveStubs() публичный статический Метод

Extracts stub templates from the article text
public static RemoveStubs ( string &articleText ) : string
articleText string The wiki text of the article.
Результат string

Описание свойств

PossibleInterwikis публичное свойство

public List PossibleInterwikis
Результат List