crhtml2markdown is both a Crystal library and command line interface for
converting HTML documents into Markdown format. The project aims to offer a
simple API that can be embedded in other Crystal applications while also
providing an easy to use binary for quick conversions on the command line.
At this early stage the conversion only extracts the textual content from the
HTML input. Future releases will add proper Markdown rendering of elements.
The library is currently in its early planning stage. The documentation lays out the goals and how to contribute before any implementation begins.
Add this shard to your project's shard.yml:
dependencies:
crhtml2markdown:
github: ipepe-oss/crhtml2markdownThen run shards install to fetch the dependency. Once the project publishes
releases, you will be able to use a version constraint instead of pointing to
the GitHub repository.
When installed as a shard you can use crhtml2markdown as a library:
require "crhtml2markdown"
markdown = Crhtml2markdown.convert("<p>Hello</p>")The project provides a command line interface:
$ crhtml2markdown input.html > output.mdAfter cloning the repository run the specs to ensure the environment is set up correctly:
crystal specCode style follows Crystal's formatter. Run crystal tool format before
submitting patches.
Architecture Decision Records are kept in docs/adr. Please consult existing
records and create a new one if your change introduces new decisions.
- Fork it (https://github.com/ipepe-oss/crhtml2markdown/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
- Patryk Ptasiński - creator and maintainer