Permalink
Browse files

initial commit

  • Loading branch information...
zag committed May 27, 2010
0 parents commit a0b6326936d46b0ca940a44d55be16ee804b407b
@@ -0,0 +1,26 @@
+# gmake PREFIX=/tmp install
+
+SUBDIRS = xml book
+
+all: $(SUBDIRS)
+ @echo Use: gmake \<target\>
+ @echo --------------- Available targets:
+ @echo package - make connector package
+
+install:
+ for dir in $(SUBDIRS); do \
+ $(MAKE) -C $$dir $@; \
+ done
+
+$(SUBDIRS) :
+ ${MAKE} -C $@
+
+clean:
+ for dir in $(SUBDIRS); do \
+ $(MAKE) -C $$dir $@; \
+ done
+
+#walk subdirs
+.PHONY: subdirs $(SUBDIRS)
+
+#subdirs: GNUmakefile.ink $(SUBDIRS)
23 README
@@ -0,0 +1,23 @@
+ru-perl6-book
+===================
+
+Book about perl6.
+
+INSTALLATION
+
+To build this book type the following:
+
+ gmake
+
+DEPENDENCIES
+
+For book creation it is necessary following software:
+ * docbook-4.5
+ * fop-0.95
+ * Perl6-Pod-0.17
+
+Project site: http://zag.ru/perl6-book/
+
+All material in this repository is licensed under a CC-by-nc-sa license:
+<http://creativecommons.org/licenses/by-nc-sa/2.5/> (attribution,
+noncommercial, share-alike), unless explicitly stated otherwise.
@@ -0,0 +1,22 @@
+#*************************
+# VARIABLES
+#*************************
+include ../tools/Makefile.base-vars
+
+NAME = book
+OUTNAME = ru-perl6-book
+DIR = book
+#FO_XSL= fo.book-stylesheet.xsl
+#include ../tools/Makefile.base
+
+include ../tools/Makefile.base-rules
+
+IMAGES = img
+
+#all: pdf
+
+#IMAGES = img
+#$(FO_TARGET):
+# java -Xmx256M -classpath "1/xslthl-2.0.1.jar:/usr/local/share/java/classes/saxon.jar" \
+# -Dxslthl.config="file:///home/zag/Work/proj/WebDAO.site/tmp/1/highlighters/xslthl-config.xml" \
+# com.icl.saxon.StyleSheet -o $(FO_TARGET) $(XML_SOURCE) fo.book-stylesheet.xsl
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR1//EN"
+ "file:///usr/local/share/xml/docbook/4.5/docbookx.dtd" [
+<!ENTITY bookinfo SYSTEM "bookinfo.xml">
+<!ENTITY spec_rss SYSTEM "../xml/test.xml">
+]>
+<book lang="ru">
+&bookinfo;
+&spec_rss;
+</book>
@@ -0,0 +1,28 @@
+<bookinfo>
+ <title>Все о perl6</title>
+ <subtitle>Справочное руководство</subtitle>
+ <pubdate>27.05.2010</pubdate>
+ <author>
+ <firstname>А</firstname>
+ <surname>Загацкий</surname>
+ <affiliation>
+ <orgname></orgname>
+ <address><email>zahatski@gmail.com</email> </address>
+ </affiliation>
+ </author>
+ <revhistory>
+ <revision>
+ <revnumber>v0.1</revnumber>
+ <date>May 27th 2010</date>
+ <authorinitials>zag</authorinitials>
+ <revremark>Начальная версия</revremark>
+ </revision>
+
+ </revhistory>
+
+ <abstract>
+ <para>
+Данная книга являкется сборником статей о perl6 </para>
+ </abstract>
+
+</bookinfo>
@@ -0,0 +1,8 @@
+=begin pod
+=NAME Предисловие
+
+=head1 О этой книге
+
+Perl6 - современный язык.
+
+=end pod
@@ -0,0 +1,26 @@
+
+include ../tools/Makefile.base-vars
+NAME ?= book
+OUTNAME ?= book
+DIR ?= book
+IMAGES ?= $(DIR)/images/*.png
+INSTALL_DIR ?= $(DESTDIR)/tmp
+include ../tools/Makefile.base-rules
+
+# Compatibility targets - the book buildsystem had quite target names which
+# were either redundant or overly verbose. These remain for a little while,
+# whilst scripts are adapted, and people retrain their fingers.
+all-book: all
+all-pdf: pdf
+all-ps: ps
+book-version: version
+book-html: html
+book-html-chunk: html-chunk
+book-pdf: pdf
+book-ps: ps
+install-book: install
+install-book-html: install-html
+install-book-html-chunk: install-html-chunk
+install-book-pdf: install-pdf
+install-book-ps: install-ps
+book-clean: clean
@@ -0,0 +1,88 @@
+
+all: img html html-multi-file pdf
+#all: html html-multi-file pdf
+install: install-html install-html-arch install-html-chunk install-html-chunk-arc install-pdf
+
+img:
+ mkdir -p img
+# $(INSTALL_DATA) ../xml/img/* $(IMAGES)
+
+txt: $(TXT_TARGET)
+$(TXT_TARGET):
+ $(XSLTPROC) $(FO_XSL) $(XML_SOURCE) > $(FILE).fo
+ $(FOP) $(FILE).fo -txt $(FILE).txt
+ rm -f $(FILE).fo
+
+html: $(HTML_TARGET)
+$(HTML_TARGET):
+ $(XSLTPROC) -o $@ $(XHTML_XSL) $(XML_SOURCE)
+
+html-multi-file: $(HTML_CHUNK_TARGET)
+$(HTML_CHUNK_TARGET):
+ mkdir -p $(HTML_CHUNK_DIR)
+ $(XSLTPROC) $(HTML_XSLTPROC_OPTS) \
+ --output $(HTML_CHUNK_DIR)/ \
+ $(HTML_CHUNK_XSL) $(XML_SOURCE)
+ #mkdir -p $(HTML_CHUNK_DIR)/img
+ #$(INSTALL_DATA) $(IMAGES)/* $(HTML_CHUNK_DIR)/img
+
+
+pdf: $(PDF_TARGET)
+$(PDF_TARGET): $(FO_TARGET)
+ $(FOP) $(FO_TARGET) -pdf $(PDF_TARGET) -c $(TOOLS_DIR)/conf/fop.xconf
+
+fo: $(FO_TARGET)
+$(FO_TARGET):
+ $(XSLTPROC) $(FO_ARGS) --output $(FO_TARGET) $(FO_XSL) $(XML_SOURCE)
+
+html-multi-file-arch: $(HTML_CHUNK_ARCH_TARGET)
+$(HTML_CHUNK_ARCH_TARGET): $(HTML_CHUNK_TARGET)
+ rm -rf $(HTML_CHUNK_ARCH_BASENAME) && \
+ $(MAKE) install-html-chunk \
+ INSTALL_SUBDIR=$(HTML_CHUNK_ARCH_BASENAME) && \
+ $(ARCH_CMD) $@ $(HTML_CHUNK_ARCH_BASENAME) && \
+ rm -rf $(HTML_CHUNK_ARCH_BASENAME)
+
+
+html-arch: $(HTML_ARCH_TARGET)
+$(HTML_ARCH_TARGET): $(HTML_TARGET)
+ rm -rf $(HTML_ARCH_BASENAME) && \
+ $(MAKE) install-html INSTALL_SUBDIR=$(HTML_ARCH_BASENAME) && \
+ zip -r $@ $(HTML_ARCH_BASENAME) && \
+ rm -rf $(HTML_ARCH_BASENAME)
+
+# Install targets
+$(INSTALL_SUBDIR):
+ $(MKDIR) $(INSTALL_SUBDIR)
+
+install-html-chunk: $(HTML_CHUNK_TARGET) $(INSTALL_SUBDIR)
+ $(INSTALL_DATA) $(HTML_CHUNK_DIR)/*.html $(INSTALL_SUBDIR)
+ $(INSTALL_DATA) $(STYLESHEET) $(INSTALL_SUBDIR)
+ mkdir -p $(INSTALL_SUBDIR)/img
+ $(INSTALL_DATA) $(IMAGES)/* $(INSTALL_SUBDIR)/img
+
+install-html-chunk-arc: $(HTML_CHUNK_ARCH_TARGET) $(INSTALL_SUBDIR)
+ $(INSTALL_DATA) $(HTML_CHUNK_ARCH_TARGET) $(INSTALL_SUBDIR)
+
+
+install-html: $(HTML_TARGET) $(INSTALL_SUBDIR)
+ $(INSTALL_DATA) $(HTML_TARGET) $(INSTALL_SUBDIR)
+ $(INSTALL_DATA) $(STYLESHEET) $(INSTALL_SUBDIR)
+ mkdir -p $(INSTALL_SUBDIR)/img
+ $(INSTALL_DATA) $(IMAGES)/* $(INSTALL_SUBDIR)/img
+
+install-html-arch: $(HTML_ARCH_TARGET) $(INSTALL_SUBDIR)
+ $(INSTALL_DATA) $(HTML_ARCH_TARGET) $(INSTALL_SUBDIR)
+
+install-pdf: $(PDF_TARGET) $(INSTALL_SUBDIR)
+ $(INSTALL_DATA) $(PDF_TARGET) $(INSTALL_SUBDIR)
+
+# Clean targets
+clean:
+ rm -f $(HTML_TARGET) $(FO_TARGET) $(PDF_TARGET)
+ rm -f $(HTML_ARCH_TARGET) $(HTML_CHUNK_ARCH_TARGET)
+ rm -rf $(HTML_CHUNK_DIR)
+ #unlink $(DIR) if empty
+ rm -rf $(DIR)
+ rm -rf img
+
@@ -0,0 +1,74 @@
+# This file - Makefile.base-vars - together with the file Makefile.base-rules,
+# make up a reusable buildsystem for DocBook XML books.
+# The split into two files is required because of the nature of Make variables:
+# In the case of variables used in commands, expansion occurs when the commands
+# are executed, so values can be overridden by defining a new value after the
+# rule definition - BUT in the case of variables used to specify targets and
+# sources, expansion occurs when Make parses the rule. Therefore, any override
+# must take place BEFORE the rule definition. Since this Makefile fragment
+# wishes to both provide defaults and allow overriding of target and source
+# file names, it is necessary to place the default variable definitions in
+# one file, and the rules in another, so that overrides may be specified
+# after the defaults, but before the rules - like this:
+#
+# include ../tools/Makefile.base-vars
+# NAME = my-book
+# DIR = my-book-dir
+# include ../tools/Makefile.base-rules
+#
+# Note that this is a Makefile fragment intended for inclusion. As a result,
+# all relative paths contained within are relative to including Makefile's
+# directory, not to this fragment's directory. The TOOLS_DIR and DIR variables
+# should be overridden if necessary to ensure proper paths are used.
+
+NAME ?= NOT_DEFINED_NAME
+OUTNAME ?=$(NAME)
+DIR ?= .
+
+DOCDIR ?= ../../WebDAO/contrib
+TOOLS_DIR ?= ../tools
+WWW_DIR ?= ../www
+
+POD2DOC= $(TOOLS_DIR)/podToDocbook.pl
+XSL_DIR = $(TOOLS_DIR)
+FILE = book
+XSLTPROC = /usr/local/bin/xsltproc
+FOP = /usr/local/bin/fop
+MKDIR= mkdir -p
+INSTALL_DATA = cp -R
+
+
+PREFIX = /usr/share/sgml/docbook
+PREFIX = /usr/local/share/xsl/docbook
+FO_XSL = $(PREFIX)/docbook-xsl-1.64.1/fo/docbook.xsl
+FO_XSL = $(PREFIX)/fo/docbook.xsl
+FO_ARGS = --stringparam fop1.extensions 1
+#--stringparam paper.type A4
+# --stringparam l10n.gentext.language ru \
+# --stringparam highlight.source 1
+#--stringparam use.extensions 1
+
+ARCH_CMD = zip -r
+HTML_XSL = $(PREFIX)/html/docbook.xsl # Gentoo DB HTML
+HTML_CHUNK_XSL = $(PREFIX)/html/chunk.xsl # Gentoo DB HTML CHUNK
+HTML_CHUNK_XSL = $(PREFIX)/xhtml/chunk.xsl
+HTML_CHUNK_XSL = $(TOOLS_DIR)/chunk-stylesheet.xsl
+HTML_XSL = $(PREFIX)/html/docbook.xsl
+XHTML_XSL = $(PREFIX)/xhtml/docbook.xsl
+XHTML_XSL = $(XSL_DIR)/html-stylesheet.xsl
+STYLESHEET = $(WWW_DIR)/docstyles.css
+
+TXT_TARGET=$(DIR)/$(OUTNAME).txt
+HTML_TARGET=$(DIR)/$(OUTNAME).html
+PDF_TARGET=$(DIR)/$(OUTNAME).pdf
+FO_TARGET= $(DIR)/$(OUTNAME).fo
+HTML_ARCH_BASENAME = $(OUTNAME)-html
+HTML_ARCH_TARGET= $(DIR)/$(HTML_ARCH_BASENAME).zip
+
+HTML_CHUNK_ARCH_BASENAME = $(OUTNAME)-html-chunk
+HTML_CHUNK_ARCH_TARGET = $(DIR)/$(HTML_CHUNK_ARCH_BASENAME).zip
+
+HTML_CHUNK_DIR = $(DIR)/html-chunk
+HTML_CHUNK_TARGET = $(HTML_CHUNK_DIR)/index.html
+XML_SOURCE = $(NAME).xml
+
@@ -0,0 +1,27 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
+
+ <xsl:param name="html.stylesheet">docstyles.css</xsl:param>
+ <xsl:param name="html.title">TITLE</xsl:param>
+ <xsl:param name="toc.section.depth">3</xsl:param>
+ <xsl:param name="annotate.toc">0</xsl:param>
+
+ <xsl:template match="sect1" mode="toc">
+ <xsl:param name="toc-context" select="."/>
+ <xsl:call-template name="subtoc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ <xsl:with-param name="nodes"
+ select="sect2|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="sect2" mode="toc">
+ <xsl:param name="toc-context" select="."/>
+
+ <xsl:call-template name="subtoc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ <xsl:with-param name="nodes"
+ select="sect3|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
+ </xsl:call-template>
+ </xsl:template>
+
+</xsl:stylesheet>
@@ -0,0 +1,15 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
+
+ <xsl:import href="xsl/xhtml/chunk.xsl"/>
+ <xsl:include href="base-html-stylesheet.xsl"/>
+
+ <!-- PARAMETER REFERENCE: -->
+ <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/ -->
+
+ <!-- Uncomment this to enable auto-numbering of sections -->
+ <!-- xsl:param name="section.autolabel" select="1" / -->
+ <!-- <xsl:param name="use.id.as.filename">1</xsl:param> -->
+ <xsl:param name="chunk.first.sections">1</xsl:param>
+ <xsl:param name="chunk.quietly" select="1"></xsl:param>
+
+</xsl:stylesheet>

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit a0b6326

Please sign in to comment.