
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Generage an ai-summary and insert into page content:
Minimal demo(raw mkdocs): AIboy996/mkdocs-ai-summary-minimal-example
Another demo(mkdocs-material theme): AIboy996/mkdocs-ai-summary
Real world demo(my homepage): yangzhang.site
I wrote these codes for my blog site at first. Now it's open for anyone who may need AI to summarize his words.
You should install the package with pip:
pip install mkdocs-ai-summary[chatgpt]
# this will install `openai` additionally
or
pip install mkdocs-ai-summary[tongyi]
# this will install `dashscope` additionally
[!WARNING]
Only support ChatGPT and tongyi ai for now.
To use ChatGPT(default), you should set a Environmental Variable for api key:
export OPENAI_API_KEY='sk-xxxxxxx'
To use tongyi ai, you should set a Environmental Variable for api key:
export DASHSCOPE_API_KEY='sk-xxxxxxx'
[!TIP]
Furthermore you can include the ai-summary.css as
extra_css
in the config file.This is optional, and iff you are using
mkdocs-material
theme this can work.
All parameters:
name | type | default value | note |
---|---|---|---|
api | str | chatgpt | only support chatgpt or tongyi |
model | str | gpt-3.5-turbo | - |
ignore_code | bool | true | ignore code block in markdown |
cache | bool | true | - |
cache_dir | str | "./" | - |
prompt | str | "Please help me summarize the following content into an abstract within 200 words: " | - |
Setup mkdocs.yml
like this:
site_name: mkdocs-ai-summary
theme:
name: material
plugins:
# use default config
- ai-summary
- tags
markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
extra_css:
- ai-summary.css
Then for the page you want an ai-summary, just add a meta tag:
---
include:
- ai-summary
---
# title
hello ai summary.
or you can use tongyi ai by setting:
plugins:
- ai-summary:
api: "tongyi"
model: "qwen-turbo"
ignore_code: true
cache: true
cache_dir: "./"
prompt: "Please help me summarize the following content into an abstract within 200 words: "
You can also setup ai summary for each page separately:
---
include:
- ai-summary
ai-summary-config:
api: "tongyi"
model: "qwen-turbo"
prompt: "Say anything, 200 words."
---
# title
hello ai summary.
all config options are available. Page configuration will override unified configuration.
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.
FAQs
A mkdocs plugin to generage summary with the help of AI.
We found that mkdocs-ai-summary demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.