Skip to content

Commit

Permalink
migrate from sphinx to mkdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
fastily committed Dec 1, 2023
1 parent 3236e8c commit 7ad365d
Show file tree
Hide file tree
Showing 20 changed files with 105 additions and 282 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ build
dist
*.egg-info

# Docs
site/

# virtualenv
venv_pwiki

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,14 @@ pwiki is a Python library for effortlessly interacting with Wikipedia/MediaWiki
pip install pwiki
```

## Build docs
```bash
# make sure doc requirements are installed
pip install -r requirements-docs.txt

# build docs
mkdocs build
```

## Resources
* [API Docs](https://fastily.github.io/pwiki/)
3 changes: 0 additions & 3 deletions build_docs.sh

This file was deleted.

20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

2 changes: 2 additions & 0 deletions docs/dwrap-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# dwrap
::: pwiki.dwrap
42 changes: 42 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Examples
⚠️ This section is under construction

## Basics
```python
from pwiki.wiki import Wiki

# new Wiki instance, pointed to en.wikipedia.org, not logged in
wiki = Wiki()

# new Wiki instance, pointed at commons.wikimedia.org, logging in with user/pass
wiki = Wiki("commons.wikimedia.org", "MyCoolUsername", "MySuperSecretPassword")
```

## Read Page Content
```python
from pwiki.wiki import Wiki

wiki = Wiki()

# print all the titles in "Category:American 3D films"
for title in wiki.category_members("Category:American 3D films"):
print(title)

# print all external links on the page "GitHub"
for url in wiki.external_links("GitHub"):
print(url)
```

## Edit/Create Page Content
```python
from pwiki.wiki import Wiki

# you'll need to create a real account on Wikipedia otherwise the snippets below won't work
wiki = Wiki(username="MyCoolUsername", password="MySuperSecretPassword")

# Append "this is a test" to "Wikipedia:Sandbox"
wiki.edit("Wikipedia:Sandbox", append="this is a test")

# Replace "Wikipedia:Sandbox" with "I changed the page!" and edit summary "Hello, world!"
wiki.edit("Wikipedia:Sandbox", "I changed the page!", "Hello, world!")
```
2 changes: 2 additions & 0 deletions docs/gquery-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# gquery
::: pwiki.gquery
11 changes: 11 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Welcome to pwiki's docs

**pwiki** is a Python library which makes interacting with the MediaWiki API simple and easy. It can be used with sites such as Wikipedia, or virtually any other website that runs on MediaWiki.

## Installation

Install with `pip`

```bash
pip install pwiki
```
35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

2 changes: 2 additions & 0 deletions docs/mquery-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# mquery
::: pwiki.mquery
2 changes: 2 additions & 0 deletions docs/ns-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ns
::: pwiki.ns
2 changes: 2 additions & 0 deletions docs/oquery-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# oquery
::: pwiki.oquery
68 changes: 0 additions & 68 deletions docs/source/conf.py

This file was deleted.

55 changes: 0 additions & 55 deletions docs/source/examples.rst

This file was deleted.

36 changes: 0 additions & 36 deletions docs/source/index.rst

This file was deleted.

64 changes: 0 additions & 64 deletions docs/source/reference.rst

This file was deleted.

2 changes: 2 additions & 0 deletions docs/wiki-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# wiki
::: pwiki.wiki
2 changes: 2 additions & 0 deletions docs/wparser-reference copy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# wparser
::: pwiki.wparser
Loading

0 comments on commit 7ad365d

Please sign in to comment.