Skip to content

Commit

Permalink
readthedocs integration. Fine tuning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalmat committed Apr 24, 2024
1 parent 36c1052 commit adcc6fd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 35 deletions.
28 changes: 17 additions & 11 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,25 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import re
import time

project = 'PyWinCtl'
copyright = '2024, Kalmat'
year = time.strftime("%Y")
author = 'Kalmat'
release = '0.4'
copyright = year + ", " + author
release = "latest"
with open("../../src/pywinctl/__init__.py", "r") as fileObj:
match = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fileObj.read(), re.MULTILINE
)
if match:
release = match.group(1)

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ["myst_parser"]

myst_enable_extensions = ["colon_fence"]

source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
Expand All @@ -26,23 +33,22 @@
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'
# https://www.sphinx-doc.org/en/master/usage/theming.html
html_theme = 'bizstyle'
html_static_path = ['_static']
myst_heading_anchors = 7

# -- Copy the modules documentation ------------------------------------------
# https://stackoverflow.com/questions/66495200/is-it-possible-to-include-external-rst-files-in-my-documentation
from urllib.request import urlretrieve

urlretrieve (
urlretrieve(
"https://raw.githubusercontent.com/kalmat/pywinctl/master/README.md",
"README.md"
"index.md"
)
urlretrieve (
urlretrieve(
"https://raw.githubusercontent.com/kalmat/pywinctl/master/docstrings.md",
"docstrings.md"
)
16 changes: 0 additions & 16 deletions docs/source/index.rst

This file was deleted.

16 changes: 8 additions & 8 deletions docstrings.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Window object or None
#### getActiveWindowTitle

```python
def getActiveWindowTitle()
def getActiveWindowTitle() -> str
```

Get the title of the currently active (focused) Window
Expand All @@ -42,7 +42,7 @@ window title as string or empty
#### getAllWindows

```python
def getAllWindows()
def getAllWindows() -> List[Window]
```

Get the list of Window objects for all visible windows in default root
Expand Down Expand Up @@ -135,7 +135,7 @@ list of names as strings
```python
def getAppsWithName(name: Union[str, re.Pattern[str]],
condition: int = Re.IS,
flags: int = 0)
flags: int = 0) -> List[str]
```

Get the list of app names which match the given string using the given condition and flags.
Expand Down Expand Up @@ -171,14 +171,14 @@ list of app names
#### getAllAppsWindowsTitles

```python
def getAllAppsWindowsTitles()
def getAllAppsWindowsTitles() -> dict
```

Get all visible apps names and their open windows titles

Format:
Key: app name


Key: app name
Values: list of window titles as strings

**Returns**:
Expand All @@ -190,7 +190,7 @@ python dictionary
#### getWindowsAt

```python
def getWindowsAt(x: int, y: int)
def getWindowsAt(x: int, y: int) -> Optional[List[Window]]
```

Get the list of Window objects whose windows contain the point ``(x, y)`` on screen
Expand All @@ -209,7 +209,7 @@ list of Window objects
#### getTopWindowAt

```python
def getTopWindowAt(x: int, y: int)
def getTopWindowAt(x: int, y: int) -> Optional[Window]
```

Get the Window object at the top of the stack at the point ``(x, y)`` on screen
Expand Down

0 comments on commit adcc6fd

Please sign in to comment.