Think of mwdoc as a tool that allows to easily version mediawiki pages.
For example, pages like:
Documentation/0.2/mypage
Template:Documentation/0.2/mytemplate
... could be automatically created from:
Documentation/0.1/mypage
Template:Documentation/0.1/mytemplate
- Create pages:
import mwdoc
doc = mwdoc.Documentation('somewhere.org', '/wiki/')
doc.login('john', 'password')
doc.createPage('0.1', 'mypage', 'This is content of my page', 'Documentation')
doc.createPage('0.1', 'mytemplate', 'This is content of my template', 'Template:Documentation')
- Version pages from 0.1 to 0.2:
import mwdoc
doc = mwdoc.Documentation('somewhere.org', '/wiki/')
doc.login('john', 'password')
doc.versionPages('0.1', '0.2', ['Documentation', 'Template:Documentation'])
- List pages:
import mwdoc
doc = mwdoc.Documentation('somewhere.org', '/wiki/')
doc.login('john', 'password')
pages = doc.listPages('Documentation')
for page in pages: print page
templatepages = doc.listPages('Template:Documentation')
for page in templatepages: print page
- Delete pages:
import mwdoc
doc = mwdoc.Documentation('somewhere.org', '/wiki/')
doc.login('john', 'password')
pages = doc.listPages('Documentation')
for page in pages:
page.delete()
- mwclient, the client to MediaWiki API
sudo easy_install http://pypi.python.org/packages/2.6/m/mwclient/mwclient-0.6.5-py2.6.egg
wget https://raw.github.com/jcfr/mwdoc/master/mwdoc.py
- Download mwdoc_test.py (
wget https://raw.github.com/jcfr/mwdoc/master/mwdoc_test.py
) - Place it along side with
mwdoc.py
- Edit host, path, username and password in mwdoc_test.py
- Run mwdoc.py (
$ python mwdoc.py
)
Once you've made your great commits:
- Fork mwdoc
- Create a topic branch -
git checkout -b my_branch
- Push to your branch -
git push origin my_branch
- Create an Issue with a link to your branch
- That's it!
- Code:
git clone git://github.com/jcfr/mwdoc.git
- Home: http://jcfr.github.com
- Bugs: http://github.com/jcfr/mwdoc/issues
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.