view doc/interpreter/images.awk @ 10791:3140cb7a05a1

Add spellchecker scripts for Octave and run spellcheck of documentation interpreter/doccheck: New directory for spelling/grammar scripts. interpreter/doccheck/README: Instructions for using scripts. interpreter/doccheck/spellcheck: Script to spellcheck a Texinfo file. interpreter/doccheck/aspell.conf: GNU Aspell configuration file for Octave documentation. interpreter/doccheck/aspell-octave.en.pws: Private Aspell dictionary. interpreter/doccheck/add_to_aspell_dict: Script to add new Octave-specific words to private Aspell dictionary. interpreter/octave.texi: New @nospell macro which forces Aspell to ignore the word marked by the macro. interpreter/mk_doc_cache.m: Skip new @nospell macro when building doc_cache.
author Rik <octave@nomad.inbox5.com>
date Sat, 17 Jul 2010 19:53:01 -0700
parents e517da95bf98
children 307c8396bc83
line wrap: on
line source

BEGIN {
  exts[1] = "eps";
  exts[2] = "pdf";
  exts[3] = "png";
  exts[4] = "txt";
  printf ("IMAGES_SRC =\n");
  printf ("HTMLDIR_IMAGES =\n");
  for (i = 1; i <= 4; i++) {
    printf ("IMAGES_%s =\n", toupper (exts[i]));
  }
} {
  script = $1;
  basename = script;
  sub (/\.m$/, "", basename);
  ubasename = toupper (basename);
  printf ("IMAGES_SRC += %s\n", script);
  for (i = 1; i <= 4; i++) {
    ext = exts[i];
    uext = toupper (ext);

    printf ("%s_%s =", ubasename, uext);
    for (j = 2; j <= NF; j++)
      printf (" %s.%s", $j, ext);
    printf ("\n");

    printf ("IMAGES_%s += $(%s_%s)\n", uext, ubasename, uext);

    # Skip building pdf images in Octave
    # Use Makefile rule to transform .eps files to .pdf
    if (ext == "pdf") {
      continue;
    }

    if (ext == "png") {
      printf ("HTMLDIR_IMAGES += ");
      for (j = 2; j <= NF; j++)
        printf (" octave.html/%s.png", $j);
      printf ("\n");
    }

    for (j = 2; j <= NF; j++) {
      if (ext == "png") {
	printf ("octave.html/%s.png: %s.png octave.html\n", $j, $j);
	printf ("\tcp $< $@\n");
      }
      printf ("%s.%s: %s\n", $j, ext, script);
      printf ("\t$(top_builddir)/run-octave -f -q -H -p $(srcdir) --eval \"%s ('%s', '%s');\"\n",
	      basename, $j, ext);
    }
  }
}