{"id":23207717,"url":"https://github.com/robotdad/web2md","last_synced_at":"2025-04-05T11:27:37.595Z","repository":{"id":266740328,"uuid":"899149891","full_name":"robotdad/web2md","owner":"robotdad","description":"Save a webpage and images as markdown","archived":false,"fork":false,"pushed_at":"2024-12-05T22:05:19.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T22:32:06.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robotdad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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-12-05T17:59:42.000Z","updated_at":"2024-12-05T22:05:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7dcbd50-6a29-4d9d-854c-a6fa20b9ba4d","html_url":"https://github.com/robotdad/web2md","commit_stats":null,"previous_names":["robotdad/web2md"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotdad%2Fweb2md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotdad%2Fweb2md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotdad%2Fweb2md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotdad%2Fweb2md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robotdad","download_url":"https://codeload.github.com/robotdad/web2md/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247328288,"owners_count":20921161,"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":[],"created_at":"2024-12-18T17:25:30.791Z","updated_at":"2025-04-05T11:27:37.587Z","avatar_url":"https://github.com/robotdad.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Here's an updated README for your `web2md.py` script:\n\n```markdown\n# Web2MD\n\nWeb2MD is a Python script that downloads a web page and converts it into a Markdown document. The script is designed to preserve the structure of the original webpage while including images, without following any links.\n\n## Features\n\n- Downloads a single web page and converts it to Markdown format\n- Saves the Markdown file with images in an organized directory structure\n- Uses a date-based folder structure for each conversion\n- Optionally configurable output directory via an environment variable\n\n## Requirements\n\n- Python 3.10+\n- `requests` and `beautifulsoup4` Python libraries\n\n## Installation\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/robotdad/web2md.git\n   cd web2md\n   ```\n\n2. Set up a virtual environment:\n   ```bash\n   python -m venv .venv\n   ```\n\n3. Activate the virtual environment:\n   - On Windows:\n     ```bash\n     .venv\\Scripts\\Activate.ps1\n     ```\n   - On macOS and Linux:\n     ```bash\n     source .venv/bin/activate\n     ```\n\n4. Install the required dependencies:\n   ```bash\n   pip install requests beautifulsoup4\n   ```\n\n## Configuration\n\n### Environment Variables (.env)\n\n- `BASE_OUTPUT_DIR`: Optional. The base directory where converted web pages will be saved. If not set, output defaults to `output/\u003cdate\u003e/\u003cdomain\u003e/` in the current working directory.\n\n## Usage\n\nEnsure your virtual environment is activated, then run the script with:\n\n```bash\npython web2md.py \u003cURL\u003e [--clean-transcripts]\n```\n\nReplace `\u003cURL\u003e` with the web page you want to convert. Options:\n\n- `--clean-transcripts`: Optional. Attempts to clean up and format transcript-style text that may be mangled in the conversion process. This is particularly useful for podcast transcripts or interview content.\n\nThe script will:\n\n1. Download the specified web page.\n2. Convert the HTML content to Markdown.\n3. Save the markdown file and images in a structured directory based on the current date and the domain of the URL.\n\n## Output Structure\n\n```\nBASE_OUTPUT_DIR/\n└── YYYY-MM-DD/\n    └── domain.tld/\n        └── index.md\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Troubleshooting\n\n- Ensure the URL provided is correct and try to visit it in a browser first to check for any issues.\n- Make sure you have the permissions to write in the output directory specified.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotdad%2Fweb2md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobotdad%2Fweb2md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotdad%2Fweb2md/lists"}