[FFmpeg-devel] [PATCH] Use makeinfo instead of texi2html

Timothy Gu timothygu99 at gmail.com
Mon Mar 10 01:55:25 CET 2014


From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

Texi2html has been deprecated in favor of makeinfo, see:
https://wiki.debian.org/Texi2htmlTransition.

Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
---
Changed from Andreas's original t2h.pm:
* Chapters are made <h1> to preserve texi2html behavior
* Renamed to t2h.init

Changed from earlier patch:
* Rewrote t2h.init for new syntax

Lackings:
* @float is currently ugly
* Page title is not the original "FFmpeg documentation : Blah"
* *-all still doesn't build on my laptop with texinfo
  5.1.dfsg.1-4ubuntu1 (Ubuntu Saucy)
* (optional) No dual texi2html and makeinfo support
---
 configure         |   5 +--
 doc/Makefile      |   4 +-
 doc/platform.texi |   2 +-
 doc/t2h.init      | 123 +++++++++---------------------------------------------
 4 files changed, 24 insertions(+), 110 deletions(-)

diff --git a/configure b/configure
index c215478..7669aa1 100755
--- a/configure
+++ b/configure
@@ -1667,7 +1667,6 @@ HAVE_LIST="
     sys_un_h
     sys_videoio_h
     termios_h
-    texi2html
     threads
     unistd_h
     usleep
@@ -2447,7 +2446,7 @@ ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
 # documentation
 podpages_deps="perl"
 manpages_deps="perl pod2man"
-htmlpages_deps="perl texi2html"
+htmlpages_deps="perl makeinfo"
 txtpages_deps="perl makeinfo"
 doc_deps_any="manpages htmlpages podpages txtpages"
 
@@ -4582,7 +4581,6 @@ else
 fi
 enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
 
-texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
 makeinfo --version > /dev/null 2>&1 && enable makeinfo  || disable makeinfo
 perl -v            > /dev/null 2>&1 && enable perl      || disable perl
 pod2man --help     > /dev/null 2>&1 && enable pod2man   || disable pod2man
@@ -4997,7 +4995,6 @@ echo "safe bitstream reader     ${safe_bitstream_reader-no}"
 echo "SDL support               ${sdl-no}"
 echo "opencl enabled            ${opencl-no}"
 echo "libzvbi enabled           ${libzvbi-no}"
-echo "texi2html enabled         ${texi2html-no}"
 echo "perl enabled              ${perl-no}"
 echo "pod2man enabled           ${pod2man-no}"
 echo "makeinfo enabled          ${makeinfo-no}"
diff --git a/doc/Makefile b/doc/Makefile
index 44049c4..196626f 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -81,12 +81,12 @@ $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
 doc/%.html: TAG = HTML
 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
 	$(Q)$(TEXIDEP)
-	$(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
+	$(M)makeinfo --html -I doc --no-split -D config-not-all --init-file=$(SRC_PATH)/doc/t2h.init --output $@ $<
 
 doc/%-all.html: TAG = HTML
 doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
 	$(Q)$(TEXIDEP)
-	$(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
+	$(M)makeinfo --html -I doc --no-split -D config-all --init-file=$(SRC_PATH)/doc/t2h.init --output $@ $<
 
 doc/%.pod: TAG = POD
 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
diff --git a/doc/platform.texi b/doc/platform.texi
index 934a3ae..d707ef3 100644
--- a/doc/platform.texi
+++ b/doc/platform.texi
@@ -263,7 +263,7 @@ llrint() in its C library.
 Install your Cygwin with all the "Base" packages, plus the
 following "Devel" ones:
 @example
-binutils, gcc4-core, make, git, mingw-runtime, texi2html
+binutils, gcc4-core, make, git, mingw-runtime, texinfo
 @end example
 
 In order to run FATE you will also need the following "Utils" packages:
diff --git a/doc/t2h.init b/doc/t2h.init
index e7760f4..a076be7 100644
--- a/doc/t2h.init
+++ b/doc/t2h.init
@@ -1,115 +1,32 @@
-# no horiz rules between sections
-$end_section = \&FFmpeg_end_section;
-sub FFmpeg_end_section($$)
-{
-}
+# Set the doctype to html.
+set_from_init_file('DOCTYPE', '<!DOCTYPE html>');
 
-$EXTRA_HEAD =
-'<link rel="icon" href="favicon.png" type="image/png" />
-';
+# Add an icon.
+set_from_init_file('EXTRA_HEAD', '<link rel="icon" href="favicon.png" type="image/png" />');
 
-$CSS_LINES = $ENV{"FFMPEG_CSS"} || <<EOT;
-<link rel="stylesheet" type="text/css" href="default.css" />
-EOT
+# Use the defaul.css file.
+set_from_init_file('CSS_LINES', '<link rel="stylesheet" type="text/css" href="default.css" />');
 
-my $TEMPLATE_HEADER = $ENV{"FFMPEG_HEADER"} || <<EOT;
-<link rel="icon" href="favicon.png" type="image/png" />
-</head>
-<body>
-<div id="container">
+# Add additional div's at the beginning of the body and close them before the end.
+set_from_init_file('AFTER_BODY_OPEN', '<div id="container">
 <div id="body">
-EOT
+');
+set_from_init_file('PRE_BODY_CLOSE', '</div></div>');
 
-$PRE_BODY_CLOSE = '</div></div>';
+# empty body text
+set_from_init_file('BODYTEXT', '');
 
-$SMALL_RULE = '';
-$BODYTEXT = '';
-
-$print_page_foot = \&FFmpeg_print_page_foot;
-sub FFmpeg_print_page_foot($$)
-{
-    my $fh = shift;
-    my $program_string = defined &T2H_DEFAULT_program_string ?
-        T2H_DEFAULT_program_string() : program_string();
-    print $fh '<footer class="footer pagination-right">' . "\n";
-    print $fh '<span class="label label-info">' . $program_string;
-    print $fh "</span></footer></div></div></body>\n";
-}
-
-$float = \&FFmpeg_float;
-
-sub FFmpeg_float($$$$)
-{
-    my $text = shift;
-    my $float = shift;
-    my $caption = shift;
-    my $shortcaption = shift;
-
-    my $label = '';
-    if (exists($float->{'id'}))
-    {
-        $label = &$anchor($float->{'id'});
-    }
-    my $class = '';
-    my $subject = '';
-
-    if ($caption =~ /NOTE/)
-    {
-        $class = "alert alert-info";
-    }
-    elsif ($caption =~ /IMPORTANT/)
-    {
-        $class = "alert alert-warning";
-    }
-
-    return '<div class="float ' . $class . '">' . "$label\n" . $text . '</div>';
-}
-
-$print_page_head = \&FFmpeg_print_page_head;
-sub FFmpeg_print_page_head($$)
-{
-    my $fh = shift;
-    my $longtitle = "$Texi2HTML::THISDOC{'fulltitle_no_texi'}";
-    $longtitle .= ": $Texi2HTML::NO_TEXI{'This'}" if exists $Texi2HTML::NO_TEXI{'This'};
-    my $description = $DOCUMENT_DESCRIPTION;
-    $description = $longtitle if (!defined($description));
-    $description = "<meta name=\"description\" content=\"$description\">" if
-         ($description ne '');
-    $description = $Texi2HTML::THISDOC{'documentdescription'} if (defined($Texi2HTML::THISDOC{'documentdescription'}));
-    my $encoding = '';
-    $encoding = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$ENCODING\">" if (defined($ENCODING) and ($ENCODING ne ''));
-    $longtitle =~ s/Documentation.*//g;
-    $longtitle = "FFmpeg documentation : " . $longtitle;
-
-    print $fh <<EOT;
-<!DOCTYPE html>
-<html>
-$Texi2HTML::THISDOC{'copying'}<!-- Created on $Texi2HTML::THISDOC{today} by $Texi2HTML::THISDOC{program} -->
-<!--
-$Texi2HTML::THISDOC{program_authors}
--->
-<head>
-<title>$longtitle</title>
-
-$description
-<meta name="keywords" content="$longtitle">
-<meta name="Generator" content="$Texi2HTML::THISDOC{program}">
-$encoding
-$CSS_LINES
-$TEMPLATE_HEADER
-EOT
-}
-
-# declare encoding in header
-$IN_ENCODING = $ENCODING = "utf-8";
+# Write the creation time in the footer.
+set_from_init_file('PROGRAM_NAME_IN_FOOTER', "+");
 
 # no navigation elements
-$SECTION_NAVIGATION = 0;
-# the same for texi2html 5.0
-$HEADERS = 0;
+set_from_init_file('HEADERS', 0);
 
 # TOC and Chapter headings link
-$TOC_LINKS = 1;
+set_from_init_file('TOC_LINKS', 1);
 
 # print the TOC where @contents is used
-$INLINE_CONTENTS = 1;
+set_from_init_file('INLINE_CONTENTS', 1);
+
+# Make chapters <h1>
+set_from_init_file('CHAPTER_HEADER_LEVEL', 1);
-- 
1.8.3.2



More information about the ffmpeg-devel mailing list