flask-tailwind-manager


Nameflask-tailwind-manager JSON
Version 0.0.11 PyPI version JSON
download
home_pageNone
SummaryEasily use tailwind css with Flask projects
upload_time2024-09-14 20:01:48
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License Copyright (c) 2024 Sebastian Salinas Del Rio 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 flask tailwind tailwindcss
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Flask-Tailwind-Manager

Flask-Tailwind-Manager provides a simple interface to use TailwindCSS with your Flask project. It will let you hide it in a folder called .tailwind so you dont have to see any node_modules or any other javascript. Even tho you DO need npm and npx to be available on your machine.

```{warning}
🚧 This package is under heavy development..
```

## Installation

Install the extension with pip:

```bash
pip install flask-tailwind-manager
```

## Configuration

This are some of the settings available. All of the configurations are optional, and in most cases it should work without any configuration.

| Config                                   | Description                             | Type | Default         |
| ---------------------------------------- | --------------------------------------- | ---- | --------------- |
| TAILWIND_CWD                             | CWD for node_modules.                   | str  | `.tailwind`     |
| TAILWIND_OUTPUT_PATH                     | CSS file output path inside app static. | str  | `css/style.css` |
| TAILWIND_NPM_BIN_PATH                    | Npm binary path.                        | str  | `npm`           |
| TAILWIND_NPX_BIN_PATH                    | Npx binary path.                        | str  | `npx`           |
| TAILWIND_TEMPLATE_FOLDER                 | Name of the templates folder.           | str  | `templates`     |

## Usage

Once installed Flask-TailwindCSS is easy to use. Let's walk through setting up a basic application. Also please note that this is a very basic guide: we will be taking shortcuts here that you should never take in a real application.

To begin we'll set up a Flask app:

```python
from flask import Flask
from flask_tailwind import TailwindCSS

app = Flask(__name__)

tailwind = TailwindCSS()
tailwind.init_app(app)
```

## Using the CLI tool.

Once you completed the extension configuration, you can access the Flask-TailwindCSS CLI tool. There is 4 useful commands you will use. 
    
1. Installing Node and TailwindCSS basic configuration. By default this extension will generate a `tailwind.config.js` generic file, ready to use. If you need to futher customize you will need to edit this file accordingly.  
```bash
    flask tailwind init 
```   
2. Once installed all modules will be found on `.tailwind` folder (or CWD you define). The default configuration will look for changes at `{APP_NAME}/**/{TEMPLATES_FOLDER}/*{.html,.jinja,.j2}`. You can always modify `tailwind.config.js` file in order to customize it.

3. To start watching files and changes. use the `start` command as follows.
```bash
    flask tailwind start
```
4. Almost every time you are using you will install plugins like Preline, Flowbite, daysiUI, etc... For this cases you can use the `npx` or `npm` commands. In the following example we will install the PrelineUI plugin as follows.
```bash
    flask tailwind npm i preline
```
5. After the installation you will have to configure it manually.

This will ensure the plugins are installed in the correct CWD.
 

## Load resources

Once the extension is set up, this will make available the `tailwind_css` function into the templates context so you could load the generated css like this.

```html
<head>
  {{ tailwind_css() }} 
</head>
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "flask-tailwind-manager",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "flask, tailwind, tailwindcss",
    "author": null,
    "author_email": "Sebastian Salinas <seba.salinas.delrio@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/94/b7/fbb0b92d476e05bc94936f218e502987ed139af851b8e38bfcf3a77b6783/flask_tailwind_manager-0.0.11.tar.gz",
    "platform": null,
    "description": "# Flask-Tailwind-Manager\n\nFlask-Tailwind-Manager provides a simple interface to use TailwindCSS with your Flask project. It will let you hide it in a folder called .tailwind so you dont have to see any node_modules or any other javascript. Even tho you DO need npm and npx to be available on your machine.\n\n```{warning}\n\ud83d\udea7 This package is under heavy development..\n```\n\n## Installation\n\nInstall the extension with pip:\n\n```bash\npip install flask-tailwind-manager\n```\n\n## Configuration\n\nThis are some of the settings available. All of the configurations are optional, and in most cases it should work without any configuration.\n\n| Config                                   | Description                             | Type | Default         |\n| ---------------------------------------- | --------------------------------------- | ---- | --------------- |\n| TAILWIND_CWD                             | CWD for node_modules.                   | str  | `.tailwind`     |\n| TAILWIND_OUTPUT_PATH                     | CSS file output path inside app static. | str  | `css/style.css` |\n| TAILWIND_NPM_BIN_PATH                    | Npm binary path.                        | str  | `npm`           |\n| TAILWIND_NPX_BIN_PATH                    | Npx binary path.                        | str  | `npx`           |\n| TAILWIND_TEMPLATE_FOLDER                 | Name of the templates folder.           | str  | `templates`     |\n\n## Usage\n\nOnce installed Flask-TailwindCSS is easy to use. Let's walk through setting up a basic application. Also please note that this is a very basic guide: we will be taking shortcuts here that you should never take in a real application.\n\nTo begin we'll set up a Flask app:\n\n```python\nfrom flask import Flask\nfrom flask_tailwind import TailwindCSS\n\napp = Flask(__name__)\n\ntailwind = TailwindCSS()\ntailwind.init_app(app)\n```\n\n## Using the CLI tool.\n\nOnce you completed the extension configuration, you can access the Flask-TailwindCSS CLI tool. There is 4 useful commands you will use. \n    \n1. Installing Node and TailwindCSS basic configuration. By default this extension will generate a `tailwind.config.js` generic file, ready to use. If you need to futher customize you will need to edit this file accordingly.  \n```bash\n    flask tailwind init \n```   \n2. Once installed all modules will be found on `.tailwind` folder (or CWD you define). The default configuration will look for changes at `{APP_NAME}/**/{TEMPLATES_FOLDER}/*{.html,.jinja,.j2}`. You can always modify `tailwind.config.js` file in order to customize it.\n\n3. To start watching files and changes. use the `start` command as follows.\n```bash\n    flask tailwind start\n```\n4. Almost every time you are using you will install plugins like Preline, Flowbite, daysiUI, etc... For this cases you can use the `npx` or `npm` commands. In the following example we will install the PrelineUI plugin as follows.\n```bash\n    flask tailwind npm i preline\n```\n5. After the installation you will have to configure it manually.\n\nThis will ensure the plugins are installed in the correct CWD.\n \n\n## Load resources\n\nOnce the extension is set up, this will make available the `tailwind_css` function into the templates context so you could load the generated css like this.\n\n```html\n<head>\n  {{ tailwind_css() }} \n</head>\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Sebastian Salinas Del Rio  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": "Easily use tailwind css with Flask projects",
    "version": "0.0.11",
    "project_urls": {
        "Homepage": "https://github.com/sebasalinass/flask-tailwindcss"
    },
    "split_keywords": [
        "flask",
        " tailwind",
        " tailwindcss"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "996599ec8f8b1f576a56a201897afac35d7a1b743c4f72402dd704089601fb4e",
                "md5": "7f0a97328750a4ba3c019adbff41fee2",
                "sha256": "31fa0694d3d82cc9ccc833a03f38e2d69f69663212bb044ff89c3f47d20a9b79"
            },
            "downloads": -1,
            "filename": "flask_tailwind_manager-0.0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7f0a97328750a4ba3c019adbff41fee2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 9497,
            "upload_time": "2024-09-14T20:01:47",
            "upload_time_iso_8601": "2024-09-14T20:01:47.281751Z",
            "url": "https://files.pythonhosted.org/packages/99/65/99ec8f8b1f576a56a201897afac35d7a1b743c4f72402dd704089601fb4e/flask_tailwind_manager-0.0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "94b7fbb0b92d476e05bc94936f218e502987ed139af851b8e38bfcf3a77b6783",
                "md5": "7fb53652ab75e2f36876efa91b3a7134",
                "sha256": "e0eec0db056af94f5f5e7bafa3e8c6fe2e143bff987efa34923c8cc4c4386648"
            },
            "downloads": -1,
            "filename": "flask_tailwind_manager-0.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "7fb53652ab75e2f36876efa91b3a7134",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 10626,
            "upload_time": "2024-09-14T20:01:48",
            "upload_time_iso_8601": "2024-09-14T20:01:48.593374Z",
            "url": "https://files.pythonhosted.org/packages/94/b7/fbb0b92d476e05bc94936f218e502987ed139af851b8e38bfcf3a77b6783/flask_tailwind_manager-0.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-14 20:01:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sebasalinass",
    "github_project": "flask-tailwindcss",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "flask-tailwind-manager"
}
        
Elapsed time: 1.98338s