diff --git a/doc/common/cookbook.xsl b/doc/common/cookbook.xsl new file mode 100644 index 000000000..8c04ca82d --- /dev/null +++ b/doc/common/cookbook.xsl @@ -0,0 +1,20 @@ + + + + + +

+ +

+
+ +
diff --git a/doc/cookbook/Makefile.am b/doc/cookbook/Makefile.am index e29460972..473fb12d3 100644 --- a/doc/cookbook/Makefile.am +++ b/doc/cookbook/Makefile.am @@ -33,7 +33,11 @@ VIDEO_FILES = \ videos/animations-fading-in-then-out.ogv \ $(NULL) -EXTRA_DIST = clutter-cookbook.xml.in $(IMAGE_FILES) $(XML_FILES) +EXTRA_DIST = \ + clutter-cookbook.xml.in \ + $(IMAGE_FILES) \ + $(XML_FILES) \ + $(VIDEO_FILES) CLEANFILES = \ pdf-build.stamp \ @@ -46,9 +50,18 @@ pdf-build.stamp: clutter-cookbook.xml && echo timestamp > $(@F) html-build.stamp: clutter-cookbook.xml + if [ ! -d html ] ; then mkdir html ; fi && \ + if [ ! -d html/images ] ; then mkdir html/images ; fi && \ + if [ ! -d html/videos ] ; then mkdir html/videos ; fi && \ $(XSLTPROC) $(XSLTOPTS) -o clutter-cookbook.html $(XSL_XHTML_URI) $(top_builddir)/doc/cookbook/clutter-cookbook.xml && \ - $(XSLTPROC) $(XSLTOPTS) -o html/ ref-html-style.xsl $(top_builddir)/doc/cookbook/clutter-cookbook.xml && \ - cp $(top_srcdir)/doc/common/style.css html/ && \ + $(XSLTPROC) $(XSLTOPTS) -o html/ cookbook.xsl $(top_builddir)/doc/cookbook/clutter-cookbook.xml && \ + cp $(top_srcdir)/doc/common/style.css html/ && \ + if [[ "$(VIDEO_FILES)" != "" ]] ; then \ + for file in `ls $(VIDEO_FILES)`; do \ + cp $$file html/videos/ ; \ + done \ + fi && \ + cp images/* html/images/ && \ echo timestamp > $(@F) if ENABLE_PDFS @@ -95,6 +108,17 @@ install-data-local: fi \ done; \ fi; \ + if [ -d ./videos ] && [[ "$(VIDEO_FILES)" != "" ]] ; \ + then \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)/videos ; \ + for file in `ls $(VIDEO_FILES)`; do \ + if [ -f $$file ]; \ + then \ + basefile=`echo $$file | sed -e 's,^.*/,,'`; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(TARGET_DIR)/videos/$$basefile; \ + fi \ + done; \ + fi; \ $(INSTALL_DATA) html/clutter-cookbook.devhelp $(DESTDIR)$(TARGET_DIR)/clutter-cookbook.devhelp .PHONY : doc diff --git a/doc/cookbook/clutter-cookbook.xml.in b/doc/cookbook/clutter-cookbook.xml.in index da98ea3c4..fce2d3a12 100644 --- a/doc/cookbook/clutter-cookbook.xml.in +++ b/doc/cookbook/clutter-cookbook.xml.in @@ -60,7 +60,7 @@ If adding a new recipe, use the recipe-template.xml XML file as a basis. - You can find it in the <clutter_source>/doc/cookbook/ + You can find it in the <clutter source>/doc/cookbook/ directory. @@ -103,6 +103,70 @@ Use the <note> element for asides which might otherwise interrupt the flow of the recipe. + + To include a video in a recipe, do the following: + + + Make the video as short as is practical, and only include + the relevant Clutter window(s). + + + + Use Ogg Theora for the encoding. + + + + Put the file into the + <clutter source>/doc/cookbook/videos + directory. The name should be in the format + <section>-<recipe>-<identifier>.ogv. + For example: animations-fading-fade-out.ogv. + + + + Add the name of the file to the + in the cookbook's Makefile.am, e.g. + + + + + + + + This ensures it gets included in the distribution and + installation. + + + + Use an <inlinemediaobject> to include it in the + Docbook recipe file. It should look something like this: + + + + + + + + + Video showing an actor fading in then out using + ClutterState + + +]]> + + + + The <alt> tag provides the text which + is presented as a link to the file for users whose browser + doesn't support HTML 5 embedded video. + + + diff --git a/doc/cookbook/videos/README b/doc/cookbook/videos/README new file mode 100644 index 000000000..cee46c963 --- /dev/null +++ b/doc/cookbook/videos/README @@ -0,0 +1 @@ +Put videos for inclusion in cookbook (Ogg Theora, preferably) here.