Skip to content

Commit

Permalink
Init docs site (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
bleudev authored Jun 8, 2024
2 parents d2b4564 + b890635 commit eec20cc
Show file tree
Hide file tree
Showing 11 changed files with 201 additions and 45 deletions.
20 changes: 20 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"

mkdocs:
configuration: mkdocs.yml

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
8 changes: 8 additions & 0 deletions docs/generators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Generators

tags:
- useful feature
---

# Generators
68 changes: 68 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Getting started

tags:
- information
---

# `ufpy` package

## Introduction

Ufpy (Useful Python) - is a package for simplifying Python programs using many useful features.

Now Ufpy has these features:

- [`UDict`](useful_classes/udict.md "Useful dict.").
- [`UStack`](useful_classes/ustack.md "Useful stack.").
- Generators of classes methods:
- [`cmp_generator`](generators.md "Compare generator. In latest python version were deleted __cmp__ method. With this generator you can use __cmp__ in your class")
- [`r_generator`](generators.md "Reverse generator. Generating __r...__ methods for math operations")
- [`i_generator`](generators.md "I methods generator. Generating __i...__ method for math operations")
- [many protocols for type hinting.](type_checking/protocols.md)
- [many type alias for type hinting.](type_checking/type_alias.md)

## Installing

To install `ufpy`, you need `python 3.12+` and `pip`.
After installing, use this command in your `cmd`/`bash` terminal:

=== "You have one python version"
```shell
pip install ufpy
# or
python -m pip install ufpy
# or
py -m pip install ufpy
```

=== "Several versions"
```shell
python -3.12 -m pip install ufpy
# or
py -3.12 -m pip install ufpy
```

## Importing and writing some code

After installing, you can use `ufpy` package in all your projects with `3.12+` python version.
Just import `ufpy` or import certain classes, functions and variables.

```python
import ufpy
from ufpy import UDict
```

Enjoy!

## About the site

Site was made using `mkdocs` with `mkdocs material` theme. You can use search: just click `Search`
text input at the top of the page or use the ++s++ or ++f++ hotkeys. You can switch themes using the
button on the left and access the `ufpy` repository using the button on the right.

## Contribute

You can also contribute to `ufpy` package or `ufpy` docs site. Just go to `ufpy` repository using
button in right-top of page. For contributing to site you can use `Edit this page` button
(pencil icon in top of every page).
5 changes: 3 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
myst-parser
furo
mkdocs-autorefs
markdown-include
mkdocs-material
31 changes: 0 additions & 31 deletions docs/source/conf.py

This file was deleted.

12 changes: 0 additions & 12 deletions docs/source/index.md

This file was deleted.

8 changes: 8 additions & 0 deletions docs/type_checking/protocols.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Protocols

tags:
- type check
---

# Protocols
8 changes: 8 additions & 0 deletions docs/type_checking/type_alias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Type alias

tags:
- type check
---

# Type alias
9 changes: 9 additions & 0 deletions docs/useful_classes/udict.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: UDict

tags:
- useful class
---

# `UDict` class

8 changes: 8 additions & 0 deletions docs/useful_classes/ustack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: UStack

tags:
- useful class
---

# `UStack` class
69 changes: 69 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
site_name: Useful python (ufpy)
site_url: https://ufpy.readthedocs.io/en/latest/

repo_url: https://github.com/honey-team/ufpy
repo_name: honey-team/ufpy
edit_uri: edit/main/docs/

theme:
name: material
features:
- content.action.edit
- content.code.copy
- content.tooltips
- header.autohide
- search.suggest
icon:
repo: fontawesome/brands/github
edit: material/pencil
tag:
typec: material/code-braces
info: octicons/info-16
useful: simple/python
palette:
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode

- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to system preference

extra:
tags:
type check: typec
information: info
useful class: useful
useful feature: useful

plugins:
- search
- tags

markdown_extensions:
- abbr
- attr_list
- md_in_html
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
use_pygments: true
pygments_lang_class: true
- pymdownx.details
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.keys
- pymdownx.tabbed:
alternate_style: true
- markdown_include.include:
base_path: .
- admonition
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg

0 comments on commit eec20cc

Please sign in to comment.