Skip to content

Commit

Permalink
auto publish
Browse files Browse the repository at this point in the history
  • Loading branch information
AIboy996 committed May 22, 2024
1 parent acd6028 commit dca9517
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 12 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pythoh-package-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# publish Python Package to pypi

name: publish

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
publish:
runs-on: ubuntu-latest
environment: pypi_publish
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish package
run: python -m twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --skip-existing dist/*
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__
*.egg-info
_ai_summary_cache.json
_ai_summary_cache.json
dist
File renamed without changes.
4 changes: 2 additions & 2 deletions mkdocs-ai-summary/plugin.py → mkdocs_ai_summary/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def on_page_markdown(
match self.config["api"]:
case "tongyi":
try:
from tongyi_api import get_summary_tongyi, AiSummaryError
except ImportError:
from .tongyi_api import get_summary_tongyi, AiSummaryError
except ImportError as e:
logger.warning("tongyi is not available", repr(e))
return markdown

Expand Down
File renamed without changes.
15 changes: 12 additions & 3 deletions mkdocs-ai-summary/pyproject.yml → pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["."]

[project]
name = "mkdocs-ai-summary"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"mkdocs>=1.5.3",
]
authors = [
{ name="Yang Zhang", email="mail@yangzhang.site" },
]
description = "A mkdocs plugin to generage summary with the help of AI."
readme = "../readme.md"
license = {file = "../LICENSE"}
readme = "readme.md"
license = {file = "LICENSE"}
keywords = ["mkdocs", "AI", "blog"]
classifiers = [
"Development Status :: 3 - Alpha",
Expand All @@ -27,4 +33,7 @@ classifiers = [
tongyi = ["dashscope"]

[project.urls]
Homepage = "https://github.com/AIboy996/mkdocs-ai-summary"
Homepage = "https://github.com/AIboy996/mkdocs-ai-summary"

[project.entry-points."mkdocs.plugins"]
ai-summary = "mkdocs_ai_summary.plugin:AiSummaryPlugin"
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
Generage an **ai-summary** for the page:
![](assets/2024-05-22-22-00-32.png)

Live demo: [yangzhang.site](https://yangzhang.site)
Minimal demo [aiboy996.github.io/mkdocs-ai-summary](https://aiboy996.github.io/mkdocs-ai-summary)

Live demo(my homepage): [yangzhang.site](https://yangzhang.site)

## Installation

Expand Down
2 changes: 1 addition & 1 deletion site/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


<link rel="icon" href="/assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-8.5.10">
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-8.5.10">



Expand Down
4 changes: 2 additions & 2 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


<link rel="icon" href="assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-8.5.10">
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-8.5.10">



Expand Down Expand Up @@ -296,7 +296,7 @@
<h1 id="mkdocs-ai-summary">mkdocs-ai-summary</h1>
<div class="admonition ai-summary">
<p class="admonition-title">AI摘要 powered by <a href="https://tongyi.aliyun.com/">通义千问</a></p>
<p>Summary: The AI-Summary plugin enhances your MkDocs site by integrating Tongyi AI for automatic summarization. Install via pip, with plans to support ChatGPT soon. Include ai-summary.css for custom admonition style. Configure with a meta tag in <code>mkdocs.yml</code>, and utilize built-in caching to avoid redundant API calls. Improve your documentation with generated summaries on each page. Live demo available at <a href="https://yangzhang.site">yangzhang.site</a>.</p>
<p>The <code>mkdocs-ai-summary</code> plugin generates AI-generated summaries for your documentation using Tongyi AI, soon to support ChatGPT. Install via pip and include <code>ai-summary.css</code>. Configure in <code>mkdocs.yml</code> by adding a meta tag to each page. The plugin caches summaries to prevent redundant API calls, ensuring efficiency. A live demo is available at <a href="https://yangzhang.site">yangzhang.site</a>.</p>
</div>
<p>Generage an <strong>ai-summary</strong> for the page:
<img alt="" src="assets/2024-05-22-22-00-32.png" /></p>
Expand Down
Binary file modified site/sitemap.xml.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion site/withh1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


<link rel="icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-8.5.10">
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-8.5.10">



Expand Down
2 changes: 1 addition & 1 deletion site/withouth1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


<link rel="icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-8.5.10">
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-8.5.10">



Expand Down

0 comments on commit dca9517

Please sign in to comment.