diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..e7d5f92 --- /dev/null +++ b/.readthedocs.yaml @@ -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 \ No newline at end of file diff --git a/docs/generators.md b/docs/generators.md new file mode 100644 index 0000000..08cf602 --- /dev/null +++ b/docs/generators.md @@ -0,0 +1,8 @@ +--- +title: Generators + +tags: + - useful feature +--- + +# Generators \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..54c7567 --- /dev/null +++ b/docs/index.md @@ -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). diff --git a/docs/requirements.txt b/docs/requirements.txt index acd453d..cda1beb 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ -myst-parser -furo \ No newline at end of file +mkdocs-autorefs +markdown-include +mkdocs-material \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index dadfc49..0000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,31 +0,0 @@ -extensions = [ - "myst_parser", - "sphinx.ext.autodoc" -] - -myst_enable_extensions = [ - 'colon_fence', - 'deflist', - 'dollarmath' -] -myst_heading_anchors = 2 - -project = 'ufpy' -# html_logo = "l.png" -html_favicon = 'favicon.ico' -html_theme = 'furo' - -html_theme_options = { - "source_repository": "https://github.com/honey-team/ufpy", - "source_branch": "main", - "source_directory": "docs/source", - "repository_branch": "main" -} - -html_static_path = ["_static"] -templates_path = ["_templates"] - -source_suffix = { - '.rst': 'restructuredtext', - '.md': 'markdown', -} diff --git a/docs/source/index.md b/docs/source/index.md deleted file mode 100644 index 90f857b..0000000 --- a/docs/source/index.md +++ /dev/null @@ -1,12 +0,0 @@ -```{toctree} ---- -caption: Contents -maxdepth: 2 -hidden: ---- -index -``` - -# Ufpy - -Ufpy (Useful Python) - is a Python library for simplify your code diff --git a/docs/type_checking/protocols.md b/docs/type_checking/protocols.md new file mode 100644 index 0000000..a08d29d --- /dev/null +++ b/docs/type_checking/protocols.md @@ -0,0 +1,8 @@ +--- +title: Protocols + +tags: + - type check +--- + +# Protocols \ No newline at end of file diff --git a/docs/type_checking/type_alias.md b/docs/type_checking/type_alias.md new file mode 100644 index 0000000..c13586c --- /dev/null +++ b/docs/type_checking/type_alias.md @@ -0,0 +1,8 @@ +--- +title: Type alias + +tags: + - type check +--- + +# Type alias \ No newline at end of file diff --git a/docs/useful_classes/udict.md b/docs/useful_classes/udict.md new file mode 100644 index 0000000..0af5cc8 --- /dev/null +++ b/docs/useful_classes/udict.md @@ -0,0 +1,9 @@ +--- +title: UDict + +tags: + - useful class +--- + +# `UDict` class + diff --git a/docs/useful_classes/ustack.md b/docs/useful_classes/ustack.md new file mode 100644 index 0000000..3a5c7dc --- /dev/null +++ b/docs/useful_classes/ustack.md @@ -0,0 +1,8 @@ +--- +title: UStack + +tags: + - useful class +--- + +# `UStack` class diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..9b3baa0 --- /dev/null +++ b/mkdocs.yml @@ -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 \ No newline at end of file