2011-03-10 05:11:03 +00:00
|
|
|
class Asciidoc < Formula
|
2016-08-19 15:01:16 +00:00
|
|
|
desc "Formatter/translator for text files to numerous formats. Includes a2x."
|
2015-05-25 01:29:11 +00:00
|
|
|
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"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "78db9d0567c8ab6570a6eff7ffdf84eadd91f2dfc0a92a2d0105d323cab4e1f0"
|
2016-08-11 18:37:44 +00:00
|
|
|
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
|
2015-05-25 01:29:11 +00:00
|
|
|
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
|
2009-06-04 18:21:19 +00:00
|
|
|
|
2015-04-22 06:50:02 +00:00
|
|
|
option "with-docbook-xsl", "Install DTDs to generate manpages"
|
2015-10-05 03:34:29 +00:00
|
|
|
|
|
|
|
depends_on "docbook"
|
2015-04-22 06:50:02 +00:00
|
|
|
depends_on "docbook-xsl" => :optional
|
|
|
|
|
2009-06-04 18:21:19 +00:00
|
|
|
def install
|
2012-08-09 23:21:05 +00:00
|
|
|
system "autoconf" if build.head?
|
2011-09-04 19:12:43 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}"
|
2011-10-29 16:21:52 +00:00
|
|
|
|
2016-10-02 05:53:52 +00:00
|
|
|
# otherwise macOS's xmllint bails out
|
2014-12-29 07:09:57 +00:00
|
|
|
inreplace "Makefile", "-f manpage", "-f manpage -L"
|
|
|
|
system "make", "install"
|
2016-08-11 18:37:44 +00:00
|
|
|
system "make", "docs"
|
2009-06-04 18:21:19 +00:00
|
|
|
end
|
2013-05-07 00:06:49 +00:00
|
|
|
|
|
|
|
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
|
2013-05-07 00:06:49 +00:00
|
|
|
|
|
|
|
to your shell rc file so that xmllint can find AsciiDoc's
|
|
|
|
catalog files.
|
|
|
|
|
|
|
|
See `man 1 xmllint' for more.
|
|
|
|
EOS
|
|
|
|
end
|
2014-12-29 07:17:55 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.txt").write("== Hello World!")
|
|
|
|
system "#{bin}/asciidoc", "-b", "html5", "-o", "test.html", "test.txt"
|
2015-10-05 03:34:29 +00:00
|
|
|
assert_match %r{\<h2 id="_hello_world"\>Hello World!\</h2\>}, File.read("test.html")
|
2014-12-29 07:17:55 +00:00
|
|
|
end
|
2009-11-21 06:38:52 +00:00
|
|
|
end
|