Skip to main content

A mkdocs plugin to generage summary with the help of AI.

Project description

mkdocs-ai-summary

PyPI - Version PyPI - Implementation PyPI - Python Version

Generage an ai-summary for the page:

Minimal demo aiboy996.github.io/mkdocs-ai-summary

Live demo(my homepage): yangzhang.site

Installation

You should install the package with pip:

pip install mkdocs-ai-summary[tongyi]

Only support tongyi ai for now. Soon to support ChatGPT.

And you should include the ai-summary.css(optional, this is for the custom admonition style) in the config file as below:

Configuration

A demo for mkdocs.yml:

site_name: mkdocs-ai-summary
theme:
  name: material

plugins:
  - ai-summary:
      api: "tongyi"
      ignore_code: true
      cache: true
      cache_dir: "./"
      prompt: "请帮我把下面的内容总结为200字以内的摘要:"
  - tags

markdown_extensions:
  - admonition
  - pymdownx.details
  - pymdownx.superfences
  - pymdownx.tabbed:
      alternate_style: true 
extra_css:
  - ai-summary.css

Then for each page you can add the ai-summary with a meta tag:

---
include:
- ai-summary
---

# h1

....

About Cache

Don't worry about duplicate api calls, we've made the cache function so that if you've done an ai-summary before and the content hasn't changed it will use the cache.

Enjoy it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_ai_summary-0.1.1.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_ai_summary-0.1.1-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page