Name | medium-publish JSON |
Version |
0.2.0
JSON |
| download |
home_page | None |
Summary | None |
upload_time | 2025-01-12 13:42:08 |
maintainer | None |
docs_url | None |
author | Raphael MANSUY |
requires_python | <4.0,>=3.12 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# medium-publish
## Overview
**Medium Publish** is a Python package designed to streamline the process of converting Markdown files into HTML, while also enabling the embedding of images and publishing code snippets as Gists on GitHub. This tool is particularly useful for writers and developers who want to share their content on Medium with rich formatting and embedded resources.
## Features
- **Markdown Processing**: Convert Markdown files to HTML with support for code blocks and lists.
- **Image Handling**: Automatically embed images from URLs or local paths into the generated HTML.
- **Gist Publishing**: Publish code snippets as Gists on GitHub and replace them in the HTML with links.
- **Clipboard Support**: Copy the final HTML output directly to your clipboard for easy sharing.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [File Structure](#file-structure)
- [Configuration](#configuration)
- [Contributing](#contributing)
- [License](#license)
## Installation
To install Medium Publish, you need to have Python 3.12 or higher. You can install the package using Poetry:
```bash
poetry install
```
## Usage
To use Medium Publish, run the command line interface (CLI) tool with the required parameters:
```bash
medium-publish <file_path> [--output <output_path>] [--embed-images]
```
### Parameters
- `file_path`: The path to the Markdown file you want to process.
- `--output`: (Optional) Specify an output file path for the modified HTML.
- `--embed-images`: (Optional) Use this flag to embed images in the output HTML.
### Example
```bash
medium-publish my_article.md --output my_article.html --embed-images
```
This command will process `my_article.md`, embed any images found, and save the output as `my_article.html`.
## File Structure
The project is organized as follows:
```
medium_publish/
├── __init__.py # Package initialization
├── image_processor.py # Image downloading and embedding logic
├── process_file.py # Markdown processing functions
├── copy_to_clipboard.py # Functionality to copy HTML to clipboard
├── main.py # Main entry point for CLI tool
└── .gitignore # Git ignore file
pyproject.toml # Project metadata and dependencies
README.md # Project documentation
```
## Configuration
Before running Medium Publish, ensure you have set your GitHub token in your environment variables:
```bash
export GITHUB_TOKEN="your_github_token"
```
This token is required for publishing Gists.
## Contributing
Contributions are welcome! If you have suggestions or improvements, please fork the repository and submit a pull request.
1. Fork it (https://github.com/yourusername/medium-publish/fork)
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a pull request
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "medium-publish",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": null,
"author": "Raphael MANSUY",
"author_email": "raphael.mansuy@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e3/b2/7eab3fca07344fcf8697afb3230c21ba545cd1d72f69fb0a21d5ddc94c6a/medium_publish-0.2.0.tar.gz",
"platform": null,
"description": "# medium-publish\n\n## Overview\n\n**Medium Publish** is a Python package designed to streamline the process of converting Markdown files into HTML, while also enabling the embedding of images and publishing code snippets as Gists on GitHub. This tool is particularly useful for writers and developers who want to share their content on Medium with rich formatting and embedded resources.\n\n## Features\n\n- **Markdown Processing**: Convert Markdown files to HTML with support for code blocks and lists.\n- **Image Handling**: Automatically embed images from URLs or local paths into the generated HTML.\n- **Gist Publishing**: Publish code snippets as Gists on GitHub and replace them in the HTML with links.\n- **Clipboard Support**: Copy the final HTML output directly to your clipboard for easy sharing.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [File Structure](#file-structure)\n- [Configuration](#configuration)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\nTo install Medium Publish, you need to have Python 3.12 or higher. You can install the package using Poetry:\n\n```bash\npoetry install\n```\n\n## Usage\n\nTo use Medium Publish, run the command line interface (CLI) tool with the required parameters:\n\n```bash\nmedium-publish <file_path> [--output <output_path>] [--embed-images]\n```\n\n### Parameters\n\n- `file_path`: The path to the Markdown file you want to process.\n- `--output`: (Optional) Specify an output file path for the modified HTML.\n- `--embed-images`: (Optional) Use this flag to embed images in the output HTML.\n\n### Example\n\n```bash\nmedium-publish my_article.md --output my_article.html --embed-images\n```\n\nThis command will process `my_article.md`, embed any images found, and save the output as `my_article.html`.\n\n## File Structure\n\nThe project is organized as follows:\n\n```\nmedium_publish/\n\u251c\u2500\u2500 __init__.py # Package initialization\n\u251c\u2500\u2500 image_processor.py # Image downloading and embedding logic\n\u251c\u2500\u2500 process_file.py # Markdown processing functions\n\u251c\u2500\u2500 copy_to_clipboard.py # Functionality to copy HTML to clipboard\n\u251c\u2500\u2500 main.py # Main entry point for CLI tool\n\u2514\u2500\u2500 .gitignore # Git ignore file\npyproject.toml # Project metadata and dependencies\nREADME.md # Project documentation\n```\n\n## Configuration\n\nBefore running Medium Publish, ensure you have set your GitHub token in your environment variables:\n\n```bash\nexport GITHUB_TOKEN=\"your_github_token\"\n```\n\nThis token is required for publishing Gists.\n\n## Contributing\n\nContributions are welcome! If you have suggestions or improvements, please fork the repository and submit a pull request. \n\n1. Fork it (https://github.com/yourusername/medium-publish/fork)\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "0.2.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e5040b8cc7c0684efd026a97f5f6b2f23393ca1df5bf56fe876b8439508bfeee",
"md5": "867d1e83a6cf2d368dd8afe0ad03d7ec",
"sha256": "823f27f191f425b1a958bdad0d1734c3638c35767e0d93890973fc4b6968691a"
},
"downloads": -1,
"filename": "medium_publish-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "867d1e83a6cf2d368dd8afe0ad03d7ec",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 12668,
"upload_time": "2025-01-12T13:42:06",
"upload_time_iso_8601": "2025-01-12T13:42:06.909771Z",
"url": "https://files.pythonhosted.org/packages/e5/04/0b8cc7c0684efd026a97f5f6b2f23393ca1df5bf56fe876b8439508bfeee/medium_publish-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e3b27eab3fca07344fcf8697afb3230c21ba545cd1d72f69fb0a21d5ddc94c6a",
"md5": "e5f39d7c912a68d946856db6616e9033",
"sha256": "d957a10c22660d369990be2cc379289a2800e30268c6af3fb526afe5cc873407"
},
"downloads": -1,
"filename": "medium_publish-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "e5f39d7c912a68d946856db6616e9033",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 10453,
"upload_time": "2025-01-12T13:42:08",
"upload_time_iso_8601": "2025-01-12T13:42:08.204794Z",
"url": "https://files.pythonhosted.org/packages/e3/b2/7eab3fca07344fcf8697afb3230c21ba545cd1d72f69fb0a21d5ddc94c6a/medium_publish-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-12 13:42:08",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "medium-publish"
}