Skip to content

Commit

Permalink
Add ContentModels static class.
Browse files Browse the repository at this point in the history
  • Loading branch information
CXuesong committed Nov 13, 2016
1 parent eba69ed commit dce7e33
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions WikiClientLibrary/MediaWiki.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,24 @@ public static string GetCanonicalName(int namespaceId)
}
}

/// <summary>
/// Contains commonly-used content model names for MediaWiki pages. (MediaWiki 1.22+)
/// </summary>
public static class ContentModels
{
/// <summary>
/// Normal wikitext.
/// </summary>
public const string Wikitext = "wikitext";
public const string JavaScript = "javascript";
public const string Css = "css";
/// <summary>
/// Scribunto LUA model.
/// </summary>
public const string Scribunto = "Scribunto";

}

internal static class MediaWikiUtility
{
private static readonly Regex ProtocolMatcher = new Regex(@"^[A-Za-z\-]+(?=://)");
Expand Down
1 change: 1 addition & 0 deletions WikiClientLibrary/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public static Page FromTitle(Site site, string title, int defaultNamespaceId)
/// <summary>
/// Content model. (MediaWiki 1.22)
/// </summary>
/// <remarks>See <see cref="ContentModels"/> for a list of commonly-used content model names.</remarks>
public string ContentModel { get; private set; }

/// <summary>
Expand Down

0 comments on commit dce7e33

Please sign in to comment.