Skip to content

Commit fb4eb63

Browse files
authored
Merge pull request #256557 from Homebrew/html-to-markdown-new-formula
html-to-markdown 2.5.0 (new formula)
2 parents 8167198 + e73bbfe commit fb4eb63

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Formula/h/html-to-markdown.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
class HtmlToMarkdown < Formula
2+
desc "Transforms HTML (even entire websites) into clean, readable Markdown"
3+
homepage "https://html-to-markdown.com"
4+
url "https://github.com/JohannesKaufmann/html-to-markdown/archive/refs/tags/v2.5.0.tar.gz"
5+
sha256 "da15e96199bea9ed610996548f43eae19059edc364ac08baf107c0777fefbea5"
6+
license "MIT"
7+
head "https://github.com/JohannesKaufmann/html-to-markdown.git", branch: "main"
8+
9+
bottle do
10+
sha256 cellar: :any_skip_relocation, arm64_tahoe: "e981d5e00545a518711ac932cd67108ea14efe6a9f66585b68f274a830b6dc99"
11+
sha256 cellar: :any_skip_relocation, arm64_sequoia: "e981d5e00545a518711ac932cd67108ea14efe6a9f66585b68f274a830b6dc99"
12+
sha256 cellar: :any_skip_relocation, arm64_sonoma: "e981d5e00545a518711ac932cd67108ea14efe6a9f66585b68f274a830b6dc99"
13+
sha256 cellar: :any_skip_relocation, sonoma: "ee47b6c4ae135218396b7e4b38acfd2096158f853586bf6e5f829b82358648f8"
14+
sha256 cellar: :any_skip_relocation, arm64_linux: "4544cefddf21f3e7bc6a4288bb2c74d9b247676e9327b898ff1292718c149d54"
15+
sha256 cellar: :any_skip_relocation, x86_64_linux: "3980c2ba3963118b9166de4bb4f1f23635c6d33060f145bb4d738f06d7aaa2f7"
16+
end
17+
18+
depends_on "go" => :build
19+
20+
def install
21+
ldflags = %W[
22+
-s -w
23+
-X main.version=#{version}
24+
-X main.commit=#{tap.user}
25+
-X main.date=#{time.iso8601}
26+
]
27+
system "go", "build", *std_go_args(ldflags:, output: bin/"html2markdown"), "./cli/html2markdown"
28+
end
29+
30+
test do
31+
assert_match version.to_s, shell_output("#{bin}/html2markdown --version")
32+
33+
output = shell_output("echo \"<strong>important</strong>\" | #{bin}/html2markdown")
34+
assert_match "**important**", output
35+
end
36+
end

0 commit comments

Comments
 (0)