Convert a Markdown file to an HTML file
426
This Docker image allows you to convert a Markdown file to an HTML file, with added functionality like syntax highlighting for code blocks, a "Copy to Clipboard" icon for each code block, and a customizable page title. The generated HTML page also includes rounded corner designs for the header and footer.
input.md file to a styled HTML file.Pull the Docker Image
Pull the image from Docker Hub:
docker pull your-dockerhub-username/markdown-to-html
Run the Container
You need to mount your current directory, which contains the input.md Markdown file, to the /app directory inside the container. Additionally, pass a string argument for the page title.
Run the container using the following command:
docker run --rm -v $(pwd):/app your-dockerhub-username/markdown-to-html "Your Page Title"
This command will:
/app directory inside the container.input.md (which should exist in your current directory) to an HTML file."Your Page Title" will be used as the title of the generated HTML file.Generated HTML File
The HTML file will be generated in your current directory with a filename derived from the page title, where spaces are replaced with hyphens. For example:
docker run --rm -v $(pwd):/app your-dockerhub-username/markdown-to-html "My Custom Page"
This will generate my-custom-page.html in your current directory.
input.md)# Welcome to My Page
Here’s a simple code example:
```python
print("Hello, World!")
### Output (HTML)
The generated HTML file will include syntax highlighting and a "Copy to Clipboard" button for each code block, along with the custom title and page design.
## Customization
The following customizations are available:
- **Page Title**: Pass your custom title when running the Docker container.
- **Copy to Clipboard**: The "Copy to Clipboard" functionality is automatically applied to every code block in the Markdown file.
## Source Code
The source code for this project can be found at: [GitHub](https://github.com/your-repo)
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Change placeholders:
your-dockerhub-username with your Docker Hub username.https://github.com/your-repo if you're hosting the source code on GitHub.Optional:
docker tag markdown-to-html your-dockerhub-username/markdown-to-html
docker push your-dockerhub-username/markdown-to-html
Content type
Image
Digest
sha256:3de7cb5cd…
Size
51.4 MB
Last updated
almost 2 years ago
docker pull schogini/markdown-to-html