Skip to content

Commit 452a1fc

Browse files
committed
html-to-markdown 2.5.0 (new formula)
Signed-off-by: Patrick Linnane <[email protected]>
1 parent 5968cce commit 452a1fc

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Formula/h/html-to-markdown.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
depends_on "go" => :build
10+
11+
def install
12+
ldflags = %W[
13+
-s -w
14+
-X main.version=#{version}
15+
-X main.commit=#{tap.user}
16+
-X main.date=#{time.iso8601}
17+
]
18+
system "go", "build", *std_go_args(ldflags:, output: bin/"html2markdown"), "./cli/html2markdown"
19+
end
20+
21+
test do
22+
assert_match version.to_s, shell_output("#{bin}/html2markdown --version")
23+
24+
output = shell_output("echo \"<strong>important</strong>\" | #{bin}/html2markdown")
25+
assert_match "**important**", output
26+
end
27+
end

0 commit comments

Comments
 (0)