diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e72047d --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +*.swp +*~ +*.ind +doc/zhmakeindex.idx +*.bbl +*.blg +*.ilg +*.aux +*.out +doc/zhmakeindex.pdf +doc/zhm-version.tex +bin/ diff --git a/.hgignore b/.hgignore deleted file mode 100644 index b75d469..0000000 --- a/.hgignore +++ /dev/null @@ -1,23 +0,0 @@ -syntax: glob -**.ilg -**.ind -**.swp -**.aux -**.glo -**.hd -**.out -**.sty -**.tmp -**.zip -**.synctex.gz -**~ -bin/darwin_x64/zhmakeindex -bin/darwin_x86/zhmakeindex -bin/linux_x64/zhmakeindex -bin/linux_x86/zhmakeindex -doc/zhmakeindex.pdf -**.bbl -doc/zhmakeindex.idx -**.blg -**.log -doc/zhm-version.tex diff --git a/CJK/maketables.go b/CJK/maketables.go index 836ac4d..6d677e3 100644 --- a/CJK/maketables.go +++ b/CJK/maketables.go @@ -1,5 +1,3 @@ -// $Id$ - // +build ignore // 本程序生成 zhmakeindex/CJK 使用的汉字数据表。 diff --git a/README b/README index c4a31c4..2f71c4b 100644 --- a/README +++ b/README @@ -33,7 +33,7 @@ The PDF documentation is also available for details. More information, bugfix releases and bug tracker are available at: - https://code.google.com/p/zhmakeindex/ + https://github.com/leo-liu/zhmakeindex COPYRIGHT AND LICENCE ===================== diff --git a/build-dist.cmd b/build-dist.cmd index 018e633..21e408d 100644 --- a/build-dist.cmd +++ b/build-dist.cmd @@ -7,7 +7,7 @@ if exist VERSION ( ) else ( set zhmVersion=devel ) -for /f "delims=" %%i in ('hg parent --template "{rev}({node|short})"') do set zhmRevision=%%i +for /f "delims=" %%i in ('git rev-parse --short HEAD') do set zhmRevision=%%i set FLAGS=-ldflags "-X main.Version %zhmVersion% -X main.Revision %zhmRevision%" set GOOS=windows diff --git a/doc/make.cmd b/doc/make.cmd index 2142dda..0a14ffd 100644 --- a/doc/make.cmd +++ b/doc/make.cmd @@ -12,7 +12,7 @@ if exist ..\VERSION ( ) echo }>> zhm-version.tex echo \def\zhmRevision{%%>> zhm-version.tex -hg parent --template "{rev}({node|short})" >> zhm-version.tex +git rev-parse --short HEAD >> zhm-version.tex echo }>> zhm-version.tex echo ==========^> Compiling document... diff --git a/doc/zhmakeindex.tex b/doc/zhmakeindex.tex index 3fd8bd9..1dc051c 100644 --- a/doc/zhmakeindex.tex +++ b/doc/zhmakeindex.tex @@ -1,4 +1,3 @@ -% $Id$ \documentclass[UTF8,hyperref]{ctexart} \usepackage{etoolbox} @@ -113,7 +112,7 @@ \def\zhmVersion{???}% \def\zhmRevision{???}} -\title{\zhm\thanks{版本 \zhmVersion-rev\zhmRevision} 中文索引处理程序} +\title{\zhm\thanks{版本 \zhmVersion-\zhmRevision} 中文索引处理程序} \author{刘海洋} \date{2015 年 3 月 6 日} @@ -238,7 +237,7 @@ \section{索引项输入语法} \begin{idxexample} "\indexentry{简介}{15}" \\ \sindex -简介, 15 +简介, 15 \end{idxexample} 其语法为: \begin{syntax} @@ -302,7 +301,7 @@ \section{索引项输入语法} \sitem 代数方程 \\ \ssitem 二次方程, 3 \\ \ssitem 线性方程, 2 \\ -\sitem 解, 1 +\sitem 解, 1 \end{idxexample} 每一级别内部都可以分别指定排序的键与输出值,例如: \begin{idxexample} @@ -323,7 +322,7 @@ \section{索引项输入语法} 括号被忽略,输出时会自动加上(用\autoref{tab:oldoutputstyle} 中的 \kw{encap_prefix}, \kw{encap_infix}, \kw{encap_suffix} 项配置)。例如: \begin{idxexample} -"\indexentry{字体|emph}{2}" +"\indexentry{字体|emph}{2}" \sindex 字体, \emph{2} \end{idxexample} @@ -813,38 +812,46 @@ \section{版权与许可} \begin{verbatim} build-dist.cmd input.go +install.cmd main.go +MENIFEST numberedreader.go output.go -radicalstrokes.go +pagenumber.go radical_collator.go -readings.go reading_collator.go +README sorter.go -strokes.go stroke_collator.go style.go style_test.go +VERSION +doc/make.cmd doc/zhmakeindex.bib doc/zhmakeindex.mst doc/zhmakeindex.tex +examples/compositepage.idx +examples/gb2312.idx +examples/mixedpage.idx +examples/numbers.idx +examples/rangeencap.idx +examples/suffix.ist +examples/symorder.idx +examples/zh.ist kpathsea/dynamic_other.go kpathsea/dynamic_windows_386.go kpathsea/kpathsea.go -maketables/make-table.cmd -maketables/maketables.go +CJK/make-table.cmd +CJK/maketables.go +CJK/radicalstrokes.go +CJK/strokes.go +CJK/readings.go \end{verbatim} 以及编译源文件得到的二进制文件 \path{zhmakeindex.exe} 或 \path{zhmakeindex}、 PDF 文档 \path{zhmakeindex.pdf} 组成。 \index{Unicode} -大部分汉字数据来自 Unicode 项目(\url{http://www.unicode.org/}): -\begin{verbatim} -maketables/CJKRadicals.txt -maketables/Unihan_DictionaryLikeData.txt -maketables/Unihan_RadicalStrokeCounts.txt -maketables/Unihan_Readings.txt -\end{verbatim} +大部分汉字数据来自 Unicode 项目(\url{http://www.unicode.org/})。 \index{海峰五笔} 部分字形数据来自海峰五笔项目(\url{http://okuc.net/sunwb/}): diff --git a/input.go b/input.go index 228b016..b2d9d4c 100644 --- a/input.go +++ b/input.go @@ -1,5 +1,3 @@ -// $Id$ - package main import ( diff --git a/install.cmd b/install.cmd index dcfafc0..ec5224b 100644 --- a/install.cmd +++ b/install.cmd @@ -7,9 +7,9 @@ if exist VERSION ( ) else ( set zhmVersion=devel ) -for /f "delims=" %%i in ('hg parent --template "{rev}({node|short})"') do set zhmRevision=%%i +for /f "delims=" %%i in ('git rev-parse --short HEAD') do set zhmRevision=%%i set FLAGS=-ldflags "-X main.Version %zhmVersion% -X main.Revision %zhmRevision%" go install %FLAGS% -endlocal \ No newline at end of file +endlocal diff --git a/kpathsea/kpathsea.go b/kpathsea/kpathsea.go index 29f066f..d2bdce6 100644 --- a/kpathsea/kpathsea.go +++ b/kpathsea/kpathsea.go @@ -1,5 +1,5 @@ // 提供 kpathsea 库的基本文件查找功能 -package kpathsea +package kpathsea // import "github.com/leo-liu/zhmakeindex/kpathsea" import ( "os" diff --git a/main.go b/main.go index c5e39fe..5275e99 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,5 @@ -// $Id$ - // zhmakeindex: 带中文支持的 makeindex 实现 -package main +package main // import "github.com/leo-liu/zhmakeindex" import ( "flag" @@ -40,7 +38,7 @@ func main() { setupLog(option) - log.Printf("zhmakeindex 版本:%s-rev%s\t作者:%s\n", Version, Revision, ProgramAuthor) + log.Printf("zhmakeindex 版本:%s-%s\t作者:%s\n", Version, Revision, ProgramAuthor) if option.style != "" { log.Printf("正在读取格式文件 %s……", option.style) @@ -218,5 +216,5 @@ zhmakeindex [-c] [-i] [-o ] [-q] [-r] [-s ] [-t ] fmt.Fprintf(os.Stderr, " -%-6s %-8s %s\n", f.Name, f.DefValue, f.Usage) } }) - fmt.Fprintf(os.Stderr, "\n版本:%s-rev%s\t作者:%s\n", Version, Revision, ProgramAuthor) + fmt.Fprintf(os.Stderr, "\n版本:%s-%s\t作者:%s\n", Version, Revision, ProgramAuthor) } diff --git a/numberedreader.go b/numberedreader.go index 646d038..9fafea8 100644 --- a/numberedreader.go +++ b/numberedreader.go @@ -1,5 +1,3 @@ -// $Id: numberedreader.go,v 46e1b534c25a 2014/02/25 18:14:30 leoliu $ - package main import ( diff --git a/output.go b/output.go index 4ed26e4..0031c9f 100644 --- a/output.go +++ b/output.go @@ -1,5 +1,3 @@ -// $Id$ - package main import ( diff --git a/pagenumber.go b/pagenumber.go index 1917d20..02d2724 100644 --- a/pagenumber.go +++ b/pagenumber.go @@ -1,5 +1,3 @@ -// $Id$ - package main import ( diff --git a/radical_collator.go b/radical_collator.go index 0f1f608..3524137 100644 --- a/radical_collator.go +++ b/radical_collator.go @@ -1,5 +1,3 @@ -// $Id$ - package main import ( @@ -7,7 +5,7 @@ import ( "unicode" "unicode/utf8" - "code.google.com/p/zhmakeindex/CJK" + "github.com/leo-liu/zhmakeindex/CJK" ) // 汉字按部首-除部首笔画数排序,汉字按部首分组排在英文字母组后面 diff --git a/reading_collator.go b/reading_collator.go index 94eb872..7348d55 100644 --- a/reading_collator.go +++ b/reading_collator.go @@ -1,12 +1,10 @@ -// $Id$ - package main import ( "unicode" "unicode/utf8" - "code.google.com/p/zhmakeindex/CJK" + "github.com/leo-liu/zhmakeindex/CJK" ) // 汉字按拼音排序,按拼音首字母与英文一起分组 diff --git a/sorter.go b/sorter.go index 19d188a..3109186 100644 --- a/sorter.go +++ b/sorter.go @@ -1,5 +1,3 @@ -// $Id$ - package main import ( diff --git a/stroke_collator.go b/stroke_collator.go index 9057a14..43f87e4 100644 --- a/stroke_collator.go +++ b/stroke_collator.go @@ -1,5 +1,3 @@ -// $Id$ - package main import ( @@ -7,7 +5,7 @@ import ( "unicode" "unicode/utf8" - "code.google.com/p/zhmakeindex/CJK" + "github.com/leo-liu/zhmakeindex/CJK" ) // 汉字按笔画排序,汉字按笔画分组排在英文字母组后面 diff --git a/style.go b/style.go index 91783ee..1e516a7 100644 --- a/style.go +++ b/style.go @@ -1,5 +1,3 @@ -// $Id$ - package main import ( @@ -13,7 +11,7 @@ import ( "golang.org/x/text/transform" - "code.google.com/p/zhmakeindex/kpathsea" + "github.com/leo-liu/zhmakeindex/kpathsea" ) // 输入格式