소스 검색

Really minor documentation fixes.

tags/v0.4
Ben Kurtovic 10 년 전
부모
커밋
51df09ccf0
2개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. +4
    -2
      README.rst
  2. +4
    -2
      docs/integration.rst

+ 4
- 2
README.rst 파일 보기

@@ -123,19 +123,21 @@ If you're using Pywikipedia_, your code might look like this::

import mwparserfromhell
import wikipedia as pywikibot

def parse(title):
site = pywikibot.getSite()
page = pywikibot.Page(site, title)
text = page.get()
return mwparserfromhell.parse(text)

If you're not using a library, you can parse templates in any page using the
following code (via the API_)::
If you're not using a library, you can parse any page using the following code
(via the API_)::

import json
import urllib
import mwparserfromhell
API_URL = "http://en.wikipedia.org/w/api.php"

def parse(title):
data = {"action": "query", "prop": "revisions", "rvlimit": 1,
"rvprop": "content", "format": "json", "titles": title}


+ 4
- 2
docs/integration.rst 파일 보기

@@ -11,19 +11,21 @@ If you're using Pywikipedia_, your code might look like this::

import mwparserfromhell
import wikipedia as pywikibot

def parse(title):
site = pywikibot.getSite()
page = pywikibot.Page(site, title)
text = page.get()
return mwparserfromhell.parse(text)

If you're not using a library, you can parse templates in any page using the
following code (via the API_)::
If you're not using a library, you can parse any page using the following code
(via the API_)::

import json
import urllib
import mwparserfromhell
API_URL = "http://en.wikipedia.org/w/api.php"

def parse(title):
raw = urllib.urlopen(API_URL, data).read()
res = json.loads(raw)


불러오는 중...
취소
저장