mkdocs-redoc-tag


Namemkdocs-redoc-tag JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://blueswen.github.io/mkdocs-redoc-tag
SummaryA MkDocs plugin supports for add Redoc in page.
upload_time2024-01-21 10:25:13
maintainer
docs_urlNone
authorBlueswen
requires_python
licenseMIT
keywords mkdocs plugin redoc openapi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MkDocs Redoc Tag 

<a target="_blank" href="https://pypi.org/project/mkdocs-redoc-tag"><img src="https://img.shields.io/pypi/v/mkdocs-redoc-tag.svg" alt="PyPI version"/></a>
<a target="_blank" href="https://pypi.org/project/mkdocs-redoc-tag"><img src="https://img.shields.io/pypi/dm/mkdocs-redoc-tag.svg" alt="PyPI downloads"/></a>
<!-- <a target="_blank" href="https://codecov.io/gh/blueswen/mkdocs-redoc-tag"><img src="https://codecov.io/gh/blueswen/mkdocs-redoc-tag/branch/main/graph/badge.svg" alt="Codecov"/></a> -->

A MkDocs plugin supports adding [Redoc](https://github.com/Redocly/redoc) to the page.

## Features

1. OpenAPI Specification file from online over URL or static file in docs
2. All dependencies are using static files handled by the plugin not from CDN, especially suitable for those documents been deployed in the intranet
3. Synchronized dark mode with [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/)

## Dependency

1. Python Package
    1. beautifulsoup4>=4.11.1
2. Redoc standalone javascript from [official CDN](https://github.com/Redocly/redoc?tab=readme-ov-file#releases)
    1. redoc==2.1.3

## Usage

1. Install the plugin from Pypi

    ```bash
    pip install mkdocs-redoc-tag
    ```

2. Add ```redoc-tag``` plugin into your mkdocs.yml plugins sections:

    ```yaml
    plugins:
       - redoc-tag
    ```
3. Add ```redoc``` tag in markdown to include Redoc:

    ```html
    <redoc src="https://petstore.swagger.io/v2/swagger.json"/>
    ```

    ![Redoc Sample Image](https://blueswen.github.io/mkdocs-redoc-tag/sample.png)

4. You may customize the plugin by passing options in mkdocs.yml:

    ```yaml
    plugins:
       - redoc-tag:
            background: White
    ```

    | Options | Type | Description |
    |---|---|---|
    | background | String | Default: "". Redoc iframe body background attribute value. You can use any css value for background for example "#74b9ff" or "Gainsboro" or "" for nothing. |
    | height | String | Default: "80vh". Height of Redoc iframe. |

## How it works

1. Copy Redoc script file into `site/assets/javascripts/` directory
2. Search all redoc tags, then convert them to an iframe tag and generate the iframe target html with the given OpenAPI Specification src path

## License

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/Blueswen/mkdocs-redoc-tag/blob/main/LICENSE) file for details.

## Reference

1. [redark](https://github.com/dilanx/redark): source of dark mode javascript and css



            

Raw data

            {
    "_id": null,
    "home_page": "https://blueswen.github.io/mkdocs-redoc-tag",
    "name": "mkdocs-redoc-tag",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "mkdocs,plugin,redoc,openapi",
    "author": "Blueswen",
    "author_email": "blueswen.tw@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/82/24/9618a8cd5c4caa7b06ee5357415e79bd4abe77d85a056fb8672cf981562b/mkdocs-redoc-tag-0.1.0.tar.gz",
    "platform": null,
    "description": "# MkDocs Redoc Tag \n\n<a target=\"_blank\" href=\"https://pypi.org/project/mkdocs-redoc-tag\"><img src=\"https://img.shields.io/pypi/v/mkdocs-redoc-tag.svg\" alt=\"PyPI version\"/></a>\n<a target=\"_blank\" href=\"https://pypi.org/project/mkdocs-redoc-tag\"><img src=\"https://img.shields.io/pypi/dm/mkdocs-redoc-tag.svg\" alt=\"PyPI downloads\"/></a>\n<!-- <a target=\"_blank\" href=\"https://codecov.io/gh/blueswen/mkdocs-redoc-tag\"><img src=\"https://codecov.io/gh/blueswen/mkdocs-redoc-tag/branch/main/graph/badge.svg\" alt=\"Codecov\"/></a> -->\n\nA MkDocs plugin supports adding [Redoc](https://github.com/Redocly/redoc) to the page.\n\n## Features\n\n1. OpenAPI Specification file from online over URL or static file in docs\n2. All dependencies are using static files handled by the plugin not from CDN, especially suitable for those documents been deployed in the intranet\n3. Synchronized dark mode with [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/)\n\n## Dependency\n\n1. Python Package\n    1. beautifulsoup4>=4.11.1\n2. Redoc standalone javascript from [official CDN](https://github.com/Redocly/redoc?tab=readme-ov-file#releases)\n    1. redoc==2.1.3\n\n## Usage\n\n1. Install the plugin from Pypi\n\n    ```bash\n    pip install mkdocs-redoc-tag\n    ```\n\n2. Add ```redoc-tag``` plugin into your mkdocs.yml plugins sections:\n\n    ```yaml\n    plugins:\n       - redoc-tag\n    ```\n3. Add ```redoc``` tag in markdown to include Redoc:\n\n    ```html\n    <redoc src=\"https://petstore.swagger.io/v2/swagger.json\"/>\n    ```\n\n    ![Redoc Sample Image](https://blueswen.github.io/mkdocs-redoc-tag/sample.png)\n\n4. You may customize the plugin by passing options in mkdocs.yml:\n\n    ```yaml\n    plugins:\n       - redoc-tag:\n            background: White\n    ```\n\n    | Options | Type | Description |\n    |---|---|---|\n    | background | String | Default: \"\". Redoc iframe body background attribute value. You can use any css value for background for example \"#74b9ff\" or \"Gainsboro\" or \"\" for nothing. |\n    | height | String | Default: \"80vh\". Height of Redoc iframe. |\n\n## How it works\n\n1. Copy Redoc script file into `site/assets/javascripts/` directory\n2. Search all redoc tags, then convert them to an iframe tag and generate the iframe target html with the given OpenAPI Specification src path\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](https://github.com/Blueswen/mkdocs-redoc-tag/blob/main/LICENSE) file for details.\n\n## Reference\n\n1. [redark](https://github.com/dilanx/redark): source of dark mode javascript and css\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A MkDocs plugin supports for add Redoc in page.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://blueswen.github.io/mkdocs-redoc-tag",
        "Source": "https://github.com/Blueswen/mkdocs-redoc-tag"
    },
    "split_keywords": [
        "mkdocs",
        "plugin",
        "redoc",
        "openapi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aba0d9b690bc0a06e89d41239c294f87301fd24a1450b796fd6950ba0e773ccf",
                "md5": "1f1e35d19a9aa39ab612a36c08020975",
                "sha256": "80c97ad905f6daf89683b30796349de038f7032dd4e1df9b4b9bd305bbf45e93"
            },
            "downloads": -1,
            "filename": "mkdocs_redoc_tag-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1f1e35d19a9aa39ab612a36c08020975",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 281367,
            "upload_time": "2024-01-21T10:25:10",
            "upload_time_iso_8601": "2024-01-21T10:25:10.606887Z",
            "url": "https://files.pythonhosted.org/packages/ab/a0/d9b690bc0a06e89d41239c294f87301fd24a1450b796fd6950ba0e773ccf/mkdocs_redoc_tag-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "82249618a8cd5c4caa7b06ee5357415e79bd4abe77d85a056fb8672cf981562b",
                "md5": "ef483d9644892b3304f6c7b5a31d78f2",
                "sha256": "1770033112f76d7ce4f53798be7aa8854e4b3bd9b5237ab911bf423c73a4cf6c"
            },
            "downloads": -1,
            "filename": "mkdocs-redoc-tag-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ef483d9644892b3304f6c7b5a31d78f2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 279941,
            "upload_time": "2024-01-21T10:25:13",
            "upload_time_iso_8601": "2024-01-21T10:25:13.163945Z",
            "url": "https://files.pythonhosted.org/packages/82/24/9618a8cd5c4caa7b06ee5357415e79bd4abe77d85a056fb8672cf981562b/mkdocs-redoc-tag-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-21 10:25:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Blueswen",
    "github_project": "mkdocs-redoc-tag",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mkdocs-redoc-tag"
}
        
Elapsed time: 0.17341s