url2md
is a Rust-based application that fetches HTML content from a given URL and converts it into Markdown format. This project leverages the axum
framework for building web applications and reqwest
for making HTTP requests.
- Fetch HTML content from any URL.
- Convert fetched HTML into Markdown format.
- Handle URL encoding and decoding.
- Simple API for conversion via HTTP requests.
- Rust (1.56 or later)
- Cargo
Clone the repository:
git clone https://github.com/0yik/url2md.git
cd url2md
Install dependencies:
cargo build
To run the server, execute:
cargo run
You can convert a URL to Markdown by sending a GET request to the server:
curl http://localhost:3000/https://example.com
The server will respond with the Markdown representation of the HTML content fetched from the specified URL.
To run the tests, use:
cargo test
This will execute all unit tests defined in the project.
- Endpoint:
GET /{url}
- Description: Converts the HTML content of the specified URL to Markdown.
- Response: Returns the Markdown content with a
200 OK
status. If the URL is invalid, it returns a400 Bad Request
.
curl http://localhost:3000/https://example.com
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.