格式化XML DocBook的推荐工具链是什么?
我见过,但我的问题略有不同。相对于编辑工具,目前推荐的XML DocBook格式化工具链是什么 在Eric Raymond的《从2003年开始》(一本优秀的书!)中,建议是XML-FO(XML格式化对象),但我在这里看到的建议表明XML-FO不再处于开发阶段(尽管我在StackOverflow上再也找不到这个问题,所以可能是错误的) 假设我主要对Unix/Linux(包括MacOS X)感兴趣,但我不会自动忽略仅限Windows的解决方案格式化XML DocBook的推荐工具链是什么?,xml,apache,pdf,apache-fop,docbook,Xml,Apache,Pdf,Apache Fop,Docbook,我见过,但我的问题略有不同。相对于编辑工具,目前推荐的XML DocBook格式化工具链是什么 在Eric Raymond的《从2003年开始》(一本优秀的书!)中,建议是XML-FO(XML格式化对象),但我在这里看到的建议表明XML-FO不再处于开发阶段(尽管我在StackOverflow上再也找不到这个问题,所以可能是错误的) 假设我主要对Unix/Linux(包括MacOS X)感兴趣,但我不会自动忽略仅限Windows的解决方案 最好的办法是什么?有其他选择吗?一种流行的方法是使用。我
最好的办法是什么?有其他选择吗?一种流行的方法是使用。我一直在用DocBook在cygwin下手工编写,以生成一页HTML、多页HTML、CHM和PDF 我安装了以下软件:
AC_INIT(Makefile.in)
FOP=fop.sh
HHC=hhc
XSLTPROC=xsltproc
AC_ARG_WITH(fop, [ --with-fop Where to find Apache FOP],
[
if test "x$withval" != "xno"; then
FOP="$withval"
fi
]
)
AC_PATH_PROG(FOP, $FOP)
AC_ARG_WITH(hhc, [ --with-hhc Where to find Microsoft Help Compiler],
[
if test "x$withval" != "xno"; then
HHC="$withval"
fi
]
)
AC_PATH_PROG(HHC, $HHC)
AC_ARG_WITH(xsltproc, [ --with-xsltproc Where to find xsltproc],
[
if test "x$withval" != "xno"; then
XSLTPROC="$withval"
fi
]
)
AC_PATH_PROG(XSLTPROC, $XSLTPROC)
AC_SUBST(FOP)
AC_SUBST(HHC)
AC_SUBST(XSLTPROC)
HERE=`pwd`
AC_SUBST(HERE)
AC_OUTPUT(Makefile)
cat > config.nice <<EOT
#!/bin/sh
./configure \
--with-fop='$FOP' \
--with-hhc='$HHC' \
--with-xsltproc='$XSLTPROC' \
EOT
chmod +x config.nice
自动生成上述文件输出
我更喜欢使用nix方法编写脚本,因为工具集更容易找到和使用,更不用说更容易链接。关于Apache的FOP问题:当我们建立工具链(类似Gustavo所建议的)时,我们使用。XEPs输出看起来更加完美,据我回忆,FOP在表方面有一些问题(这是几年前的事了,但可能已经改变了)。DocBook样式表和FOP工作得很好,但我最终决定使用RenderX,它更全面地涵盖了标准,并且具有DocBook样式表所利用的一些不错的扩展
Bob Stayton的书描述了几种替代的工具链,包括在Linux或Windows上工作的工具链(几乎可以肯定是MacOS,尽管我个人没有使用过Mac)。我们用于编辑,Maven的插件用于在构建过程中创建输出。对于一组好的模板,请查看或提供。对于HTML输出,我使用XSLT处理器xsltproc 对于PDF输出,我使用,它转换为LaTeX,然后使用pdflatex将其编译为PDF。(我以前使用过Jade、DSSL样式表和jadetex。)我们使用
- Eclipse(纯xml编辑,主要由技术人员使用)
- 自己的特定Eclipse插件(仅用于我们的发行说明)
- Maven docbkx插件
- 基于标准docbook样式表,带有特定公司样式表的Maven jar
- 用于将csv转换为DocBook表的Maven插件
- Maven插件,用于提取BugZilla数据并从中创建DocBook节
- Hudson(生成PDF文档)
- Nexus部署创建的PDF文档
Fresh创建了一个Maven HTML Cleaner插件,它使(测试版可用)成为可能。欢迎通过论坛提供反馈。使用FOP,您可以获得某些人认为他们非常想要实现的功能。我要说的是,任何一个认真对待出版的人都不会在生产中使用它。你最好使用RenderX或天线室或。(在过去十年的实施项目中,我一直在使用它们。)这取决于您的业务需求、您希望自动化的程度以及您的团队的技能、时间和资源。这不仅仅是一个技术问题。如果你使用的是Red Hat、Ubuntu或Windows,你可以看看Publican,它应该是一个相当完整的命令行工具链。红帽广泛使用它
- Wiki此处:
- 文件在此:
- 这里有tarballs和exe的来源:
FOP=@FOP@
HHC=@HHC@
XSLTPROC=@XSLTPROC@
HERE=@HERE@
# Subdirs that contain docs
DOCS=appendixes chapters reference
XML_CATALOG_FILES=./build/docbook-xsl-1.71.0/catalog.xml
export XML_CATALOG_FILES
all: entities.ent manual.xml html
clean:
@echo -e "\n=== Cleaning\n"
@-rm -f html/*.html html/HTML.manifest pdf/* chm/*.html chm/*.hhp chm/*.hhc chm/*.chm entities.ent .ent
@echo -e "Done.\n"
dist-clean:
@echo -e "\n=== Restoring defaults\n"
@-rm -rf .ent autom4te.cache config.* configure Makefile html/*.html html/HTML.manifest pdf/* chm/*.html chm/*.hhp chm/*.hhc chm/*.chm build/docbook-xsl-1.71.0
@echo -e "Done.\n"
entities.ent: ./build/mkentities.sh $(DOCS)
@echo -e "\n=== Creating entities\n"
@./build/mkentities.sh $(DOCS) > .ent
@if [ ! -f entities.ent ] || [ ! cmp entities.ent .ent ]; then mv .ent entities.ent ; fi
@echo -e "Done.\n"
# Build the docs in chm format
chm: chm/htmlhelp.hpp
@echo -e "\n=== Creating CHM\n"
@echo logo.png >> chm/htmlhelp.hhp
@echo arrow.gif >> chm/htmlhelp.hhp
@-cd chm && "$(HHC)" htmlhelp.hhp
@echo -e "Done.\n"
chm/htmlhelp.hpp: entities.ent build/docbook-xsl manual.xml build/chm.xsl
@echo -e "\n=== Creating input for CHM\n"
@"$(XSLTPROC)" --output ./chm/index.html ./build/chm.xsl manual.xml
# Build the docs in HTML format
html: html/index.html
html/index.html: entities.ent build/docbook-xsl manual.xml build/html.xsl
@echo -e "\n=== Creating HTML\n"
@"$(XSLTPROC)" --output ./html/index.html ./build/html.xsl manual.xml
@echo -e "Done.\n"
# Build the docs in PDF format
pdf: pdf/manual.fo
@echo -e "\n=== Creating PDF\n"
@"$(FOP)" ./pdf/manual.fo ./pdf/manual.pdf
@echo -e "Done.\n"
pdf/manual.fo: entities.ent build/docbook-xsl manual.xml build/pdf.xsl
@echo -e "\n=== Creating input for PDF\n"
@"$(XSLTPROC)" --output ./pdf/manual.fo ./build/pdf.xsl manual.xml
check: manual.xml
@echo -e "\n=== Checking correctness of manual\n"
@xmllint --valid --noout --postvalid manual.xml
@echo -e "Done.\n"
# need to touch the dir because the timestamp in the tarball
# is older than that of the tarball :)
build/docbook-xsl: build/docbook-xsl-1.71.0.tar.gz
@echo -e "\n=== Un-taring docbook-xsl\n"
@cd build && tar xzf docbook-xsl-1.71.0.tar.gz && touch docbook-xsl-1.71.0