Documentation ¶
Index ¶
- Constants
- Variables
- type Article
- func (a *Article) CheckDisambiguation() bool
- func (a *Article) CheckRedirect() (bool, *WikiLink)
- func (a *Article) GenText() error
- func (a *Article) GetAbstract() string
- func (a *Article) GetExternalLinks() []string
- func (a *Article) GetLinks() []WikiLink
- func (a *Article) GetMedia() []WikiLink
- func (a *Article) GetText() string
- func (a *Article) GetTextLinks() []FullWikiLink
- func (a *Article) ParseSimple() error
- func (a *Article) PrintParseTree()
- func (a *Article) Tokenize(mw string, g PageGetter) ([]*Token, error)
- func (a *Article) TranscludeTemplatesRecursive(mw string, params map[string]string, g PageGetter, depth int) string
- type DummyPageGetter
- type FullWikiLink
- type Namespaces
- type PageGetter
- type ParseNode
- type Prefixes
- type Template
- type TemplateRenderer
- type Token
- type WikiLink
Constants ¶
View Source
const ( QS_none int = iota QS_i QS_b QS_ib QS_bi )
View Source
const (
TClosed int = 1 << iota
)
Variables ¶
View Source
var DebugLevel int = 0
View Source
var MagicMap map[string]TemplateRenderer = map[string]TemplateRenderer{ "DISPLAYTITLE": nil, }
View Source
var NoHashFunctionsMap map[string]bool = map[string]bool{ "displaytitle": true, "formatdate": true, "int": true, "namespace": true, "pagesinnamespace": true, "speciale": true, "special": true, "tag": true, "anchorencode": true, "basepagenamee": true, "basepagename": true, "canonicalurle": true, "canonicalurl": true, "cascadingsources": true, "defaultsort": true, "filepath": true, "formatnum": true, "fullpagenamee": true, "fullpagename": true, "fullurle": true, "fullurl": true, "gender": true, "grammar": true, "language": true, "lcfirst": true, "lc": true, "localurle": true, "localurl": true, "namespacee": true, "namespacenumber": true, "nse": true, "ns": true, "numberingroup": true, "numberofactiveusers": true, "numberofadmins": true, "numberofarticles": true, "numberofedits": true, "numberoffiles": true, "numberofpages": true, "numberofusers": true, "numberofviews": true, "padleft": true, "padright": true, "pageid": true, "pagenamee": true, "pagename": true, "pagesincategory": true, "pagesize": true, "plural": true, "protectionlevel": true, "revisionday2": true, "revisionday": true, "revisionid": true, "revisionmonth1": true, "revisionmonth": true, "revisiontimestamp": true, "revisionuser": true, "revisionyear": true, "rootpagenamee": true, "rootpagename": true, "subjectpagenamee": true, "subjectpagename": true, "subjectspacee": true, "subjectspace": true, "subpagenamee": true, "subpagename": true, "talkpagenamee": true, "talkpagename": true, "talkspacee": true, "talkspace": true, "ucfirst": true, "uc": true, "urlencode": true, }
View Source
var VariablesMap map[string]bool = map[string]bool{ "articlepath": true, "basepagenamee": true, "basepagename": true, "cascadingsources": true, "contentlanguage": true, "currentday2": true, "currentdayname": true, "currentday": true, "currentdow": true, "currenthour": true, "currentmonth1": true, "currentmonthabbrev": true, "currentmonthnamegen": true, "currentmonthname": true, "currentmonth": true, "currenttimestamp": true, "currenttime": true, "currentversion": true, "currentweek": true, "currentyear": true, "directionmark": true, "fullpagenamee": true, "fullpagename": true, "localday2": true, "localdayname": true, "localday": true, "localdow": true, "localhour": true, "localmonth1": true, "localmonthabbrev": true, "localmonthnamegen": true, "localmonthname": true, "localmonth": true, "localtimestamp": true, "localtime": true, "localweek": true, "localyear": true, "namespacee": true, "namespacenumber": true, "namespace": true, "numberofactiveusers": true, "numberofadmins": true, "numberofarticles": true, "numberofedits": true, "numberoffiles": true, "numberofpages": true, "numberofusers": true, "numberofviews": true, "pageid": true, "pagenamee": true, "pagename": true, "revisionday2": true, "revisionday": true, "revisionid": true, "revisionmonth1": true, "revisionmonth": true, "revisionsize": true, "revisiontimestamp": true, "revisionuser": true, "revisionyear": true, "rootpagenamee": true, "rootpagename": true, "scriptpath": true, "servername": true, "server": true, "sitename": true, "stylepath": true, "subjectpagenamee": true, "subjectpagename": true, "subjectspacee": true, "subjectspace": true, "subpagenamee": true, "subpagename": true, "talkpagenamee": true, "talkpagename": true, "talkspacee": true, "talkspace": true, }
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { MediaWiki string Title string Links []WikiLink ExtLinks []string Type string AbstractText string Media []WikiLink Tokens []*Token Root *ParseNode Parsed bool Text string TextLinks []FullWikiLink Templates []*Template // contains filtered or unexported fields }
func NewArticle ¶
func ParseArticle ¶
func ParseArticle(title, text string, g PageGetter) (*Article, error)
func (*Article) CheckDisambiguation ¶
func (*Article) CheckRedirect ¶
func (*Article) GetAbstract ¶
func (*Article) GetExternalLinks ¶
func (*Article) GetTextLinks ¶
func (a *Article) GetTextLinks() []FullWikiLink
func (*Article) ParseSimple ¶
func (*Article) PrintParseTree ¶
func (a *Article) PrintParseTree()
func (*Article) TranscludeTemplatesRecursive ¶
type DummyPageGetter ¶
type DummyPageGetter struct{}
type FullWikiLink ¶
type Namespaces ¶
var StandardNamespaces Namespaces = map[string]string{
"media": "Media",
"special": "Special",
"talk": "Talk",
"user": "User",
"user talk": "User talk",
"wikipedia": "Wikipedia",
"wikipedia talk": "Wikipedia talk",
"file": "File",
"file talk": "File talk",
"mediawiki": "MediaWiki",
"mediawiki talk": "MediaWiki talk",
"template": "Template",
"template talk": "Template talk",
"help": "Help",
"help talk": "Help talk",
"category": "Category",
"category talk": "Category talk",
"portal": "Portal",
"portal talk": "Portal talk",
"book": "Book",
"book talk": "Book talk",
"draft": "Draft",
"draft talk": "Draft talk",
"education program": "Education Program",
"education program talk": "Education Program talk",
"timedtext": "TimedText",
"timedtext talk": "TimedText talk",
"module": "Module",
"module talk": "Module talk",
"topic": "Topic",
}
func (Namespaces) WikiCanonicalFormNamespaceEsc ¶
func (namespaces Namespaces) WikiCanonicalFormNamespaceEsc(l string, defaultNamespace string, unescape bool) WikiLink
type PageGetter ¶
type WikiLink ¶
func WikiCanonicalForm ¶
func WikiCanonicalFormEsc ¶
func (*WikiLink) FullPagename ¶
func (*WikiLink) FullPagenameAnchor ¶
func (*WikiLink) IsImplicitSelfLink ¶
Click to show internal directories.
Click to hide internal directories.