{"id":15175502,"url":"https://github.com/enoobis/ai-ebook-generator","last_synced_at":"2026-02-27T08:02:59.625Z","repository":{"id":251340502,"uuid":"837125977","full_name":"enoobis/AI-eBook-Generator","owner":"enoobis","description":"This project generates an eBook based on user input using the Cohere AI model","archived":false,"fork":false,"pushed_at":"2024-08-02T09:23:16.000Z","size":2566,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T18:14:24.530Z","etag":null,"topics":["ai","aiapps","aitools","chatgpt","cohere","command","commant-r-plus","ebook","generative-ai","gpt-4","ml","openai","pdf","pdfgenerator","python","pythontools","tools"],"latest_commit_sha":null,"homepage":"https://enoobis.github.io/AI-eBook-Generator/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enoobis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-02T09:12:26.000Z","updated_at":"2025-02-03T05:52:18.000Z","dependencies_parsed_at":"2024-08-02T10:46:13.327Z","dependency_job_id":"2cc0887e-1029-4d07-83f2-1287996cb588","html_url":"https://github.com/enoobis/AI-eBook-Generator","commit_stats":null,"previous_names":["enoobis/ai-ebook-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enoobis%2FAI-eBook-Generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enoobis%2FAI-eBook-Generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enoobis%2FAI-eBook-Generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enoobis%2FAI-eBook-Generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enoobis","download_url":"https://codeload.github.com/enoobis/AI-eBook-Generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240063928,"owners_count":19742227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","aiapps","aitools","chatgpt","cohere","command","commant-r-plus","ebook","generative-ai","gpt-4","ml","openai","pdf","pdfgenerator","python","pythontools","tools"],"created_at":"2024-09-27T12:39:19.393Z","updated_at":"2026-02-27T08:02:54.594Z","avatar_url":"https://github.com/enoobis.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# AI eBook Generator\r\n\r\n![AI eBook Generator](preview.png)\r\n\r\n## Overview\r\n\r\n  \r\n\r\nThis project generates an eBook based on user input using the Cohere AI model. The eBook content is formatted in Markdown, converted to HTML using a selected template, and then rendered as a PDF. The workflow includes generating content, converting it to HTML, embedding it in a chosen template, and converting the final HTML to a styled PDF.\r\n\r\n  \r\n\r\n## Requirements\r\n\r\n  \r\n\r\n- Python 3.x\r\n\r\n-  `cohere` Python package\r\n\r\n-  `pdfkit` Python package\r\n\r\n-  `markdown` Python package\r\n\r\n-  `wkhtmltopdf` installed on your system\r\n\r\n  \r\n\r\n## Platforms\r\n\r\n  \r\n\r\nAI Ebook Generator is compatible with the following platforms:\r\n\r\n  \r\n\r\n- Windows\r\n\r\n- Mac\r\n\r\n- Linux\r\n\r\n  \r\n\r\n## Prerequisites\r\n\r\n  \r\n\r\nBefore running the app, ensure that you have Python installed on your system along with the necessary dependencies:\r\n\r\n  \r\n\r\n- Python 3.x\r\n\r\n  \r\n  \r\n\r\n## Installation\r\n\r\n  \r\n\r\n1.  **Install Python Packages**:\r\n\r\nEnsure you have the required Python packages installed:\r\n\r\n  \r\n\r\n```bash\r\npip install -r requirements.txt\r\n```\r\n\r\n  \r\n\r\n2.  **Install wkhtmltopdf**:\r\n\r\n  \r\n  \r\n\r\n-  **For Windows**: Download and install from [wkhtmltopdf.org](https://wkhtmltopdf.org/downloads.html) and make sure it's added to your system's PATH. Use the provided `add_wkhtmltopdf-to-path.bat` script to set up the PATH variable.\r\n\r\n-  **For macOS**: Use Homebrew: `brew install wkhtmltopdf`.\r\n\r\n-  **For Linux**: Use your package manager, e.g., `sudo apt-get install wkhtmltopdf`.\r\n\r\n  \r\n\r\n**`add_wkhtmltopdf-to-path.bat` Script**:\r\n\r\n  \r\n\r\nIf you are using Windows, run the `add_wkhtmltopdf-to-path.bat` script to automatically add `wkhtmltopdf` to your PATH. You can find this script in the project directory.\r\n\r\n  \r\n\r\nMake sure to adjust the path in the script to match where `wkhtmltopdf` is installed on your system.\r\n\r\n1.  **Prepare Configuration**:\r\n\r\nCreate a file named `config.py` and replace `your-cohere-api-key` with your actual [Cohere](https://cohere.com/) API key:\r\n\r\n```python\r\n# config.py\r\nCOHERE_API_KEY = 'your-cohere-api-key'\r\n```\r\n\r\n## Usage\r\n\r\n1.  **Templates**:\r\n\r\nHTML templates are present in the `templates` folder:\r\n\r\n\r\n-  `classic.html`\r\n\r\n-  `modern.html`\r\n\r\n-  `minimalist.html`\r\n\r\n-  `elegant.html`\r\n\r\n-  `dark.html`\r\n\r\n\r\nThese are the default templates that comes with this app. but you can make your own template too.\r\n\r\nEach template should have the following structure, with `{{MARKDOWN_CONTENT}}` as a placeholder for the eBook content:\r\n\r\n  \r\n\r\n```html\r\n\u003c!DOCTYPE html\u003e\r\n\u003chtml lang=\"en\"\u003e\r\n\u003chead\u003e\r\n    \u003cmeta charset=\"UTF-8\"\u003e\r\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\r\n    \u003ctitle\u003eeBook - Classic\u003c/title\u003e\r\n    \u003cstyle\u003e\r\n        body {\r\n            font-family: 'Times New Roman', serif;\r\n            line-height: 1.8;\r\n            margin: 0;\r\n            padding: 30px;\r\n            background-color: #f5f5f5;\r\n        }\r\n        h1, h2, h3, h4, h5, h6 {\r\n            color: #333;\r\n        }\r\n        p {\r\n            margin: 15px 0;\r\n        }\r\n        code {\r\n            background-color: #f4f4f4;\r\n            padding: 4px 6px;\r\n            border-radius: 4px;\r\n        }\r\n        pre {\r\n            background-color: #f4f4f4;\r\n            padding: 12px;\r\n            border-radius: 4px;\r\n            overflow-x: auto;\r\n        }\r\n    \u003c/style\u003e\r\n\u003c/head\u003e\r\n\u003cbody\u003e\r\n    \u003cmarkdown\u003e\r\n        {{MARKDOWN_CONTENT}}\r\n    \u003c/markdown\u003e\r\n    \u003cscript src=\"https://cdn.jsdelivr.net/npm/showdown/dist/showdown.min.js\"\u003e\u003c/script\u003e\r\n\u003c/body\u003e\r\n\u003c/html\u003e\r\n\r\n\r\n```\r\n\r\n  \r\n\r\n1.  **Run the Script**:\r\n\r\n  \r\n\r\n### Execute the `main.py` script:\r\n\r\n  \r\n\r\n```bash\r\npython main.py\r\n```\r\n\r\n  \r\n\r\n### Follow the prompts to:\r\n\r\n- Enter the eBook topic.\r\n\r\n- Specify the number of chapters.\r\n\r\n- Choose a template from the provided options.\r\n\r\n  \r\n\r\n###  The script will:\r\n\r\n- Generate the eBook content.\r\n\r\n- Convert the content to HTML.\r\n\r\n- Embed the HTML content into the selected template.\r\n\r\n- Convert the final HTML to a PDF.\r\n\r\n  \r\n\r\n## Example\r\n\r\nRunning the script:\r\n\r\n```bash\r\npython  main.py\r\n```\r\n\r\n-  **Enter the eBook topic**: \"The Future of AI\"\r\n\r\n-  **Enter the number of chapters**: 5\r\n\r\n-  **Choose a template (1-5)**: 2 (Modern)\r\n\r\n  \r\n\r\nThe script will produce `ebook.pdf` with the generated content styled according to the chosen template.\r\n\r\n  \r\n\r\n## Files\r\n\r\n-  `add_wkhtmltopdf-to-path.bat`: A batch script to add `wkhtmltopdf` to the system `PATH` on Windows.\r\n- `config.py`: Contains the API Key.\r\n- `main.py`: The Main Program\r\n- `requirements.txt`: The Project Requirements.\r\n- `templates/`: this folder contains all default templates \r\n\r\n\r\n## Project Structure\r\n\r\n  \r\n```\r\neBook-Generator/\r\n\t├── main.py\r\n\t├── config.py\r\n\t├── requirements.txt\r\n\t├── add_wkhtmltopdf-to-path.bat\r\n\t├── templates/\r\n\t│ ├── classic.html\r\n\t│ ├── modern.html\r\n\t│ ├── minimalist.html\r\n\t│ ├── elegant.html\r\n\t│ ├── dark.html\r\n\r\n```\r\n\r\nBy following this guide, you should be able to generate an eBook in PDF format using different templates provided in the `templates` folder.\r\n\r\n## Contribution\r\n\r\nWe welcome contributions to enhance this project! Please refer to our [Contributing Guidelines](CONTRIBUTING.md) for detailed instructions on how to contribute.\r\n\r\n## Code of Conduct\r\n\r\nWe expect all contributors to adhere to our [Code of Conduct](CODE_OF_CONDUCT.md). Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [your-email@example.com]. All complaints will be reviewed and investigated promptly and fairly.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenoobis%2Fai-ebook-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenoobis%2Fai-ebook-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenoobis%2Fai-ebook-generator/lists"}