(use eggdoc) (define license "Copyright (c) 2007-2009 Tony Sidaway. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.") (include "doc-macros.scm") (define doc `((eggdoc:begin (name "mw") (description (p "An expanded interface to the MediaWiki API as used by Wikipedia")) (author "Tony Sidaway") (history (version "0.2" "Completion and documentation of mw-query and mw-misc modules. mw-raw and mw-sxml moved to new mw-core egg") (version "0.1" "Initial release") ) (usage) (p "The entire egg may be loaded as above, or individual modules may be loaded as needed.") (documentation (p "Provides a functional programming interface to the MediaWiki API as documented at " (a (@ (href "http://www.mediawiki.org/wiki/API")) "http://www.mediawiki.org/wiki/API")) (p "Building on the functional interface provided by mw-core, this egg provides extra" " features including support for the API's query generators, caching procedures for" " user status checking, wiki formatting, and convenient editing procedures.") (p "NOTE: This egg should be used in compliance with the policies" " of the wiki it is used on. If your account is blocked or you lose privileges," " don't blame the software.") (section "Query module" (p "(require-extension mw-query)") (p "These procedures produce queries of various kinds") (subsection "Properties" (p "Procedures in this section can take other procedures, known as" " generators, as a source of titles to operate on") (procedure "(prop-info source #!key prop)" (p "Page information.") (dl ,(source) (dt "prop")(dd "Page properties we're interested in. This may be a single" " page property, a list of properties, or a string containing" " more than one property, each separated from the next by a \"|\"" " (pipe) character. Available properties are:" " protection, talkid, subjectid, url, intoken." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Properties" "#info_.2F_in")) "documentation"))) (p "Returns a form that, when presented to sx-call, will fetch information" " about the pages.")) (procedure "(prop-revisions source #!key prop startid endid start end dir user excludeuser expandtemplates section token)" (p "Page revision information.") (dl ,(source) (dt "prop")(dd "Revision properties we're interested in. This may be a single" " revision property, a list of properties, or a string containing" " more than one property, each separated from the next by a \"|\"" " (pipe) character. Available properties are:" " ids, flags, timestamp, user, comment, size, content." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Properties" "#revisions_.2F_rv")) "documentation")) (dt "startid") (dd "Revision id to start listing from") (dt "endid") (dd "Revision id to stop listing from") ,(start-end) (dt "dir")(dd "Direction to list in") (dt "user")(dd "Only list revisions made by this user") (dt "excludeuser")(dd "Exclusion revisions made by this user") (dt "expandtemplates")(dd "Expand templates in content output") (dt "section")(dd "Only retrieve content of this section") (dt "token")(dd "Tokens to get for each revision (only token at present is" "\"rollback\")")) (p "Returns a form that, when presented to sx-call, will fetch information" " about the revisions.")) (procedure "(prop-categories source #!key prop show categories)" (p "Category membership") (dl ,(source) (dt "prop")(dd "Which properties to get. This may be a single" " category property, a list of properties, or a string containing" " more than one property, each separated from the next by a \"|\"" " (pipe) character. Available properties are:" " sortkey timestamp. Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Properties" "#categories_.2F_cl")) "documentation")) (dt "show")(dd "Which kinds of categories to list. May be either \"hidden\"" " or \"!hidden\".") (dt "categories")(dd "Only list these categories.")) (p "Returns a form that, when presented to sx-call, will fetch information" " about which pages belong to which categories .") (p "This procedure may be used as a generator.")) (procedure "(prop-imageinfo source #!key prop start end urlwidth urlheight)" (p "Information about pages in the image namespace") (dl ,(source) (dt "prop")(dd "Which properties to get. This may be a single" " image property, a list of properties, or a string containing" " more than one property, each separated from the next by a \"|\"" " (pipe) character. Available properties are:" " timestamp user comment url size sha1 mime metadata archivename." "Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Properties" "#imageinfo_.2F_ii")) "documentation")) ,(start-end) (dt "urlwidth")(dd "If url is included in prop, an image scaled to this width" " is returned if possible.") (dt "urlheight")(dd "If url is included in prop, an image scaled to this height" " is returned if possible.")) (p "Returns a form that, when presented to sx-call, will fetch information" " about pages in the image namespace.")) (procedure "(prop-langlinks source)" (p "Language links") (dl ,(source)) (p "Returns a form that, when presented to sx-call, will fetch" " language links in pages.")) (procedure "(prop-links source #!key namespace)" (p "Fetch information about links on the pages") (dl ,(source) ,(namespace)) (p "Returns a form that, when presented to sx-call, will fetch" " links in pages.") (p "This procedure may be used as a generator.")) (procedure "(prop-templates source #!key namespace)" (p "Page transclusions") (dl ,(source) ,(namespace)) (p "Returns a form that, when presented to sx-call, will fetch" " inclusions in pages.") (p "This procedure may be used as a generator.")) (procedure "(prop-images source)" (p "Image inclusion.") (dl ,(source)) (p "Returns a form that, when presented to sx-call, will fetch" " images in pages.") (p "This procedure may be used as a generator.")) (procedure "(prop-page-extlinks source)" (p "External links") (dl ,(source)) (p "Returns a form that, when presented to sx-call, will fetch" " external links in pages.")) (procedure "(prop-categoryinfo source)" (p "Categories") (dl ,(source)) (p "Returns a form that, when presented to sx-call, will fetch" " information about categories.")) (procedure "(prop-duplicatefiles source)" (p "Duplicates of a page") (dl ,(source)) (p "Returns a form that, when presented to sx-call, will fetch" " page duplicates."))) (subsection "Lists" (p "Procedures in this section can usually be used as generators for other" " procedures, particularly those in the \"Properties\" section") (procedure "(list-allpages #!key from prefix namespace filterredir filterlanglinks minsize maxsize prtype prlevel dir)" (p "All pages matching the given criteria.") (dl ,(from-prefix) ,(namespace1) ,(filterredir) (dt "filterlanglinks") (dd "Can be \"all\": list all pages irrespective of whether they have" " language links, \"withlanglinks\", list only pages with language" " links, or \"withoutlanglinks\", list only pages without language" " links. The default is \"all\".") (dt "minsize")(dd "List only pages with at least this number of bytes.") (dt "maxsize")(dd "List only pages with at most this number of bytes.") (dt "prtype")(dd "Can be \"edit\", list only edit-protected pages," " \"move\", list only move-protected pages, or" " other values depending on the wiki.") (dt "prlevel")(dd "Can be \"autoconfirmed\", list only pages protected" " from editing by non-autoconfirmed users, \"sysop\"," " list only pages protected from editing by non-sysops," " or empty, listing all pages irrespective of protection" " level. This parameter may have wiki-specific values.") (dt "dir")(dd "Direction in which to list (ascending alphabetic is the default.)")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of pages matching the given criteria.") (p "This procedure may be used as a generator.")) (procedure "(list-alllinks #!key from prefix namespace uniqye prop)" (p "All links in a given namespace.") (dl ,(from-prefix) ,(namespace1) (dt "unique")(dd ,(boolean "links to the same title will be" " listed only once")) (dt "prop")(dd "Which properties to return. May be any combination of" " ids title. Default is title.")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of links in a namespace matching the given criteria.") (p "This procedure may be used as a generator.")) (procedure "(list-allcategories #!key from prefix dir)" (p "All qualifying categories") (dl ,(from-prefix) (dt "dir")(dd "Direction. ascending (default) or descending.")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of categories matching the given criteria.") (p "This procedure may be used as a generator.")) (procedure "(list-allusers #!key from prefix group prop)" (p "All qualifying users") (dl ,(from-prefix) (dt "group")(dd "Only list users in this group") (dt "prop") (dd "User properties we're interested in. This may be a single" " user property, a list of properties, or a string containing" " more than one property, each separated from the next by a \"|\"" " (pipe) character. Available properties are:" " editcount, groups, registration." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#allusers_.2F_au")) "documentation"))) (p "Returns a form that, when presented to sx-call, will fetch" " a list of users matching the given criteria.") (p "This procedure may NOT be used as a generator.")) (procedure "(list-allimages #!key from prefix minsize maxsize dir sha1 sha1base36 prop)" (p "All qualifying images") (dl ,(from-prefix) (dt "minsize")(dd "List only images with at least this many bytes") (dt "maxsize")(dd "List only images with at most this many bytes") (dt "dir")(dd "Direction in which to list: ascending (default) or descending") (dt "sha1")(dd "Only list images with this SHA1 hash") (dt "sha1base36")(dd "Base 36 version of sha1") (dt "prop") (dd "Image properties we're interested in. This may be a single" " image property, a list of properties, or a string containing" " more than one property, each separated from the next by a \"|\"" " (pipe) character. Available properties are:" " timestamp, user, comment, url, size, dimensions, mime, sha1, metadata." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#allimages_.2F_ai")) "documentation"))) (p "Returns a form that, when presented to sx-call, will fetch" " a list of images matching the given criteria.") (p "This procedure may be used as a generator.")) (procedure "(list-backlinks title #!key namespace filterredir redirect)" (p "Pages linking to a page.") (dl ,(title) ,(namespace) (dt "filteredir")(dd "How to filter redirects: \"all\", \"redirects\" or" " \"non-redirects\"") (dt "redirect")(dd ,(boolean "pages linking to the page through a" " redirect will also be listed.") " For more" " detailed information, see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#backlinks_.2F_bl")) "the documentation") ".")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of pages linking to a page.") (p "This procedure may be used as a generator.")) (procedure "(list-blocks #!key start end dir ids users ip prop)" (p "All qualifying blocks.") (dl ,(start-end-dir) (dt "ids")(dd "Only list blocks with these ids") (dt "users")(dd "Only list blocks of these users") (dt "ip")(dd "List all blocks, including range blocks, that apply to this" " IP address. If a range is given only blocks applying to the" " entire range are listed.") (dt "prop") (dd "Block properties we're interested in. This may be a single" " block property, a list of properties, or a string containing" " more than one property, each separated from the next by a \"|\"" " (pipe) character. Available properties are:" " id, user, by, timestamp, expiry, reason, range, flags." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#blocks_.2F_bk")) "documentation"))) (p "Returns a form that, when presented to sx-call, will fetch" " a list of blocks.") (p "This procedure may NOT be used as a generator.")) (procedure "(list-categorymembers title #!key namespace start end startsortkey endsortkey sort dir prop)" (p "Pages in a category") (dl ,(title) ,(namespace) ,(start-end-dir) (dt "startsortkey")(dd "Start listing at this sortkey. Can only be used" "with sort: sortkey") (dt "endsortkey")(dd "Stop listing at this sortkey. Can only be used" "with sort: sortkey") (dt "sort")(dd "Ordering to use. Options are \"sortkey\" and \"timestamp\"") (dt "prop")(dd "Properties to fetch. This may be a single property name" " a list of properties, or a string containing more than" " one property, each separated from the next by a \"|\" (pipe)" " character. Properties may be any combination of:" " \"ids\", \"title\", \"sortkey\", \"timestamp\".")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of pages belonging to the category.") (p "This procedure may be used as a generator.")) (procedure "(list-embeddedin title #!key namespace filterredir)" (p "Pages transcluding a page.") (dl ,(source) ,(namespace) (dt "filterredir")(dd "How to filter redirects (one of the following:" "\"all\", \"redirects\", \"nonredirects\"). Default" " is \"all\".") (dt "expandtemplates")(dd ,(boolean "expand templates")) (dt "section")(dd "Only fetch this section") (dt "token")(dd "Token to fetch for each revision. At present there is only" " \"rollback\"") (dt "prop")(dd "The properties we're interested in. Default: ids") ,(wiki-method) ) (p "Returns a form that, when presented to sx-call, will fetch" " a list of pages that transclue the page.") (p "This procedure may be used as a generator.")) (procedure "(list-exturlusage #!key query protocol namespace prop offset)" (p "Pages linking to a URL") (dl (dt "query")(dd "URL to search for without the protocol. * can be used as a" " wildcard. If you omit query (not just leave it empty), all" " external links will be listed, and protocol will be ignored") (dt "protocol")(dd "Protocol of the URL. By default, the options are" " http (default), https, ftp, irc, gopher, telnet, nntp," " worldwind, mailto, news") ,(namespace) (dt "prop")(dd "Properties to fetch. This may be a single property name" " a list of properties, or a string containing more than" " one property, each separated from the next by a \"|\" (pipe)" " character. Properties may be any combination of:" " \"ids\", \"title\", \"url\".") (dt "offset")(dd "User for continuing a previous request.")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of pages that link to the URL.") (p "This procedure may be used as a generator.")) (procedure "(list-imageusage title #!key namespace filterredir redirect)" (p "Pages including an image.") (dl ,(namespace) (dt "filterredir")(dd "How to filter redirects (one of the following:" "\"all\", \"redirects\", \"nonredirects\"). Default" " is \"all\".") (dt "redirect")(dd ,(boolean "pages linking to the page through a" " redirect will also be listed.") " For more" " detailed information, see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#backlinks_.2F_bl")) "the documentation on backlinks") ".")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of pages that include the image.") (p "This procedure may be used as a generator.")) (procedure "(list-logevents #!key prop type user title start end dir)" (p "Log events") (dl (dt "prop")(dd "Properties to fetch. This may be a single property name" " a list of properties, or a string containing more than" " one property, each separated from the next by a \"|\" (pipe)" " character. Properties may be any combination of:" " ids, title, type, user, timestamp, comment, details." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#logevents_.2F_le")) "the documentation") ".") (dt "type")(dd "Only list log events of this type. One of: " "block, protect, rights, delete, upload, move, import," " patrol, merge, newusers." " Extensions installed on the wiki may add other log event types.") (dt "user")(dd "Only list log entries made by this user") (dt "title")(dd "Only list log entries related to this title") ,(start-end-dir)) (p "Returns a form that, when presented to sx-call, will fetch" " a list of qualifying log events.") (p "This procedure may NOT be used as a generator.")) (procedure "(list-recentchanges #!key start end dir namespace titles user excludeuser type show prop)" (p "Recent changes") (dl ,(start-end-dir) ,(namespace) (dt "titles")(dd "Only list changes related to these titles") (dt "user")(dd "Only list changes made by this user") (dt "excludeuser")(dd "Omit changes made by this user") (dt "type")(dd "Type of change to list. May be one of: edit, new, log.") (dt "show")(dd "Only list items meeting certain criteria. May be any" " sensible combination of:" " minor, !minor, bot, !bot, anon, !anon, redirect, !redirect," " patrolled, !patrolled") (dt "prop")(dd "Which properties we're interested in. This may be a single property" " name a list of properties, or a string containing more than" " one property, each separated from the next by a \"|\" (pipe)" " character. Properties may be any combination of:" " user, comment, timestamp, title, ids, sizes, redirect," " patrolled, loginfo, flags." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#recentchanges_.2F_rc")) "the documentation") ".")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of qualifying recent changes.") (p "This procedure may NOT be used as a generator.")) (procedure "(list-search search #!key what namesace redirects)" (p "Search") (dl (dt "search")(dd "Character string to search for") (dt "what")(dd "What to search in: title (default, falls back to text) or text") (dt "namespace")(dd "Namespace to search in (default is main namespace)") (dt "redirects")(dd ,(boolean "also list redirects"))) (p "Returns a form that, when presented to sx-call, will fetch" " a list of articles that match the search string.") (p "This procedure may be used as a generator.")) (procedure "(list-usercontribs #!key user userprefix start end dir namespace show prop)" (p "User contributions") (dl (dt "user")(dd "List contributions for this user") (dt "userprefix")(dd "List contributions for usernames starting with this prefix" "(useful for getting contributions from IP ranges)") ,(start-end-dir) ,(namespace) (dt "show")(dd "Show only these items. Any sensible combination of the following:" " minor, !minor, patrolled, !patrolled") (dt "prop")(dd "The properties we're interested in. Any combination of the" " following:" " ids, title, timestamp, comment, patrolled, flags." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#usercontribs_.2F_uc")) "the documentation") ".")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of qualifying user contributions") (p "This procedure may NOT be used as a generator.")) (procedure "(list-watchlist #!key start end dir namespace user excludeuser allrev show prop)" (p "Watchlist") (dl ,(start-end-dir) ,(namespace) (dt "user")(dd "Only list changes made by this user") (dt "excludeuser")(dd "Exclude changes made by this user") (dt "allrev")(dd ,(boolean "include multiple revisions to the same" " page.")) (dt "show")(dd "Show only these items. Any sensible combination of:" " minor, !minor, bot, !bot, anon, !anon.") (dt "prop")(dd "The properties we're interested in. Any combination of the" " following:" " user, comment, timestamp, title, ids, sizes, patrol, flags." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#watchlist_.2F_wl")) "the documentation") ".")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of qualifying watchlist entries") (p "This procedure may be used as a generator.")) (procedure "(list-deletedrevs source #!key user excludeuser start end namespace unique from prop)" (p "Deleted revisions") (dl ,(source) (dt "user")(dd "List only edits by this user") (dt "excludeuser")(dd "Exclude edits by this user") ,(start-end) ,(namespace1) (dt "unique")(dd "List only one revision for each page") (dt "from")(dd "Start listing from this title") (dt "prop")(dd "The properties we're interested in. Any combination of the" " following:" " revid, user, comment, minor, len, content, token." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#deletedrevs_.2F_dr")) "the documentation") ".")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of qualifying deleted revisions") (p "This List procedure is unusual in that it can be used with a generator. It may NOT" " be used a generator.")) (procedure "(list-users users #!key token prop)" (p "User information") (dl (dt "users")(dd "A username or a list of usernames, or a string containing" " usernames separated by pipe (\"|\") characters.") (dt "token")(dd "Which token to get. The only valid value is \"userrights\"") (dt "prop")(dd "The properties we're interested in. Any combination of the" " following:" " blockinfo, groups, editcount, registration, emailable." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#users_.2F_us")) "the documentation") ".")) (p "Returns a form that, when presented to sx-call, will fetch" " information about a list of users.") (p "This procedure may NOT be used as a generator.")) (procedure "(list-random #!key limit namespace redirect)" (p "Random pages") (dl (dt "limit")(dd "The number of random pages to return") (dt "namespace")(dd "The namespace to look in") (dt "redirect")(dd ,(boolean "list only redirects. By default," " only non-redirects are listed"))) (p "Returns a form that, when presented to sx-call, will fetch" " a list of random articles. The selection of the first article is random," " but those that follow will be in a predetermined sequence depending on the" " first.")) (procedure "(list-protectedtitles #!key start end dir namespace level prop)" (p "Protected titles") (dl ,(start-end-dir) ,(namespace) (dt "level")(dd "Only list pages at this protection level") (dt "prop")(dd "The properties we're interested in. Any combination of the" " following:" " timestamp, user, comment, expiry, level." " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Lists" "#protectedtitles_.2F_pt")) "the documentation") ".")) (p "Returns a form that, when presented to sx-call, will fetch" " a list of qualifying titles protected from creation."))) (subsection "Meta" (p "Procedures in this section provide general information") (procedure "(meta-siteinfo #!key prop filteriw showalldb)" (p "Site information") (dl (dt "prop")(dd "The properties we're interested in. Any combination of the" " following:" " general, namespaces, namespacealiases, specialpagealiases," " magicwords, statistics, interwikimap, dbrepllag, usergroups," " extensions, fileextensions, rightsinfo" " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Meta" "#siteinfo_.2F_si")) "the documentation") ".") (dt "filteriw")(dd "Criteria to filter the interwiki map by. May be one of:" " local (only list local interwiki prefixes), !local" " (only list non-local interwiki prefixes.)") (dt "showalldb")(dd ,(boolean "show information about all DB servers" " (ignored if prop doesn't contain dbrepllag)"))) (p "Returns a form that, when presented to sx-call, will fetch" " information about the site.")) (procedure "(meta-userinfo #!key prop)" (p "User information") (dl (dt "prop")(dd "The properties we're interested in. Any combination of the" " following:" " blockinfo, hasmsg, groups, rights, changeablegroups," " options, editcount, ratelimits, email. " " Default: see " (a (@ (href "http://www.mediawiki.org/wiki/API:Query_-_Meta" "#userinfo_.2F_ui")) "the documentation") ".")) (p "Returns a form that, when presented to sx-call, will fetch" " information about the currently logged-in user.")) (procedure "(meta-allmessages #!key messages filter lang)" (p "Messages") (dl (dt "messages")(dd "only list these messages") (dt "filter")(dd "only list messages containing this string") (dt "lang")(dd "translate messages to this language")) (p "Returns a form that, when presented to sx-call, will fetch" " the selected messages"))) ) (section "Editing module" (p "(require-extension mw-edit)") (p "These procedures perform logins, logouts, edits and watchlist management") (subsection "Logins" (p "These procedures perform logins and logouts.") (procedure "(login credentials #!key wiki)" (p "Logs the user in to the wiki") (dl (dt "credentials") (dd "A procedure that expects to be given the URL of the wiki and returns" " two values: the username and password for that wiki") ,(wiki) ) (p "A login is attempted. If it fails an appropriate error is thrown. The login" " API command requires the POST method, so the default-method parameter is ignored.")) (procedure "(logout #!key wiki)" (p "Logs the user out of the wiki.") (dl ,(wiki) ) (p "The user's login cookies will be cleared. If the wiki argument is omitted," " the user's login cookies for the default wiki will be cleared.")) ) (subsection "Editing" (p "These procedures alter the content of the wiki") (procedure "(edit title #!key section text appendtext prependtext summary minor notminor bot recreate createonly nocreate watchlist md5 captchaid captchaword undo undoafter wiki)" (p "General editing procedure") (dl (dt "title") (dd "The title of the page to edit") (dt "section") (dd "The section") (dt "text")(dd "Text to replace the text on the page or section") (dt "appendtext")(dd "Text to append to the text on the page or section") (dt "prependtext")(dd "Text to prepend to (place in front of) the text on" " the page or section") (dt "summary") (dd "The summary message for the edit. If section parameter is" " \"new\" then this will be the section title") (dt "minor") (dd ,(boolean "force minor edit tag ignoring user" " preferences")) (dt "notminor") (dd ,(boolean "disable minor edit tag ignoring user" " preferences")) (dt "bot")(dd ,(boolean "place bot tag. Needed if your user has bot" " privileges")) (dt "recreate")(dd ,(boolean "force page recreation if it's been" " deleted")) (dt "createonly")(dd ,(boolean "signal error if page already exists")) (dt "nocreate")(dd ,(boolean "signal error if page doesn't exist")) (dt "watchlist")(dd "Specify treatment of watchlist (watch, unwatch, preferences" " or nochange)") (dt "md5")(dd "md5 hash for content") (dt "captchaid")(dd "id of a previous captcha challenge") (dd "captchaword")(dd "response to the captcha challenge identified by captchaid") (dd "undo")(dd "Revision id to undo") (dd "undoafter")(dd "Undo all revisions from undo up to but not including this" " one. If not set, just undo one revision") ,(wiki) ) (p "The page is edited. The edit API command requires the POST method, so the" " default-method parameter is ignored. This involves two API calls: the first" " to get a token, the second to perform the edit. All other editing procedures" " in this module--all procedures capable of altering the content of the wiki" "--use this procedure.")) (procedure "(append-section title subject text #!key minor notminor bot recreate createonly nocreate watchlist md5 captchaid captchaword undo undoafter wiki)" (p "Adds a section to the end of a page") (dl (dt "title") (dd "The title of the page to edit") (dt "subject") (dd "The subject heading") (dt "text")(dd "Text of the new section") (dt "minor") (dd ,(boolean "force minor edit tag ignoring user" " preferences")) (dt "notminor") (dd ,(boolean "disable minor edit tag ignoring user" " preferences")) (dt "bot")(dd ,(boolean "place bot tag. Needed if your user has bot" " privileges")) (dt "recreate")(dd ,(boolean "force page recreation if it's been" " deleted")) (dt "createonly")(dd ,(boolean "signal error if page already exists")) (dt "nocreate")(dd ,(boolean "signal error if page doesn't exist")) (dt "watchlist")(dd "Specify treatment of watchlist (watch, unwatch, preferences" " or nochange)") (dt "md5")(dd "md5 hash for content") (dt "captchaid")(dd "id of a previous captcha challenge") (dd "captchaword")(dd "response to the captcha challenge identified by captchaid") ,(wiki) ) (p "The section is added to the page. The edit API command requires the POST method," " so the default-method parameter is ignored. This procedure is most useful for" " adding a comment to a talk page. If making a comment on a talk page or any other" " page intended for discussion, remember to append \"~~~~\" to the text" " to make the wiki append a timestamped signature.")) (procedure "(remove-section title section summary #!key minor notminor bot watchlist md5 captchaid captchaword undo undoafter wiki)" (p "Removes a section from the page") (dl (dt "title") (dd "The title of the page to edit") (dt "section") (dd "The section number. Removing section 0 will blank the entire" " page.") (dt "summary")(dd "A summary of the edit") (dt "minor") (dd ,(boolean "force minor edit tag ignoring user" " preferences")) (dt "notminor") (dd ,(boolean "disable minor edit tag ignoring user" " preferences")) (dt "bot")(dd ,(boolean "place bot tag. Needed if your user has bot" " privileges")) (dt "watchlist")(dd "Specify treatment of watchlist (watch, unwatch, preferences" " or nochange)") (dt "md5")(dd "md5 hash for content") (dt "captchaid")(dd "id of a previous captcha challenge") (dd "captchaword")(dd "response to the captcha challenge identified by captchaid") ,(wiki) ) (p "The section is removed from the page. Removing an entire section is a drastic" " action to take so use this sparingly. Specifying section 0 will remove the" " entire contents of the page, replacing it with a blank page." " The edit API command requires the POST method," " so the default-method parameter is ignored.")) ) (subsection "Watchlist" (p "These procedures control the watchlist.") (procedure "(watch page #!key wiki method)" (p "Adds a page to the watchlist of the logged-in user") (dl (dt "page") (dd "The page to add") ,(wiki-method) ) (p "Adds the page to the user's watchlist")) (procedure "(unwatch page #!key wiki method)" (p "Removes a page from the watchlist of the logged-in user") (dl (dt "page") (dd "The page to remove") ,(wiki-method) ) (p "Removes the page from the user's watchlist")) ) (subsection "Email" (p "The send-email procedure sends email to editors.") (procedure "(send-email user subject text #!key ccme wiki)" (p "Send an email to a user.") (dl (dt "user")(dd "The username of the intended recipient") (dt "subject")(dd "The subject of the email") (dt "text")(dd "The text of the email") (dt "ccme")(dd ,(boolean "the email will be copied to the sender.")) ,(wiki) ) (p "You have to be logged in, and the wiki has to permit emails, and the" " intended recipient has to have a validated email address and to permit" " emails. This procedure attempts to obtain an email token, and this" " will be refused if any of the above conditions aren't satisfied, in which" " case this procedure will return the value #f. If it obtains the token," " an attempt is made to send the email, and the result returned can" " be inspected using sxpath.")) ) ) (section "Formatting module" (p "(require-extension mw-format)") (p "These procedures perform basic MediaWiki formatting.") (procedure "(wiki-list c)" (p "Formats a list for the wiki.") (dl (dt "c")(dd "A vector or proper list containing items to be formatted")) (p "A string containing the formatted wikitext is returned") (p "This only handles lists of scalar values, and cannot format nested list" " structures.")) (procedure "(wiki-list->list lines)" (p "Extracts text values from a wiki list.") (dl (dt "lines") (dd "a proper list containing a formatted wikitext list")) (p "A list of strings is returned.")) (procedure "(wiki-list->vector lines)" (p "Extracts text values from a wiki list.") (dl (dt "lines") (dd "a proper list containing a formatted wikitext list")) (p "A vector of strings is returned.")) (procedure "(page->user-list wiki-text)" (p "Extracts a list of usernames from a wikitext list.") (dl (dt "wiki-text") (dd "A string containing a list")) (p "Removes any html comments, removes any lines preceding the list," " and extracts the usernames from resulting lines in the form" " \"User:XXX\". A lisp proper list is returned.")) (procedure "(wiki-clean wiki-content)" (p "Removes html comments from wiki-text.") (dl (dt "wiki-content") (dd "String containing the wikitext")) (p "Returns a string containing the cleaned up wikitext.")) (procedure "(remove-list-preamble wiki-lines)" (p "Removes lines that don't contain elements of a wiki-list. Used to remove" " the preamble or introductory text from the list.") (dl (dt "wiki-lines")(dd "List of lines")) (p "Returns the list of lines with the preamble removed.")) (procedure "(wiki-heading level title)" (p "Formats a wiki section heading.") (dl (dt "level")(dd "Level number of the heading") (dt "title")(dd "Title text for the heading")) (p "Returns the formatted heading.")) (procedure "(write-wiki-page page content edit-summary)" (p "Writes a wiki page as a simple s-expression.") (dl (dt "page")(dd "Page name") (dt "content")(dd "The content of the page") (dt "edit-summary")(dd "A descriptive summary")) (p "The return value is unspecified. This procedure is intended" " for debugging.")) (procedure "(canonical-page-name pagename)" (p "Converts a pagename to the canonical MediaWiki form.") (dl (dt "pagename") (dd "String containing the pagename to be converted")) (p "Returns a string containing the pagename with underscores replaced by spaces.")) (procedure "(canonical-username username)" (p "An alias for canonical-page-name")) (procedure "(userspace-owner pagename)" (p "Derive the owner of a page in user or user talk namespace.") (dl (dt "pagename") (dd "String containing pagename in user or user talk namespace")) (p "Returns a string containning the username component of the pagename.")) (procedure "(wiki-unlink link)" (p "Derive the target at which a wiki-link points.") (dl (dt "link")(dd "A formatted wiki-link")) (p "Extracts the name of the wiki page to which a wiki-link" " will direct the brower if the link is clicked. A string is returned.")) (procedure "(wiki-link line . opt)" (p "Format a wiki-link to a target, with an optional piped name") (dl (dt "link") (dd "String containing the name of the target page") (dt "opt") (dd "If given, text to be shown instead of the name of the target")) (p "A string containing the formatted wiki-link is returned.")) (procedure "(wiki-external link . opt)" (p "Format an external link to a target URL, with an optional piped name.") (dl (dt "link") (dd "The URL of the external target") (dt "opt") (dd "If given, text to be shown instead of the bracketed number" " that is shown by default for external links")) (p "A string containing the formatted external link is returned.")) (procedure "(wiki-category name . opt)" (p "Format a category link with an optional piped sort.") (dl (dt "link") (dd "The name of the category") (dt "opt") (dd "If given, text to be used for sorting in category" " displays, instead of using the default ordering.")) (p "Returns a string containing the formatted category reference.")) (procedure "(interwiki iwiki name)" (p "Format an interwiki link.") (dl (dt "iwiki")(dd "The interwiki signifier (eg: \"fr\" for French Wikipedia)") (dt "name")(dd "The target pagename on the target wiki")) (p "A string containing the formatted interwiki link is returned.")) (procedure "(wiki-bold text)" (p "Format bold wikitext") (dl (dt "text")(dd "String containing the text to be made bold")) (p "A string containing the formatted wikitext is returned")) (procedure "(wiki-italics text)" (p "Format italicized wikitext.") (dl (dt "text")(dd "String containing the text to be italicized")) (p "A string containing the formatted wikitext is returned.")) (procedure "(wiki-username wiki-content)" (p "Extract a username from wiki content.") (dl (dt "wiki-content")(dd "String containing the content to be analyzed")) (p "Returns a string containing the username.")) (procedure "(wiki-section-list wikitext)" (p "Takes the content of a wiki page and returns a list of section headers.") (dl (dt "wikitext")(dd "Wiki text including section headers")) (p "Splits the text into lines and returns a list of those lines that start" " with an \"=\" sign and end with an \"=\" sign possibly followed by" " whitespace.") (p "NOTE: the section header at list-ref position N in the list for a given" " wiki page will correspond to section number N+1 as understood by the" " MediaWiki API. Section number 0 is used by the API to refer to the entire" " page.")) ) (section "License" (pre ,license)))))) (eggdoc->html doc)