From ef87b73589770aef3fb8d02221939468042e05c1 Mon Sep 17 00:00:00 2001 From: huangli Date: Thu, 27 Feb 2025 18:08:15 +0800 Subject: [PATCH 1/2] ganos --- docs/db/ganos/ST_AsImage.md | 22 ++++++++++++++++++++++ docs/db/ganos/index.md | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 docs/db/ganos/ST_AsImage.md create mode 100644 docs/db/ganos/index.md diff --git a/docs/db/ganos/ST_AsImage.md b/docs/db/ganos/ST_AsImage.md new file mode 100644 index 0000000..f01a6c0 --- /dev/null +++ b/docs/db/ganos/ST_AsImage.md @@ -0,0 +1,22 @@ +# [ST_AsImage](https://help.aliyun.com/zh/polardb/polardb-for-postgresql/st-asimage?spm=a2c4g.11186623.help-menu-2249963.d_8_5_3_2.435d1dc7c8te2K) + +将栅格对象转化为影像格式二进制流。 + +```sql +SELECT + encode( + ST_AsImage ( + rast, + '(140.025,60.025),(69.975,-0.025)' :: box + 0, + '0', + 'jpeg', + '{"strength": "ratio", "quality": 70}' + ), + 'hex' + ) +FROM + surf_hor_metadata +WHERE + ele = 'PRE' +``` diff --git a/docs/db/ganos/index.md b/docs/db/ganos/index.md new file mode 100644 index 0000000..a6de364 --- /dev/null +++ b/docs/db/ganos/index.md @@ -0,0 +1,3 @@ +# [时空引擎(GanosBase)](https://help.aliyun.com/zh/polardb/polardb-for-oracle/ganosbase-spatio-temporal-database/?spm=a2c4g.11186623.help-menu-2249963.d_9.6f7d7f1fFlqiaA) + + From bbdb34ae43ca9382410d9ac58e9550dd09b71bfb Mon Sep 17 00:00:00 2001 From: huangli Date: Thu, 27 Feb 2025 23:29:03 +0800 Subject: [PATCH 2/2] update --- .github/workflows/ci.yml | 25 +++++ README.md | 11 ++- docs/assets/favicon.svg | 1 + docs/assets/logo.png | Bin 0 -> 3434 bytes docs/index.md | 1 + docs/python/geopandas.md | 1 + docs/python/index.md | 1 + docs/{db => sql}/ganos/ST_AsImage.md | 4 + docs/{db => sql}/ganos/index.md | 0 docs/sql/index.md | 1 + mkdocs.yml | 139 +++++++++++++++++++++++++++ overrides/partials/comments.html | 48 +++++++++ 12 files changed, 231 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 docs/assets/favicon.svg create mode 100644 docs/assets/logo.png create mode 100644 docs/index.md create mode 100644 docs/python/geopandas.md create mode 100644 docs/python/index.md rename docs/{db => sql}/ganos/ST_AsImage.md (94%) rename docs/{db => sql}/ganos/index.md (100%) create mode 100644 docs/sql/index.md create mode 100644 mkdocs.yml create mode 100644 overrides/partials/comments.html diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2fbe129 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: ci +on: + push: + branches: + - master + - main +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v3 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material mkdocs-glightbox + - run: mkdocs gh-deploy --force diff --git a/README.md b/README.md index 2b13561..63b76d9 100644 --- a/README.md +++ b/README.md @@ -1 +1,10 @@ -# code_snippets \ No newline at end of file +# Code Snippets + +# Welcome to Code Snippets + +## 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. diff --git a/docs/assets/favicon.svg b/docs/assets/favicon.svg new file mode 100644 index 0000000..5a567e4 --- /dev/null +++ b/docs/assets/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/logo.png b/docs/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..fd71a3d813e8c6cef24cafcec0e1f89b37067639 GIT binary patch literal 3434 zcmeHK`8U)H8~=U{gE3Q+rHpl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zZL-%y${@LLwg!;c3F_Mx;icnV1i3OXHRpZE@z)nLc{e-gC_~)9A zp))aXoXg)A40J8qFJCV!8UiQ34>w;%wALS2zU`su?j*})c-&R=LLCvV?cP3Ky&c|) zo3OjDBf_3v_nxCoe56z{SS-bv0UMrAGJ|v}C^jSLCB_JIB~>66z8^^L^XN&O7qo}% zbyWlrsyjO$XUTtY!t-{h62OFV-LHppFP+5tOl?)fh`}DEX37(veStAfxDF@ZJ_kud z*YD1=s`cf@if<+MB}EB#C(=qEXh&=tq%g)U|042PCwZFBNuM;?inpiM5XoJA9sBe` zaSzY6R$k%2yI)qQyRTiDfaep`k6Ll;85W~8EeWE`>W z&BQB?)I#%9?%W|4`IqnPALNzjD3x@)5vrcFR4 zc?_^@1WV>!@7F|{GL=7Rq(V5HRzeaQBFR=X!PwH@29yKpncRcM{kCsFrEQG>@XTN!Lv?I=yjH3XVP<7 zDAp=)gl&oH{@btKl916o)Kb8EPH2&}c?sUbJF(>5JcS{<7IDEh{BSyKetf@~-ICHv zLm2ik*NAvRnxi9Tx%A@(f9heu*Zd1<^$w)~BS5W_V`aa*>m?;Euc?%5h&`K|w|ND( z{>Aq(DbQv*f^?Hi@c!%3!rW0t6#c2HS~Ir#+bN>?O^|8cKR57;vHA9?M?#wht%*ag zwGNCqW)CjtD%TXjOehfF7f=X#)R*;fn@gRd7Rli7^IYi&Cy zCpH6_%Dux>^B@cy_uP%fdk~^K{%PPyX<=tEWpvUWlBRy}X7}#WHRN!8?%vmtyBz8l cD6|7xNP~WXOFazQd!7Kx)3&C?M32aS0S&kbB>(^b literal 0 HcmV?d00001 diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..1c9ce7b --- /dev/null +++ b/docs/index.md @@ -0,0 +1 @@ +# Welcome to Code Snippets diff --git a/docs/python/geopandas.md b/docs/python/geopandas.md new file mode 100644 index 0000000..672fe94 --- /dev/null +++ b/docs/python/geopandas.md @@ -0,0 +1 @@ +# GeoPandas \ No newline at end of file diff --git a/docs/python/index.md b/docs/python/index.md new file mode 100644 index 0000000..bef7c17 --- /dev/null +++ b/docs/python/index.md @@ -0,0 +1 @@ +# python \ No newline at end of file diff --git a/docs/db/ganos/ST_AsImage.md b/docs/sql/ganos/ST_AsImage.md similarity index 94% rename from docs/db/ganos/ST_AsImage.md rename to docs/sql/ganos/ST_AsImage.md index f01a6c0..ad9b463 100644 --- a/docs/db/ganos/ST_AsImage.md +++ b/docs/sql/ganos/ST_AsImage.md @@ -1,3 +1,7 @@ +--- +comments: true +--- + # [ST_AsImage](https://help.aliyun.com/zh/polardb/polardb-for-postgresql/st-asimage?spm=a2c4g.11186623.help-menu-2249963.d_8_5_3_2.435d1dc7c8te2K) 将栅格对象转化为影像格式二进制流。 diff --git a/docs/db/ganos/index.md b/docs/sql/ganos/index.md similarity index 100% rename from docs/db/ganos/index.md rename to docs/sql/ganos/index.md diff --git a/docs/sql/index.md b/docs/sql/index.md new file mode 100644 index 0000000..b4f9b40 --- /dev/null +++ b/docs/sql/index.md @@ -0,0 +1 @@ +# SQL \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..90396fd --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,139 @@ +site_name: Code Snippets + +# Repository +repo_name: huanglii/code-snippets +repo_url: https://github.com/huanglii/code-snippets +edit_uri: edit/main/docs/ + +# Copyright +copyright: Copyright © 2025 huangli + +theme: + name: material + language: zh + logo: assets/logo.png + favicon: assets/favicon.svg + custom_dir: overrides + icon: + repo: fontawesome/brands/git-alt + palette: + # Palette toggle for light mode + - scheme: default + primary: teal + accent: teal + toggle: + icon: material/brightness-7 + name: 深色 + + # Palette toggle for dark mode + - scheme: slate + primary: teal + accent: teal + toggle: + icon: material/brightness-4 + name: 浅色 + font: + text: Noto Sans SC + code: Fira Code + features: + - content.action.edit + # - content.action.view + - content.code.copy + - content.code.annotate + # - content.code.select + - content.tooltips + + - navigation.instant + - navigation.tracking + # - navigation.sections + # - navigation.tabs + # - navigation.tabs.sticky + - navigation.path + # - navigation.prune + # - navigation.expand + - navigation.indexes + - navigation.top + - navigation.footer + + - search.highlight + - search.share + - search.suggest + + - toc.follow + # - toc.integrate + +plugins: + - glightbox + - search + - tags + +extra_css: + - stylesheets/extra.css + +extra_javascript: + - javascripts/mathjax.js + - https://polyfill.io/v3/polyfill.min.js?features=es6 + - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/huanglii + # generator: false + +# Extensions +markdown_extensions: + - abbr + - admonition + - attr_list + - def_list + - footnotes + - md_in_html + - toc: + permalink: true + - tables + - pymdownx.arithmatex: + generic: true + - pymdownx.betterem + - pymdownx.caret + - pymdownx.mark + - pymdownx.tilde + - pymdownx.critic: + mode: view + - pymdownx.details + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.highlight: + linenums: true + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.keys + - pymdownx.magiclink: + repo_url_shorthand: true + user: squidfunk + repo: mkdocs-material + - pymdownx.smartsymbols + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.tabbed: + alternate_style: true + - pymdownx.tasklist: + custom_checkbox: true + +# Page tree +# nav: +# - 第 1 章 Python: +# - python/index.md +# - 1.1 GeoPandas: python/geopandas.md +# - 第 2 章 SQL: +# - sql/index.md +# - 2.1 Ganos: +# - sql/ganos/index.md +# - sql/ganos/ST_AsImage.md + \ No newline at end of file diff --git a/overrides/partials/comments.html b/overrides/partials/comments.html new file mode 100644 index 0000000..8e5ab9e --- /dev/null +++ b/overrides/partials/comments.html @@ -0,0 +1,48 @@ +{% if page.meta.comments %} +

{{ lang.t("meta.comments") }}

+ + + + +{% endif %}