groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 01/01: gpinyin: new preprocessor for adding pinyin parts, the Eu


From: Bernd Warken
Subject: [groff] 01/01: gpinyin: new preprocessor for adding pinyin parts, the European-style Chinese writing
Date: Fri, 01 Aug 2014 20:01:57 +0000

bwarken pushed a commit to branch master
in repository groff.

commit b46f950a45b084518020637287471fbd11516533
Author: Bernd Warken <address@hidden>
Date:   Fri Aug 1 22:01:45 2014 +0200

    gpinyin: new preprocessor for adding pinyin parts, the European-style 
Chinese writing
---
 contrib/gpinyin/ChangeLog    |   25 +++++
 contrib/gpinyin/Makefile.sub |   64 +++++++++++
 contrib/gpinyin/gpinyin.man  |  238 ++++++++++++++++++++++++++++++++++++++++++
 contrib/gpinyin/gpinyin.pl   |  119 +++++++++++++++++++++
 4 files changed, 446 insertions(+), 0 deletions(-)

diff --git a/contrib/gpinyin/ChangeLog b/contrib/gpinyin/ChangeLog
new file mode 100644
index 0000000..150d488
--- /dev/null
+++ b/contrib/gpinyin/ChangeLog
@@ -0,0 +1,25 @@
+2014-08-01  Bernd Warken  <address@hidden>
+
+       * gpinyin.pl, gpinyin.man, ChangeLog, Makefile.sub:
+       First version 0.9.0 of gpinyin
+
+2014-08-01  Bernd Warken  <address@hidden>
+________________________________________________________________________
+License
+
+Copyright (C) 2014
+       Free Software Foundation, Inc.
+Written by Bernd Warken <address@hidden>.
+
+Copying and distribution of this file, with or without
+modification, are permitted provided the copyright notice and this
+notice are preserved.
+
+This file is part of `gpinyin', which is part of the `groff'
+project.
+
+####### Emacs settings
+
+Local Variables:
+mode: change-log
+End:
diff --git a/contrib/gpinyin/Makefile.sub b/contrib/gpinyin/Makefile.sub
new file mode 100644
index 0000000..2e47ad3
--- /dev/null
+++ b/contrib/gpinyin/Makefile.sub
@@ -0,0 +1,64 @@
+# Makefile.sub for `gpinyin' (preprocessor for added Perl parts)
+
+# File position: <groff-source>/contrib/gpinyin/Makefile.sub
+
+# Copyright (C) 2014
+#   Free Software Foundation, Inc.
+# Written by Bernd Warken <address@hidden>.
+
+# Last update: 1 Aug 2014
+
+# This file is part of `gpinyin' which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see
+# <http://www.gnu.org/licenses/gpl-2.0.html>.
+
+########################################################################
+
+MAN1=gpinyin.n
+
+MOSTLYCLEANADD=gpinyin $(MAN1)
+
+# not all make programs have $(RM) predefined.
+RM=rm -f
+
+all: gpinyin
+
+gpinyin: gpinyin.pl
+       sed -f "$(SH_DEPS_SED_SCRIPT)" \
+            -e "s|@g@|$(g)|g" \
+           -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
+           -e "s|@VERSION@|$(version)$(revision)|g" \
+           -e "$(SH_SCRIPT_SED_CMD)" \
+           $(srcdir)/gpinyin.pl >$@; \
+       chmod +x $@
+
+.PHONY: install_data
+install_data: gpinyin
+       -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
+       $(RM) $(DESTDIR)$(bindir)/gpinyin
+       $(INSTALL_SCRIPT) gpinyin $(DESTDIR)$(bindir)/gpinyin
+
+.PHONY: uninstall_sub
+uninstall_sub:
+       $(RM) $(DESTDIR)$(bindir)/gpinyin
+
+
+########################################################################
+# Emacs settings
+########################################################################
+#
+# Local Variables:
+# mode: makefile
+# End:
diff --git a/contrib/gpinyin/gpinyin.man b/contrib/gpinyin/gpinyin.man
new file mode 100644
index 0000000..bd6e8ff
--- /dev/null
+++ b/contrib/gpinyin/gpinyin.man
@@ -0,0 +1,238 @@
+.TH GPINYIN @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.SH NAME
+gpinyin \- Chinese European-like writing within groff
+.
+.SH "SYNOPSIS"
+.\" The .SH was moved to this place in order to appease `apropos'.
+.
+.\" --------------------------------------------------------------------
+.\" Legalese
+.\" --------------------------------------------------------------------
+.
+.de authors
+This file was written by Bernd Warken <address@hidden>.
+.
+Latest update: 1 Aug 2014
+..
+.
+.de copyright
+Copyright (C) 2014 Free Software Foundation, Inc.
+.
+.P
+This file is part of
+.IR \%gpinyin ,
+which is part of
+.IR \%groff ,
+a free software project.
+.
+You can redistribute it and/or modify it under the terms of the
+.nh
+.B "GNU General Public License"
+.hy
+as published by the
+.nh
+.BR "Free Software Foundation" ,
+.hy
+version\~2.
+.
+.P
+The license text is available in the internet at
+.UR http://www.gnu.org/licenses/gpl-2.0.html
+.UE .
+..
+.
+.\" --------------------------------------------------------------------
+.\" Characters
+.\" --------------------------------------------------------------------
+.
+.ie t .char \[Ellipsis] \f[S]\N'188'\f[P]
+.el .char \[Ellipsis] \&.\|.\|.\&\
+.\" called with \[Ellipsis]
+.
+.
+.\" --------------------------------------------------------------------
+.\" SH "SYNOPSIS"
+.\" --------------------------------------------------------------------
+.
+.SY gpinyin
+.OP \-
+.OP \-\-
+.OP \& "\%filespec \[Ellipsis]"
+.YS
+.
+.BR "gpinyin -h" | --help
+.br
+.BR "gpinyin -v" | --version
+.
+.
+.\" --------------------------------------------------------------------
+.SH DESCRIPTION
+.\" --------------------------------------------------------------------
+.
+This is a preprocesor for
+.BR \%groff (@MAN1EXT@).
+.
+It allows to add the Chinese European-like language
+.B pinyin
+into
+.BR groff (7)
+files.
+.
+.
+.\" --------------------------------------------------------------------
+.SH "OPTIONS"
+.\" --------------------------------------------------------------------
+.
+So far, there are only
+.I filespec
+or
+.I breaking
+options.
+.
+.
+.P
+.I filespec
+are file names or the minus character
+.B \[em]
+character for standard input.
+.
+As usual, the argument
+.B \[em]\[em]
+can be used in order to let all fowllowing arguments mean file names,
+even if the names begin with a minus character
+.BR \[em] .
+.
+.
+.P
+An option is
+.IR breaking ,
+when the program just writes the information that was asked for and
+then stops.
+.
+All other arguments will be ignored by that.
+.
+These
+.I breaking
+options are heree
+.
+.TP
+.B -h\~\fR|\fB\~--help
+Print help information with a short explanation of options to standard
+output.
+.
+.
+.TP
+.B -v\~\fR|\fB\~--version
+Print version information to standard output.
+.
+.
+.\" --------------------------------------------------------------------
+.SH "PINYIN PARTS"
+.\" --------------------------------------------------------------------
+.
+.I Pinyin
+parts in
+.I groff files
+are enclosed by two
+.B .pinyin
+requests with different arguments, a
+.I starting
+and an
+.I ending
+command.
+.
+.
+.\" --------------------------------------------------------------------
+.SS "Starting pinyin Mode"
+.\" --------------------------------------------------------------------
+.
+The starting
+.I pinyin request
+can either be without arguments, or by a request that has the term
+.B start
+as its only argument.
+.RS
+.IP \[Bullet] 2m
+.B \&.pinyin
+.IP \[Bullet] 2m
+.B \&.pinyin start
+.RE
+.
+.
+.\" --------------------------------------------------------------------
+.SS "Ending pinyin Mode without Storage"
+.\" --------------------------------------------------------------------
+.
+A
+.B .pinyin
+command line with an argument different from
+.B start
+finishes a running
+.IR "pinyin part" .
+.
+Of course, it would be reasonable to add the argument
+.B stop
+or
+.BR end ;
+that's possible, but not necessary.
+.
+.RS
+.IP \[Bullet] 2m
+.B \&.pinyin stop
+.IP \[Bullet] 2m
+.BI \&.pinyin " other_than_start"
+.RE
+.
+.
+.\" --------------------------------------------------------------------
+.SH "SEE ALSO"
+.\" --------------------------------------------------------------------
+.
+.P
+Man\-pages related to
+.I groff
+are
+.BR \%groff (@MAN1EXT@),
+.BR \%groff (@MAN7EXT@),
+.BR \%groff_char (@MAN7EXT@),
+.BR \%grog (@MAN1EXT@),
+and
+.BR \%groffer (@MAN1EXT@).
+.
+.
+.P
+Documents related to
+.I pinyin
+are
+.UR http://\;www.sino.uni-heidelberg.de/\:course_resources/\:s02/\:\
+py-vowels.htm
+.I Unicode vowels for pinyin 
+.UE ,
+.
+.UR http://\:www.foolsworkshop.com/\:ptou/\:index.html
+.IR pinyin to Unicode
+.UE ,
+.
+.UR http://www.mandarintools.com/
+.I Online Chinese Tools
+.UE .
+.
+.\" --------------------------------------------------------------------
+.SH "AUTHOR"
+.\" --------------------------------------------------------------------
+.authors
+.
+.
+.\" --------------------------------------------------------------------
+.SH "COPYING"
+.\" --------------------------------------------------------------------
+.copyright
+.
+.
+.\" --------------------------------------------------------------------
+.\" Emacs settings
+.\" --------------------------------------------------------------------
+.
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/contrib/gpinyin/gpinyin.pl b/contrib/gpinyin/gpinyin.pl
new file mode 100755
index 0000000..c1b3ce0
--- /dev/null
+++ b/contrib/gpinyin/gpinyin.pl
@@ -0,0 +1,119 @@
+#! /usr/bin/env perl
+
+# gpinyin - European-like Chinese writing `pinyin' into `groff'
+
+# Source file position: <groff-source>/contrib/gpinyin/gpinyin.pl
+# Installed position: <prefix>/bin/gpinyin
+
+# Copyright (C) 2014
+#   Free Software Foundation, Inc.
+
+# Written by Bernd Warken <address@hidden>.
+
+my $Latest_Update = '1 Aug 2014';
+my $version = '0.9.0';
+
+# This file is part of `gpinyin', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+
+# You can find a copy of the GNU General Public License in the internet
+# at <http://www.gnu.org/licenses/gpl-2.0.html>.
+
+########################################################################
+
+use strict;
+use warnings;
+#use diagnostics;
+
+# temporary dir and files
+use File::Temp qw/ tempfile tempdir /;
+
+# needed for temporary dir
+use File::Spec;
+
+# for `copy' and `move'
+use File::Copy;
+
+# for fileparse, dirname and basename
+use File::Basename;
+
+# current working directory
+use Cwd;
+
+# $Bin is the directory where this script is located
+use FindBin;
+
+# for running the perl parts with the `Perl' programs and getting output
+# also useful for shell programs
+use IPC::System::Simple qw(capture capturex run runx system systemx);
+
+
+########################################################################
+# system variables and exported variables
+########################################################################
+
+$\ = "\n";     # final part for print command
+
+########################################################################
+# read-only variables with double-@ construct
+########################################################################
+
+our $File_split_env_sh;
+our $File_version_sh;
+our $Groff_Version;
+
+my $before_make;               # script before run of `make'
+{
+  my $at = '@';
+  $before_make = 1 if '@VERSION@' eq "${at}VERSION${at}";
+}
+
+my %at_at;
+my $file_gpinyin_test_pl;
+my $groffer_libdir;
+
+if ($before_make) {
+  my $gpinyin_source_dir = $FindBin::Bin;
+  $at_at{'BINDIR'} = $gpinyin_source_dir;
+  $at_at{'G'} = '';
+} else {
+  $at_at{'BINDIR'} = '@BINDIR@';
+  $at_at{'G'} = '@g@';
+}
+
+
+########################################################################
+# options
+########################################################################
+
+foreach (@ARGV) {
+  if ( /^(-h|--h|--he|--hel|--help)$/ ) {
+    print q(Usage for the `gpinyin' program:);
+    print 'gpinyin [-] [--] [filespec...] normal file name arguments';
+    print 'gpinyin [-h|--help]            gives usage information';
+    print 'gpinyin [-v|--version]         displays the version number';
+    print q(This program is a `groff' preprocessor that handles ) .
+      q(pinyin parts in `roff' files.);
+    exit;
+  } elsif ( /^(-v|--v|--ve|--ver|--vers|--versi|--versio|--version)$/ ) {
+    print q(`gpinyin' version ) . $version . ' of ' . $Latest_Update;
+    exit;
+  }
+}
+
+
+1;
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: CPerl
+# End:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]