homebrew-core/Formula/asciidoc.rb

56 lines
1.8 KiB
Ruby
Raw Normal View History

2011-03-10 05:11:03 +00:00
class Asciidoc < Formula
desc "Formatter/translator for text files to numerous formats. Includes a2x."
homepage "http://asciidoc.org/"
2014-12-29 07:09:57 +00:00
url "https://downloads.sourceforge.net/project/asciidoc/asciidoc/8.6.9/asciidoc-8.6.9.tar.gz"
sha256 "78db9d0567c8ab6570a6eff7ffdf84eadd91f2dfc0a92a2d0105d323cab4e1f0"
revision 1
2012-07-07 18:08:22 +00:00
2014-03-13 20:14:00 +00:00
bottle do
2015-09-23 13:36:21 +00:00
cellar :any_skip_relocation
2016-09-16 20:14:51 +00:00
sha256 "0f6e983fd2e62ddc4c13e0028e76f2e206a83f9a7371f4158c0c7997ab14634c" => :sierra
2016-08-11 18:45:04 +00:00
sha256 "2e2ab0cd2462155296a05f8982b4d0c69b48db53ab26e49483c3fc116d955b67" => :el_capitan
sha256 "e460dd7a372d465bdb2e932c02fb1339e96b7e28f47c8f750ae0546e56e517f9" => :yosemite
sha256 "fe63d108847b9b197ee4f853b52faa8eb6d5c3990cc9919567d799f1b3dbd674" => :mavericks
2014-03-13 20:14:00 +00:00
end
2013-09-22 00:27:25 +00:00
head do
url "https://github.com/asciidoc/asciidoc.git"
2014-06-02 02:38:17 +00:00
depends_on "autoconf" => :build
2013-09-22 00:27:25 +00:00
end
option "with-docbook-xsl", "Install DTDs to generate manpages"
depends_on "docbook"
depends_on "docbook-xsl" => :optional
def install
2012-08-09 23:21:05 +00:00
system "autoconf" if build.head?
system "./configure", "--prefix=#{prefix}"
# otherwise macOS's xmllint bails out
2014-12-29 07:09:57 +00:00
inreplace "Makefile", "-f manpage", "-f manpage -L"
system "make", "install"
system "make", "docs"
end
def caveats; <<-EOS.undent
If you intend to process AsciiDoc files through an XML stage
(such as a2x for manpage generation) you need to add something
like:
2015-05-11 00:54:34 +00:00
export XML_CATALOG_FILES=#{etc}/xml/catalog
to your shell rc file so that xmllint can find AsciiDoc's
catalog files.
See `man 1 xmllint' for more.
EOS
end
test do
(testpath/"test.txt").write("== Hello World!")
system "#{bin}/asciidoc", "-b", "html5", "-o", "test.html", "test.txt"
assert_match %r{\<h2 id="_hello_world"\>Hello World!\</h2\>}, File.read("test.html")
end
2009-11-21 06:38:52 +00:00
end