summaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
authorAnton Berezin <tobez@FreeBSD.org>2005-12-23 13:03:36 +0000
committerAnton Berezin <tobez@FreeBSD.org>2005-12-23 13:03:36 +0000
commit83e2e3f0ff83d1db751f080a26d130a388f75df3 (patch)
tree97b04fc24c514b7eb6db64cc96052a03dbe7c915 /textproc
parentAdd SHA256 checksum (diff)
Add textproc/p5-HTML-Truncate 0.03, a Perl module that truncates HTML by
character count while preserving well-formedness.
Notes
Notes: svn path=/head/; revision=151916
Diffstat (limited to 'textproc')
-rw-r--r--textproc/Makefile1
-rw-r--r--textproc/p5-HTML-Truncate/Makefile32
-rw-r--r--textproc/p5-HTML-Truncate/distinfo3
-rw-r--r--textproc/p5-HTML-Truncate/pkg-descr14
-rw-r--r--textproc/p5-HTML-Truncate/pkg-plist5
5 files changed, 55 insertions, 0 deletions
diff --git a/textproc/Makefile b/textproc/Makefile
index b91bb536b474..be240028ad27 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -300,6 +300,7 @@
SUBDIR += p5-HTML-Fraction
SUBDIR += p5-HTML-TagFilter
SUBDIR += p5-HTML-Tidy
+ SUBDIR += p5-HTML-Truncate
SUBDIR += p5-Hash-Merge
SUBDIR += p5-IDNA-Punycode
SUBDIR += p5-IO-CSVHeaderFile
diff --git a/textproc/p5-HTML-Truncate/Makefile b/textproc/p5-HTML-Truncate/Makefile
new file mode 100644
index 000000000000..f822fe0a6633
--- /dev/null
+++ b/textproc/p5-HTML-Truncate/Makefile
@@ -0,0 +1,32 @@
+# New ports collection makefile for: textproc/p5-HTML-Truncate
+# Date created: 23 December 2005
+# Whom: Anton Berezin <tobez@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= HTML-Truncate
+PORTVERSION= 0.03
+CATEGORIES= textproc www perl5
+MASTER_SITES= ${MASTER_SITE_PERL_CPAN}
+MASTER_SITE_SUBDIR= HTML
+PKGNAMEPREFIX= p5-
+
+MAINTAINER= perl@FreeBSD.org
+COMMENT= truncate HTML by character count while preserving well-formedness
+
+BUILD_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/HTML/TokeParser.pm:${PORTSDIR}/www/p5-HTML-Parser \
+ ${SITE_PERL}/${PERL_ARCH}/HTML/Entities.pm:${PORTSDIR}/www/p5-HTML-Parser
+RUN_DEPENDS= ${BUILD_DEPENDS}
+
+PERL_CONFIGURE= yes
+
+MAN3= HTML::Truncate.3
+
+.include <bsd.port.pre.mk>
+
+.if ${PERL_LEVEL} < 500800
+IGNORE= requires perl 5.8.0 or later. Install lang/perl5.8 and try again
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/textproc/p5-HTML-Truncate/distinfo b/textproc/p5-HTML-Truncate/distinfo
new file mode 100644
index 000000000000..176aeca7d731
--- /dev/null
+++ b/textproc/p5-HTML-Truncate/distinfo
@@ -0,0 +1,3 @@
+MD5 (HTML-Truncate-0.03.tar.gz) = 1c3232619a1487de745f1b513538c0e1
+SHA256 (HTML-Truncate-0.03.tar.gz) = b0032e7cb02dc5aa1670d456e0e65bd1dffce3eafcb5986b1dcc6e726a319274
+SIZE (HTML-Truncate-0.03.tar.gz) = 8407
diff --git a/textproc/p5-HTML-Truncate/pkg-descr b/textproc/p5-HTML-Truncate/pkg-descr
new file mode 100644
index 000000000000..d388856a072c
--- /dev/null
+++ b/textproc/p5-HTML-Truncate/pkg-descr
@@ -0,0 +1,14 @@
+When working with text it is convenient and common to want to truncate
+strings to make them fit a desired context. E.g., you might have a menu
+that is only 100px wide and prefer text doesn't wrap so you'd truncate
+it around 15-30 characters, depending on preference and typeface size.
+This is trivial with plain text and substr but with HTML it is somewhat
+difficult because whitespace has fluid significance and open tags that
+are not properly closed destroy well-formedness and can wreck an entire
+layout.
+
+HTML::Truncate attempts to account for those two problems by padding
+truncation for spacing and entities and closing any tags that remain
+open at the point of truncation.
+
+WWW: http://search.cpan.org/dist/HTML-Truncate/
diff --git a/textproc/p5-HTML-Truncate/pkg-plist b/textproc/p5-HTML-Truncate/pkg-plist
new file mode 100644
index 000000000000..6d0d8ddcbdbb
--- /dev/null
+++ b/textproc/p5-HTML-Truncate/pkg-plist
@@ -0,0 +1,5 @@
+%%SITE_PERL%%/HTML/Truncate.pm
+%%SITE_PERL%%/%%PERL_ARCH%%/auto/HTML/Truncate/.packlist
+@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/HTML/Truncate 2>/dev/null || true
+@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/HTML 2>/dev/null || true
+@unexec rmdir %D/%%SITE_PERL%%/HTML 2>/dev/null || true