Skip to content

Commit

Permalink
Update README.md. Migrate the documentation to Mkdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
arichr committed Mar 1, 2024
1 parent be73bcb commit f2e191b
Show file tree
Hide file tree
Showing 13 changed files with 505 additions and 274 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dist/
venv/

# Build artifacts
site/
build/

# Text editors, IDEs
Expand Down
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,53 @@
# Gophient
[![repo style: chr](https://img.shields.io/badge/repo%20style-chr-blueviolet?logo=github&style=flat)](https://github.com/arichr/python-template)
[![PyPI](https://img.shields.io/pypi/v/gophient?style=flat&logo=python&logoColor=white)](https://pypi.org/project/gophient/)
[![Maintainability](https://api.codeclimate.com/v1/badges/d83cf869ea9fa8d05a6f/maintainability)](https://codeclimate.com/github/arichr/gophient/maintainability)

Gophient is client library for the Gopherspace. It doesn't require any dependencies and is easy to use.
<p align="center">
<h1 align="center">Gophient</h1>
<p align="center">
<a href="https://pypi.org/project/gophient/"><img alt="PyPI" src="https://img.shields.io/pypi/v/gophient?style=flat&logo=python&logoColor=white"></a>
<a href="https://codeclimate.com/github/arichr/gophient/maintainability"><img alt="Maintainability" src="https://api.codeclimate.com/v1/badges/d83cf869ea9fa8d05a6f/maintainability"></a>
</p>
<p align="center">Python library to browse the Gopherspace</p>
<p align="center">
<a href="https://arichr.github.io/gophient/"><img alt="Read documentation" src="https://img.shields.io/badge/read-documentation-green?style=for-the-badge&logo=python&logoColor=white"></a>
</p>
</p>

**Features:**

* Browse the Gopherspace
* Follow links
* Download content
* Light
* Easy to use
* Comes without dependencies

## Getting started

[![Read documentation](https://img.shields.io/badge/read-documentation-green?style=for-the-badge&logo=python&logoColor=white)](https://arichr.github.io/gophient/)
1. Install Gophient:
```console
pip install gophient
```
2. Create a `gophient.Gopher` instance and make requests ([see examples below](#examples))

## Examples

### Get weather from Floodgap

```python
import gophient

client = gophient.Gopher()
weather = client.request('gopher.floodgap.com', 'groundhog/ws')
print(weather)
```
### Search by Veronica

### Search on Veronica

```python
import gophient

client = gophient.Gopher()
results = client.request('gopher.floodgap.com', 'v2/vs', query='plan 9')
print(results)
```

### Download files

```python
import gophient

Expand Down
15 changes: 15 additions & 0 deletions docs/1_-_Installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
You can use Poetry to install Gophient into your current environment:

```console
$ poetry add gophient
```

Alternatively, you can still use Pip:

```console
$ pip install gophient
```

## Unstable versions

Python wheels are built on every successful commit on `main` or `dev`. You can find artifacts [here](https://github.com/arichr/gophient/actions/workflows/python.yml?query=is%3Asuccess+event%3Apush).
11 changes: 11 additions & 0 deletions docs/2_-_Getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
To start using `gophient` import it and create a `gophient.Gopher` instance:

```python
import gophient

client = gophient.Gopher()
```

> TODO:
For a full definition of the API see the [API reference documentation](api.md).
1 change: 1 addition & 0 deletions docs/README.md
5 changes: 5 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
::: gophient
options:
members:
- types
- exc
48 changes: 48 additions & 0 deletions docs/css/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
code.doc-symbol-parameter::after {
content: "P";
}

code.doc-symbol-attribute::after {
content: "A";
}

code.doc-symbol-function::after {
content: "F";
}

code.doc-symbol-method::after {
content: "M";
}

code.doc-symbol-class::after {
content: "C";
}

code.doc-symbol-module::after {
content: "M";
}

div.doc-contents:not(.first) {
padding-left: 25px;
border-left: .05rem solid var(--md-typeset-table-color);
}

a.external::after,
a.autorefs-external::after {
/* https://primer.style/octicons/arrow-up-right-24 */
mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
content: ' ';

display: inline-block;
vertical-align: middle;
position: relative;

height: 1em;
width: 1em;
background-color: var(--md-typeset-a-color);
}

a.external:hover::after,
a.autorefs-external:hover::after {
background-color: var(--md-accent-fg-color);
}
11 changes: 0 additions & 11 deletions docs/quick_start/1_-_Installation.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/quick_start/2_-_API.md

This file was deleted.

76 changes: 76 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
site_name: Gophient
site_url: https://arichr.github.io/gophient/
repo_name: arichr/gophient
repo_url: https://github.com/arichr/gophient
edit_uri: blob/dev/docs/
site_description: Python library to browse the Gopherspace
site_author: Arisu Wonderland <[email protected]>
copyright: Copyright &copy; 2021-2024 Arisu Wonderland
nav:
- Home: README.md
- Installation: 1_-_Installation.md
- Getting started: 2_-_Getting_started.md
- API Reference: api.md # TODO:
theme:
name: material
font: false
icon:
repo: fontawesome/brands/github-alt
palette:
scheme: slate
primary: green
accent: orange
features:
- navigation.sections
- navigation.path
- navigation.prune
- toc.integrate
- navigation.indexes
- search.suggest
- search.highlight
- content.tabs.link
- content.action.edit
- content.code.copy
- content.code.annotate
extra_css:
- css/extra.css
use_directory_urls: true
plugins:
- search
- offline
- autorefs
- git-authors
- mkdocstrings:
handlers:
python:
options:
group_by_category: true
show_category_heading: false
show_symbol_type_heading: true
show_symbol_type_toc: true
show_submodules: true
merge_init_into_class: true
show_if_no_docstring: true
line_length: 80
separate_signature: true
signature_crossrefs: true
markdown_extensions:
- abbr
- footnotes
- tables
- pymdownx.inlinehilite
- pymdownx.superfences
- pymdownx.magiclink
- pymdownx.keys
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.details
- pymdownx.tabbed:
alternate_style: true
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
Loading

0 comments on commit f2e191b

Please sign in to comment.