mkdocs-ai-summary


Namemkdocs-ai-summary JSON
Version 0.2.5 PyPI version JSON
download
home_pageNone
SummaryA mkdocs plugin to generage summary with the help of AI.
upload_time2024-12-12 07:26:38
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2024 Yang Zhang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords mkdocs ai blog chatgpt
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mkdocs-ai-summary

[![PyPI - Version](https://img.shields.io/pypi/v/mkdocs-ai-summary)](https://pypi.org/project/mkdocs-ai-summary/)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/mkdocs-ai-summary)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mkdocs-ai-summary)

Generage an **ai-summary** for the page:
![](assets/2024-05-23-04-35-01.png)

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

You should install the package with pip:
```
pip install mkdocs-ai-summary[chatgpt]
```
or
```
pip install mkdocs-ai-summary[tongyi]
```
> ⚠️⚠️⚠️⚠️
> 
> Only support [ChatGPT](https://chat.openai.com/) and [tongyi ai](https://tongyi.aliyun.com/) for now.
>  
>  To use **ChatGPT(default)**, you should set a Environmental Variable for **api key**:
>  ```bash
>  export OPENAI_API_KEY='sk-xxxxxxx'
>  ```
> [how to get an OPENAI_API_KEY?](https://platform.openai.com/docs/quickstart)
> 
>  To use **tongyi ai**, you should set a Environmental Variable for **api key**:
>  ```bash
>  export DASHSCOPE_API_KEY='sk-xxxxxxx'
>  ```
> [how to get an DASHSCOPE_API_KEY?](https://dashscope.console.aliyun.com/)

[optional] Then you can include the [ai-summary.css](./docs/ai-summary.css)(optional, this is for the **custom  ai summary admonition style**) in the config file as below:

## Configuration

### Options can be set

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: "| -


### For ChatGPT Summary

Setup `mkdocs.yml` like this:

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

plugins:
  - ai-summary:
      api: "chatgpt"
      model: "gpt-3.5-turbo"
      ignore_code: true 
      cache: true
      cache_dir: "./"
      prompt: "Please help me summarize the following content into an abstract within 200 words: "
  - 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:
```markdown
---
include:
- ai-summary
---

# title

hello ai summary.
```

### For tongyi ai Summary
or you can use **tongyi ai** by setting:
```yml
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: "
```

### Setup ai-summary for specific page

You can also setup ai summary for each page separately:

```markdown
---
include:
- ai-summary
ai-summary-config:
    api: "tongyi"
    model: "qwen-turbo"
    prompt: "帮我把下面的内容总结为200字以内的摘要:"
---

# title

hello ai summary.
```

all config options are available. **Page configuration will override unified configuration.**

## 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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mkdocs-ai-summary",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "mkdocs, AI, blog, chatgpt",
    "author": null,
    "author_email": "Yang Zhang <mail@yangzhang.site>",
    "download_url": "https://files.pythonhosted.org/packages/10/da/8d8bead4b3fcbf9b3c0187b8708f6a470f99400b75f87bde82ca767dac87/mkdocs_ai_summary-0.2.5.tar.gz",
    "platform": null,
    "description": "# mkdocs-ai-summary\n\n[![PyPI - Version](https://img.shields.io/pypi/v/mkdocs-ai-summary)](https://pypi.org/project/mkdocs-ai-summary/)\n![PyPI - Implementation](https://img.shields.io/pypi/implementation/mkdocs-ai-summary)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mkdocs-ai-summary)\n\nGenerage an **ai-summary** for the page:\n![](assets/2024-05-23-04-35-01.png)\n\nMinimal demo: [aiboy996.github.io/mkdocs-ai-summary](https://aiboy996.github.io/mkdocs-ai-summary)\n\nLive demo(my homepage): [yangzhang.site](https://yangzhang.site)\n\n## Installation\n\nYou should install the package with pip:\n```\npip install mkdocs-ai-summary[chatgpt]\n```\nor\n```\npip install mkdocs-ai-summary[tongyi]\n```\n> \u26a0\ufe0f\u26a0\ufe0f\u26a0\ufe0f\u26a0\ufe0f\n> \n> Only support [ChatGPT](https://chat.openai.com/) and [tongyi ai](https://tongyi.aliyun.com/) for now.\n>  \n>  To use **ChatGPT(default)**, you should set a Environmental Variable for **api key**:\n>  ```bash\n>  export OPENAI_API_KEY='sk-xxxxxxx'\n>  ```\n> [how to get an OPENAI_API_KEY?](https://platform.openai.com/docs/quickstart)\n> \n>  To use **tongyi ai**, you should set a Environmental Variable for **api key**:\n>  ```bash\n>  export DASHSCOPE_API_KEY='sk-xxxxxxx'\n>  ```\n> [how to get an DASHSCOPE_API_KEY?](https://dashscope.console.aliyun.com/)\n\n[optional] Then you can include the [ai-summary.css](./docs/ai-summary.css)(optional, this is for the **custom  ai summary admonition style**) in the config file as below:\n\n## Configuration\n\n### Options can be set\n\nname|type|default value| note\n--|--|--|--\napi|str|chatgpt| only support chatgpt or tongyi\nmodel|str|gpt-3.5-turbo | -\nignore_code|bool|true| ignore code block in markdown\ncache|bool|true| -\ncache_dir|str|\"./\"| -\nprompt|str|\"Please help me summarize the following content into an abstract within 200 words: \"| -\n\n\n### For ChatGPT Summary\n\nSetup `mkdocs.yml` like this:\n\n```yml\nsite_name: mkdocs-ai-summary\ntheme:\n  name: material\n\nplugins:\n  - ai-summary:\n      api: \"chatgpt\"\n      model: \"gpt-3.5-turbo\"\n      ignore_code: true \n      cache: true\n      cache_dir: \"./\"\n      prompt: \"Please help me summarize the following content into an abstract within 200 words: \"\n  - tags\n\nmarkdown_extensions:\n  - admonition\n  - pymdownx.details\n  - pymdownx.superfences\n  - pymdownx.tabbed:\n      alternate_style: true \nextra_css:\n  - ai-summary.css\n```\n\nThen for the page you want an ai-summary, just add a meta tag:\n```markdown\n---\ninclude:\n- ai-summary\n---\n\n# title\n\nhello ai summary.\n```\n\n### For tongyi ai Summary\nor you can use **tongyi ai** by setting:\n```yml\nplugins:\n  - ai-summary:\n      api: \"tongyi\"\n      model: \"qwen-turbo\"\n      ignore_code: true\n      cache: true\n      cache_dir: \"./\"\n      prompt: \"Please help me summarize the following content into an abstract within 200 words: \"\n```\n\n### Setup ai-summary for specific page\n\nYou can also setup ai summary for each page separately:\n\n```markdown\n---\ninclude:\n- ai-summary\nai-summary-config:\n    api: \"tongyi\"\n    model: \"qwen-turbo\"\n    prompt: \"\u5e2e\u6211\u628a\u4e0b\u9762\u7684\u5185\u5bb9\u603b\u7ed3\u4e3a200\u5b57\u4ee5\u5185\u7684\u6458\u8981\uff1a\"\n---\n\n# title\n\nhello ai summary.\n```\n\nall config options are available. **Page configuration will override unified configuration.**\n\n## About Cache\n\nDon'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.\n\nEnjoy it.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Yang Zhang  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A mkdocs plugin to generage summary with the help of AI.",
    "version": "0.2.5",
    "project_urls": {
        "Homepage": "https://github.com/AIboy996/mkdocs-ai-summary"
    },
    "split_keywords": [
        "mkdocs",
        " ai",
        " blog",
        " chatgpt"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "82e9e0b47bdddaec42d076d2eeb982f234b8607660d2d04e8e412868aaab4506",
                "md5": "3bde3aaf4bd8227d4cb9066af60699f6",
                "sha256": "de7ac627710ebbba81964daa9c17374913afef6fdfe16c6fff92abf03715c1ac"
            },
            "downloads": -1,
            "filename": "mkdocs_ai_summary-0.2.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3bde3aaf4bd8227d4cb9066af60699f6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 8544,
            "upload_time": "2024-12-12T07:26:37",
            "upload_time_iso_8601": "2024-12-12T07:26:37.355060Z",
            "url": "https://files.pythonhosted.org/packages/82/e9/e0b47bdddaec42d076d2eeb982f234b8607660d2d04e8e412868aaab4506/mkdocs_ai_summary-0.2.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "10da8d8bead4b3fcbf9b3c0187b8708f6a470f99400b75f87bde82ca767dac87",
                "md5": "39d33f04b18f1dbcbf25cb8e3a5e0a2d",
                "sha256": "e3eddee5a07b0fa405d9fe6f5348f7c8d0fc2b8405ccfae44e31c286e946bdb6"
            },
            "downloads": -1,
            "filename": "mkdocs_ai_summary-0.2.5.tar.gz",
            "has_sig": false,
            "md5_digest": "39d33f04b18f1dbcbf25cb8e3a5e0a2d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 6253,
            "upload_time": "2024-12-12T07:26:38",
            "upload_time_iso_8601": "2024-12-12T07:26:38.322727Z",
            "url": "https://files.pythonhosted.org/packages/10/da/8d8bead4b3fcbf9b3c0187b8708f6a470f99400b75f87bde82ca767dac87/mkdocs_ai_summary-0.2.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-12 07:26:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AIboy996",
    "github_project": "mkdocs-ai-summary",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mkdocs-ai-summary"
}
        
Elapsed time: 0.55531s