From ba18dd4137b029bcbac9600d4df1a3ebea19bfe1 Mon Sep 17 00:00:00 2001 From: baluyotraf Date: Mon, 18 Mar 2024 15:58:49 +0100 Subject: [PATCH 1/4] Add documentation using mkdocs-material --- docs/CNAME | 1 + docs/index.md | 3 +++ mkdocs.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 10 ++++++++++ 4 files changed, 62 insertions(+) create mode 100644 docs/CNAME create mode 100644 docs/index.md create mode 100644 mkdocs.yml diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..71b4fec --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +altqq.baluyotraf.com diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..4129e67 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,3 @@ +{% + include-markdown "../README.md" +%} diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..cbec85d --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,48 @@ +site_name: Alternative Queries +site_url: https://altqq.baluyotraf.com +site_description: Typed and Composable Tool for Handwritten SQL +repo_url: https://github.com/baluyotraf/altqq +repo_name: baluyotraf/altqq +edit_uri: "" +copyright: Copyright © 2024 Raffaello Baluyot + +nav: + - Quick Start: index.md + +plugins: + - include-markdown + - search + - social + +markdown_extensions: + - pymdownx.superfences + - pymdownx.highlight: + anchor_linenums: true + auto_title: true + +theme: + name: material + language: en + palette: + primary: black + accent: light blue + icon: + logo: fontawesome/solid/database + repo: fontawesome/brands/github + features: + - navigation.instant + - navigation.tabs + - navigation.tabs.sticky + - navigation.top + +extra: + version: + provider: mike + social: + - icon: fontawesome/brands/linkedin + link: https://www.linkedin.com/in/baluyotraf/ + name: baluyotraf + - icon: fontawesome/brands/github + link: https://github.com/baluyotraf + name: baluyotraf + diff --git a/pyproject.toml b/pyproject.toml index b1777bb..07353ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,16 @@ pydantic = "^2.6.4" [tool.poetry.group.dev.dependencies] pyright = "^1.1.354" +[tool.poetry.group.docs] +optional = true + +[tool.poetry.group.docs.dependencies] +mike = "^2.0.0" +mkdocs = "^1.5.3" +mkdocstrings = "^0.24.1" +mkdocs-include-markdown-plugin = "^6.0.4" +mkdocs-material = { version = "^9.5.14", extras = ["imaging"]} + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" From cc097ddf9299da783bfc2a20b07c6536360d33d1 Mon Sep 17 00:00:00 2001 From: baluyotraf Date: Mon, 18 Mar 2024 16:38:51 +0100 Subject: [PATCH 2/4] Added api reference --- docs/api.md | 21 +++++++++++++++++++++ mkdocs.yml | 9 ++++++++- pyproject.toml | 4 ++-- src/altqq/translators/__init__.py | 1 + src/altqq/translators/plain_text.py | 3 ++- src/altqq/translators/pyodbc.py | 3 ++- 6 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 docs/api.md create mode 100644 src/altqq/translators/__init__.py diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..82296ec --- /dev/null +++ b/docs/api.md @@ -0,0 +1,21 @@ +# API Reference + +## Modeling + +These are used for defining queries. + +### ::: altqq.Query + +## PyODBC + +These are used for working with PyODBC. + +### ::: altqq.to_pyodbc + +### ::: altqq.PyODBCQuery + +## Plain Text + +These are used for working with plain text SQL. + +### ::: altqq.to_plain_text diff --git a/mkdocs.yml b/mkdocs.yml index cbec85d..e381abf 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,12 +8,20 @@ copyright: Copyright © 2024 Raffaello Baluyot nav: - Quick Start: index.md + - api.md plugins: - include-markdown + - mkdocstrings: + default_handler: python + handlers: + python: + options: + show_root_heading: true - search - social + markdown_extensions: - pymdownx.superfences - pymdownx.highlight: @@ -45,4 +53,3 @@ extra: - icon: fontawesome/brands/github link: https://github.com/baluyotraf name: baluyotraf - diff --git a/pyproject.toml b/pyproject.toml index 07353ca..f14273f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,9 +33,9 @@ optional = true [tool.poetry.group.docs.dependencies] mike = "^2.0.0" mkdocs = "^1.5.3" -mkdocstrings = "^0.24.1" +mkdocstrings = { version="^0.24.1", extras = ["python"] } mkdocs-include-markdown-plugin = "^6.0.4" -mkdocs-material = { version = "^9.5.14", extras = ["imaging"]} +mkdocs-material = { version = "^9.5.14", extras = ["imaging"] } [build-system] requires = ["poetry-core"] diff --git a/src/altqq/translators/__init__.py b/src/altqq/translators/__init__.py new file mode 100644 index 0000000..df8bf6e --- /dev/null +++ b/src/altqq/translators/__init__.py @@ -0,0 +1 @@ +"""Entry module for translators.""" diff --git a/src/altqq/translators/plain_text.py b/src/altqq/translators/plain_text.py index 03ecb61..2e7d472 100644 --- a/src/altqq/translators/plain_text.py +++ b/src/altqq/translators/plain_text.py @@ -4,9 +4,10 @@ import typing from typing import Any +from typing_extensions import Annotated + from altqq.structs import Query from altqq.types import QueryValueTypes, T -from typing_extensions import Annotated class PlainTextTranslator: diff --git a/src/altqq/translators/pyodbc.py b/src/altqq/translators/pyodbc.py index 2fde652..05e3333 100644 --- a/src/altqq/translators/pyodbc.py +++ b/src/altqq/translators/pyodbc.py @@ -5,9 +5,10 @@ from string import Formatter from typing import Any, Iterable, List, Mapping, Sequence, Union +from typing_extensions import Annotated + from altqq.structs import Query from altqq.types import QueryValueTypes, T -from typing_extensions import Annotated @dc.dataclass From 581cf655fed24eea4a246cd6451a1b83d1fcc11f Mon Sep 17 00:00:00 2001 From: baluyotraf Date: Mon, 18 Mar 2024 16:46:45 +0100 Subject: [PATCH 3/4] Added default version to versioning --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index e381abf..6556891 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -45,6 +45,7 @@ theme: extra: version: + default: stable provider: mike social: - icon: fontawesome/brands/linkedin From 9a4bba816cb1429f481b98ac7cc90f8ae1f11d3b Mon Sep 17 00:00:00 2001 From: baluyotraf Date: Mon, 18 Mar 2024 16:47:22 +0100 Subject: [PATCH 4/4] Add homepage to pyproject --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index f14273f..7d30063 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ maintainers = ["baluyotraf "] license = "MIT" readme = "README.md" repository = "https://github.com/baluyotraf/altqq" +homepage = "https://altqq.baluyotraf.com" keywords = ["database", "SQL"] [tool.poetry.dependencies]