-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01ae6ac
commit e5342ce
Showing
23 changed files
with
1,132 additions
and
666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ replit.nix | |
.config/ | ||
venv/ | ||
*.sh | ||
docs/build | ||
site/ | ||
dist/ | ||
.vscode/ | ||
/*.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: "2" | ||
|
||
build: | ||
os: "ubuntu-22.04" | ||
tools: | ||
python: "3.11" | ||
|
||
python: | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs | ||
|
||
mkdocs: | ||
configuration: mkdocs.yml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Event reference | ||
|
||
::: sechat.events.EventType | ||
options: | ||
show_root_heading: true | ||
show_root_toc_entry: true | ||
|
||
::: sechat.events | ||
options: | ||
filters: | ||
- "!EventType" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# API reference | ||
|
||
::: sechat | ||
|
||
## Errors | ||
|
||
::: sechat.errors |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# About | ||
|
||
**sechat** (usually referred to in monospace to distinguish it from the platform it's designed for, e.g. `sechat`) is an asynchronous Python client for the [Stack Exchange](https://stackexchange.net) Q&A website network's [custom-built chat service](https://chat.stackexchange.com), variously referred to as "Stack Exchange chat", "SEchat", and "Bonfire". It is designed for creating automated chatbots to assist with moderation and other rote tasks. | ||
|
||
!!! warning | ||
**`sechat` is by nature unstable**, as Stack Exchange chat has no public API and no guarantee of consistency, and the library may need to be updated at any time to accomodate for changes to chat's internals. No part of its API should be assumed to be stable between any two commits. | ||
|
||
## Installation | ||
!!! warning | ||
The copy of `sechat` on PyPI is no longer updated due to `sechat`'s always-unstable nature. Do not use it; instead, install directly from GitHub. | ||
|
||
|
||
To install `sechat`, use your module manager's system for installing from Git repositories. `sechat` is available on GitHub at [https://github.com/gingershaped/sechat], and the `v3` branch should be used. | ||
|
||
## Example | ||
```py | ||
import asyncio | ||
|
||
from sechat import Credentials, Room | ||
|
||
async def main(): | ||
credentials = await Credentials.load_or_authenticate("credentials.dat", "<your email address>", "<your password>") | ||
async with Room.join(credentials, 1) as room: | ||
await room.send("Hello World!") | ||
|
||
asyncio.run(main()) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
document.addEventListener("DOMContentLoaded", function (event) { | ||
// Trigger Read the Docs' search addon instead of Material MkDocs default | ||
document.querySelector(".md-search__input").addEventListener("focus", (e) => { | ||
const event = new CustomEvent("readthedocs-search-show"); | ||
document.dispatchEvent(event); | ||
}); | ||
}); | ||
|
||
// Use CustomEvent to generate the version selector | ||
document.addEventListener( | ||
"readthedocs-addons-data-ready", | ||
function (event) { | ||
const config = event.detail.data(); | ||
const versioning = ` | ||
<div class="md-version"> | ||
<button class="md-version__current" aria-label="Select version"> | ||
${config.versions.current.slug} | ||
</button> | ||
<ul class="md-version__list"> | ||
${ config.versions.active.map( | ||
(version) => ` | ||
<li class="md-version__item"> | ||
<a href="${ version.urls.documentation }" class="md-version__link"> | ||
${ version.slug } | ||
</a> | ||
</li>`).join("\n")} | ||
</ul> | ||
</div>`; | ||
|
||
document.querySelector(".md-header__topic").insertAdjacentHTML("beforeend", versioning); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block site_meta %} | ||
{{ super() }} | ||
<meta name="readthedocs-addons-api-version" content="1" /> | ||
{% endblock %} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
:root { | ||
/* Reduce Read the Docs' flyout font a little bit */ | ||
--readthedocs-flyout-font-size: 0.7rem; | ||
|
||
/* Reduce Read the Docs' notification font a little bit */ | ||
--readthedocs-notification-font-size: 0.8rem; | ||
|
||
/* This customization is not yet perfect because we can't change the `line-height` yet. */ | ||
/* See https://github.com/readthedocs/addons/issues/197 */ | ||
--readthedocs-search-font-size: 0.7rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
site_name: sechat | ||
site_url: !ENV READTHEDOCS_CANONICAL_URL | ||
repo_url: https://github.com/gingershaped/sechat | ||
|
||
theme: | ||
name: material | ||
palette: | ||
scheme: slate | ||
|
||
plugins: | ||
- search | ||
- mkdocstrings: | ||
handlers: | ||
python: | ||
import: | ||
- https://docs.python.org/3/objects.inv | ||
- https://typing.readthedocs.io/en/latest/objects.inv | ||
- https://docs.aiohttp.org/en/stable/objects.inv | ||
options: | ||
show_source: false | ||
separate_signature: true | ||
show_signature_annotations: true | ||
signature_crossrefs: true | ||
show_symbol_type_heading: true | ||
show_symbol_type_toc: true | ||
show_root_toc_entry: false | ||
show_root_members_full_path: true | ||
heading_level: 3 | ||
|
||
markdown_extensions: | ||
- admonition | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
- pymdownx.superfences | ||
|
||
extra_javascript: | ||
- javascript/readthedocs.js |
Oops, something went wrong.