From 5d2494ca688c777ba5f04b78b26bc4df759e18e9 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 01:03:24 +0300 Subject: [PATCH 01/13] Add .readthedocs.yaml --- .readthedocs.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..fa90087 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,31 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.12" + # You can also specify other tool versions: + # nodejs: "19" + # rust: "1.64" + # golang: "1.19" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +# formats: +# - pdf +# - epub + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt \ No newline at end of file From 06fcd25abe073ebdff4686040a7916ebaa2b4ff0 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 01:07:49 +0300 Subject: [PATCH 02/13] Fix conf.py --- docs/{source => }/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename docs/{source => }/conf.py (87%) diff --git a/docs/source/conf.py b/docs/conf.py similarity index 87% rename from docs/source/conf.py rename to docs/conf.py index dadfc49..c287d90 100644 --- a/docs/source/conf.py +++ b/docs/conf.py @@ -1,18 +1,18 @@ extensions = [ "myst_parser", - "sphinx.ext.autodoc" + "sphinx.ext.autodoc", ] myst_enable_extensions = [ 'colon_fence', 'deflist', - 'dollarmath' + 'dollarmath', ] myst_heading_anchors = 2 project = 'ufpy' # html_logo = "l.png" -html_favicon = 'favicon.ico' +# html_favicon = 'favicon.ico' html_theme = 'furo' html_theme_options = { From 5e33383da671f4ffdc79b390e7efbed450cbab72 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 01:12:36 +0300 Subject: [PATCH 03/13] Add index.rst --- docs/source/index.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/source/index.rst diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..e69de29 From c8e2335e969bb8bcba1b1d174a17804e957d4d86 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 01:14:18 +0300 Subject: [PATCH 04/13] Fix index.rst --- docs/{source => }/index.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{source => }/index.rst (100%) diff --git a/docs/source/index.rst b/docs/index.rst similarity index 100% rename from docs/source/index.rst rename to docs/index.rst From ee9f147415031fefe3e37cd9d0614f0265550a34 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 01:30:17 +0300 Subject: [PATCH 05/13] Change to `mkdocs` --- .readthedocs.yaml | 31 ------------------------------- docs/conf.py | 31 ------------------------------- docs/index.md | 17 +++++++++++++++++ docs/index.rst | 0 docs/requirements.txt | 2 -- docs/source/index.md | 12 ------------ mkdocs.yml | 1 + 7 files changed, 18 insertions(+), 76 deletions(-) delete mode 100644 .readthedocs.yaml delete mode 100644 docs/conf.py create mode 100644 docs/index.md delete mode 100644 docs/index.rst delete mode 100644 docs/requirements.txt delete mode 100644 docs/source/index.md create mode 100644 mkdocs.yml diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index fa90087..0000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -# Set the OS, Python version and other tools you might need -build: - os: ubuntu-22.04 - tools: - python: "3.12" - # You can also specify other tool versions: - # nodejs: "19" - # rust: "1.64" - # golang: "1.19" - -# Build documentation in the "docs/" directory with Sphinx -sphinx: - configuration: docs/conf.py - -# Optionally build your docs in additional formats such as PDF and ePub -# formats: -# - pdf -# - epub - -# Optional but recommended, declare the Python requirements required -# to build your documentation -# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -python: - install: - - requirements: docs/requirements.txt \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index c287d90..0000000 --- a/docs/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/index.md b/docs/index.md new file mode 100644 index 0000000..000ea34 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,17 @@ +# Welcome to MkDocs + +For full documentation visit [mkdocs.org](https://www.mkdocs.org). + +## Commands + +* `mkdocs new [dir-name]` - Create a new project. +* `mkdocs serve` - Start the live-reloading docs server. +* `mkdocs build` - Build the documentation site. +* `mkdocs -h` - Print help message and exit. + +## Project layout + + mkdocs.yml # The configuration file. + docs/ + index.md # The documentation homepage. + ... # Other markdown pages, images and other files. diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index e69de29..0000000 diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index acd453d..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -myst-parser -furo \ No newline at end of file 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/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..c379c10 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1 @@ +site_name: Ufpy From 2d2064546719b59c90067940fa26f0753c7c7023 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 01:34:33 +0300 Subject: [PATCH 06/13] =?UTF-8?q?Change=20to=20`mkdocs`=20=E2=84=962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .readthedocs.yaml | 20 ++++++++++++++++++++ docs/requirements.txt | 1 + 2 files changed, 21 insertions(+) create mode 100644 .readthedocs.yaml create mode 100644 docs/requirements.txt diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..30def6a --- /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/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..b854bca --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1 @@ +mkdocs \ No newline at end of file From 37e29c9b6e870a6029a1a1a8548b0441a33430d5 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 01:38:23 +0300 Subject: [PATCH 07/13] =?UTF-8?q?Change=20to=20`mkdocs`=20=E2=84=963?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/requirements.in | 3 +++ docs/requirements.txt | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 docs/requirements.in diff --git a/docs/requirements.in b/docs/requirements.in new file mode 100644 index 0000000..8c1d861 --- /dev/null +++ b/docs/requirements.in @@ -0,0 +1,3 @@ +mkdocs +mkdocstrings[python] +markdown-include \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index b854bca..e69de29 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +0,0 @@ -mkdocs \ No newline at end of file From 05a925f685517bfdabdca7fdf7c7b89d1205ef52 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 03:29:05 +0300 Subject: [PATCH 08/13] final update of building site --- .readthedocs.yaml | 8 ++++---- docs/requirements.in | 3 --- docs/requirements.txt | 3 +++ mkdocs.yml | 27 +++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 7 deletions(-) delete mode 100644 docs/requirements.in diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 30def6a..e7d5f92 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,10 +6,10 @@ version: 2 # Set the version of Python and other tools you might need -# build: -# os: ubuntu-22.04 -# tools: -# python: "3.10" +build: + os: ubuntu-22.04 + tools: + python: "3.10" mkdocs: configuration: mkdocs.yml diff --git a/docs/requirements.in b/docs/requirements.in deleted file mode 100644 index 8c1d861..0000000 --- a/docs/requirements.in +++ /dev/null @@ -1,3 +0,0 @@ -mkdocs -mkdocstrings[python] -markdown-include \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index e69de29..cda1beb 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +mkdocs-autorefs +markdown-include +mkdocs-material \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index c379c10..072155b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1 +1,28 @@ site_name: Ufpy +site_url: https://ufpy.readthedocs.io/en/latest/ +repo_url: https://github.com/honey-team/ufpy +edit_uri: edit/main/docs/ + +theme: + name: material + features: + - content.action.edit + - content.code.copy + icon: + repo: fontawesome/brands/github + edit: material/pencil + view: material/eye +plugins: + - search +markdown_extensions: + - pymdownx.highlight: + anchor_linenums: true + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.superfences + - markdown_include.include: + base_path: . + - admonition \ No newline at end of file From 41d572dd98a479e3275db751c1cc824058cee4a1 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 20:43:31 +0300 Subject: [PATCH 09/13] big update of site. --- docs/index.md | 74 ++++++++++++++++++++++++++++++++++++++++++--------- mkdocs.yml | 30 +++++++++++++++++++-- 2 files changed, 90 insertions(+), 14 deletions(-) diff --git a/docs/index.md b/docs/index.md index 000ea34..9de567b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,17 +1,67 @@ -# Welcome to MkDocs +--- +title: Getting started +--- -For full documentation visit [mkdocs.org](https://www.mkdocs.org). +# `ufpy` package -## Commands +## Introduction -* `mkdocs new [dir-name]` - Create a new project. -* `mkdocs serve` - Start the live-reloading docs server. -* `mkdocs build` - Build the documentation site. -* `mkdocs -h` - Print help message and exit. +Ufpy (Useful Python) - is a package for simplifying Python programs using many useful features. -## Project layout +Now Ufpy has these features: - mkdocs.yml # The configuration file. - docs/ - index.md # The documentation homepage. - ... # Other markdown pages, images and other files. +- `UDict` (useful dict) +- `UStack` (useful stack) +- Generators of classes methods: + - `cmp_generator` + - `r_generator` + - `i_generator` +- many protocols for type hinting +- many variables for type hinting + +## Installing + +For installing `ufpy` you should to install `python 3.12+` and `pip`. After installing just +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 in up of page or use ++s++ or ++f++ hotkey. You can switch themes using button more +left and go to `ufpy` repository more 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/mkdocs.yml b/mkdocs.yml index 072155b..9b48255 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,6 +1,8 @@ site_name: 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: @@ -8,21 +10,45 @@ theme: features: - content.action.edit - content.code.copy + - content.tooltips + - header.autohide + - search.suggest icon: repo: fontawesome/brands/github edit: material/pencil - view: material/eye + 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 + plugins: - search + markdown_extensions: + - abbr + - attr_list + - md_in_html - pymdownx.highlight: - anchor_linenums: true 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 \ No newline at end of file From 64a5dba23761d29398ea786184fbda0c270cb14d Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 21:11:30 +0300 Subject: [PATCH 10/13] tags --- docs/index.md | 3 +++ mkdocs.yml | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 9de567b..7b1cf62 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,8 @@ --- title: Getting started + +tags: + - information --- # `ufpy` package diff --git a/mkdocs.yml b/mkdocs.yml index 9b48255..c8fc3d4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,6 +16,10 @@ theme: 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)" @@ -30,8 +34,15 @@ theme: icon: material/brightness-4 name: Switch to system preference +extra: + tags: + type check: typec + information: info + useful class: useful + plugins: - search + - tags markdown_extensions: - abbr @@ -51,4 +62,7 @@ markdown_extensions: alternate_style: true - markdown_include.include: base_path: . - - admonition \ No newline at end of file + - 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 From d5b18567844470f3d442c311cb461e9cad285094 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 22:22:26 +0300 Subject: [PATCH 11/13] Final index.md! --- docs/generators.md | 8 ++++++++ docs/index.md | 18 ++++++++---------- docs/type_checking/protocols.md | 8 ++++++++ docs/type_checking/type_alias.md | 8 ++++++++ docs/useful_classes/udict.md | 9 +++++++++ docs/useful_classes/ustack.md | 8 ++++++++ mkdocs.yml | 1 + 7 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 docs/generators.md create mode 100644 docs/type_checking/protocols.md create mode 100644 docs/type_checking/type_alias.md create mode 100644 docs/useful_classes/udict.md create mode 100644 docs/useful_classes/ustack.md 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 index 7b1cf62..9ddb3eb 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,14 +13,14 @@ Ufpy (Useful Python) - is a package for simplifying Python programs using many u Now Ufpy has these features: -- `UDict` (useful dict) -- `UStack` (useful stack) +- [`UDict`](useful_classes/udict.md "Useful dict."). +- [`UStack`](useful_classes/ustack.md "Useful stack."). - Generators of classes methods: - - `cmp_generator` - - `r_generator` - - `i_generator` -- many protocols for type hinting -- many variables for type hinting + - [`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 @@ -65,6 +65,4 @@ left and go to `ufpy` repository more right. 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). - - +(pencil icon in top of every page). 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 index c8fc3d4..25d5a14 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -39,6 +39,7 @@ extra: type check: typec information: info useful class: useful + useful feature: useful plugins: - search From 556b856160a5e8e28328183644a243b10e3622b4 Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 22:25:04 +0300 Subject: [PATCH 12/13] Change name of site --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 25d5a14..9b3baa0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ufpy +site_name: Useful python (ufpy) site_url: https://ufpy.readthedocs.io/en/latest/ repo_url: https://github.com/honey-team/ufpy From b890635856055897221a1ba47b2c8491f08251bd Mon Sep 17 00:00:00 2001 From: bleudev Date: Sat, 8 Jun 2024 22:34:37 +0300 Subject: [PATCH 13/13] Fix sourcery's suggestions --- docs/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 9ddb3eb..54c7567 100644 --- a/docs/index.md +++ b/docs/index.md @@ -24,8 +24,8 @@ Now Ufpy has these features: ## Installing -For installing `ufpy` you should to install `python 3.12+` and `pip`. After installing just -use this command in your `cmd`/`bash` terminal: +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 @@ -58,8 +58,8 @@ Enjoy! ## About the site Site was made using `mkdocs` with `mkdocs material` theme. You can use search: just click `Search` -text input in up of page or use ++s++ or ++f++ hotkey. You can switch themes using button more -left and go to `ufpy` repository more right. +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