Metadata-Version: 2.4
Name: webpage2md
Version: 1.0.0
Summary: Convert HTML files and web pages to Markdown format
Project-URL: Homepage, https://github.com/nealcaren/webpage2md
Author-email: Neal Caren <neal.caren@unc.edu>
License: MIT License
        
        Copyright (c) 2024 Neal Caren
        
        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 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.
License-File: LICENSE
Keywords: converter,html,html-to-markdown,markdown,scraping,web
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Requires-Dist: beautifulsoup4
Requires-Dist: httpx
Requires-Dist: pypandoc
Requires-Dist: pytest-playwright
Description-Content-Type: text/markdown

# webpage2md

A command-line tool to convert HTML files and web pages to Markdown format.

## Features

- Convert local HTML files to Markdown
- Convert web pages to Markdown
- Support for multiple input files
- Custom output directory and filename options
- Automatic installation of required dependencies
- Uses Playwright for reliable web scraping
- Uses Pandoc for high-quality HTML to Markdown conversion

## Installation

```bash
pip install webpage2md
```

## Usage

### As a Python Package

```python
from webpage2md import convert_html, convert_url

# Convert HTML string to markdown
html = '<h1>Hello World</h1>'
markdown = convert_html(html)

# Convert webpage to markdown
markdown = convert_url('https://example.com')
```

### Command Line Usage

Basic usage:
```bash
webpage2md example.html                  # Convert local file
webpage2md https://example.com          # Convert web page
webpage2md file1.html file2.html        # Convert multiple files
```

Options:
```bash
webpage2md -o output_dir/ file.html     # Specify output directory
webpage2md -n custom_name.md file.html  # Specify output filename
webpage2md --stdout file.html           # Print to stdout
webpage2md -q file.html                 # Quiet mode
webpage2md -v file.html                 # Verbose mode
```

For help:
```bash
webpage2md --help
```

## Requirements

- Python 3.7+
- Playwright (automatically installed)
- Pandoc (automatically installed)

## License

MIT License
