This file is indexed.

/usr/share/polymake/scripts/generate_docs is in polymake-common 3.2r2-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#  Copyright (c) 1997-2018
#  Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
#  http://www.polymake.org
#
#  This program is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by the
#  Free Software Foundation; either version 2, or (at your option) any
#  later version: http://www.gnu.org/licenses/gpl.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#-----------------------------------------------------------------------------
#
#  Complete production cycle for automatic part of documentation
#

my ($noHTML, $noExt, $snapshot, $link_resources);

if ( !GetOptions( noHTML => \$noHTML, noExt => \$noExt, snapshot => \$snapshot,
                  'link-resources' => \$link_resources ) or
     @ARGV > 1 ||
     !@ARGV && !$DeveloperMode) {
   my $outdirvar = $DeveloperMode ? '[OutDir]' : 'OutDir';
   die <<".";
usage: polymake [--ignore-config] --script generate_docs [--noHTML --noExt --snapshot --link-resources] $outdirvar

  OutDir    top directory where all created documentation files are placed
            It must be specified when running in an installed polymake;
            in a developer's workspace, the default location is build/doc.

  --noHTML  stop after created XML files with documentation skeleton,
            do not produce final HTML pages

  --noExt   do not produce separate pages describing single extensions
            Note: features defined in extensions will still appear on the common pages;
            to suppress them, please add --ignore-config polymake option.
            Bundled extensions can't be suppressed without reconfiguration of polymake.

  --snapshot  include the current GIT branch information instead of the polymake version.

  --link-resources  add symlinks to the resource files (CSS, icons) in OutDir even when no HTML is produced
.
}

my $Wiki="http://polymake.org/";
my $docdir="$InstallTop/xml/documentation";

my $outdir=$ARGV[0] || Cwd::abs_path("$InstallArch/../doc");
if (-d $outdir) {
   # wipe out everything if this looks like the old documentation
   if (not grep { not -d $_ ? m{/(?:inc|images|PTL)$} : m{\.(?:html|css|js)$} } glob("$outdir/*")
         and
       -f "$outdir/inc/core.inc" && -f "$outdir/inc/doc_index.inc"
         and
       !glob("$outdir/*.html") || (-f "$outdir/core.html" && -f "$outdir/doc_index.html")) {
      File::Path::remove_tree($outdir, { keep_root=>1 });
   } elsif (glob("$outdir/*")) {
      die "output directory $outdir contains unexpected files; please wipe it out or specify a different location\n";
   }
} else {
   File::Path::make_path($outdir);
}

my @Apps=sorted_uniq(sort( map { /$filename_re/o } map { glob("$_/apps/*") } $InstallTop, @Core::Extension::active[$Core::Extension::num_bundled..$#Core::Extension::active] ));

my $tmpdir=new Tempdir;

script("extract_docs", '--wiki' => $Wiki, '--outsuffix' => '.html', '--outdir' => $tmpdir, @Apps);

my $pmdocns=doc_namespace();

my $writer=open_doc_file("version.xml");
$writer->startTag([ $pmdocns, "version" ]);
if ($DeveloperMode && $snapshot) {
   my ($rev)= `git rev-parse --short HEAD`;
   $writer->dataElement("commit", $rev);
} else {
   $writer->dataElement("release", $Version);
}

$writer->startTag("extensions");
for my $ext (@Core::Extension::active) {
  $writer->startTag("extension");
  if (!$ext->is_bundled) {
     $writer->dataElement("non_bundled", 1);
  }
  $writer->dataElement("URI", $ext->URI);
  unless ($noExt) {
     $writer->dataElement("name", $ext->short_name) if ($ext->short_name);
     $writer->dataElement("text", $ext->credit->text) if ($ext->credit);
     my $ext_file = $ext->URI;
     $ext_file =~ s|http://||og;
     $ext_file =~ s|[/:.]|_|og;
     $writer->dataElement("file", $ext_file);
  }
  $writer->endTag;
}
$writer->endTag;

$writer->endTag;

close_doc_file($writer);

sub run_xsltproc {
   my ($out, $stylesheet, $in, $ext_name)=@_;
   if (system("xsltproc", "--path", "$tmpdir $docdir/entities",
                          "--nonet",
                          "--stringparam", "Wiki", $Wiki,
                          "--stringparam", "ext_name", $ext_name,
                          "-o", $out,
                          "$docdir/$stylesheet.xsl", "$in")) {
      die "Command 'xsltproc @_' returned with error code $?\n",
          "Temporary files preserved in $tmpdir\n";
   }
}

push(@Apps, "core") if -f "$tmpdir/core.xml";
foreach (@Apps) {
   run_xsltproc("$outdir/inc/$_.inc", "doc", "$_.xml");
}

$writer=open_doc_file("applications.xml");
$writer->startTag([ $pmdocns, "applications" ]);
$writer->emptyTag("file", name => "$_.xml") for @Apps;
$writer->endTag;
close_doc_file($writer);

run_xsltproc("$outdir/inc/index.inc",     "index",     "applications.xml");
run_xsltproc("$tmpdir/all.xml",           "all",       "applications.xml");
run_xsltproc("$outdir/inc/doc_index.inc", "doc_index", "all.xml");

unless ($noExt) {
   foreach (@Core::Extension::active) {
      my $ext_name = $_->URI;
      my $ext_file = $_->URI;
      $ext_file =~ s|http://||og;
      $ext_file =~ s|[/:.]|_|og;
      run_xsltproc("$tmpdir/$ext_file.xml",     "extension", "all.xml", $ext_name);
      run_xsltproc("$outdir/inc/$ext_file.inc", "doc",       "$ext_file.xml", $ext_name);
      run_xsltproc("$outdir/$ext_file.html",    "export",    "$outdir/inc/$ext_file.inc") unless ($noHTML);
   }
   run_xsltproc("$outdir/inc/extensions.inc",  "ext_list",   "applications.xml");
   run_xsltproc("$outdir/extensions.html",     "export",     "$outdir/inc/extensions.inc") unless ($noHTML);
}

unless ($noHTML) {
   foreach (@Apps) {
      run_xsltproc("$outdir/$_.html", "export", "$outdir/inc/$_.inc");
   }
   run_xsltproc("$outdir/index.html", "export", "$outdir/inc/index.inc");
   run_xsltproc("$outdir/doc_index.html", "export", "$outdir/inc/doc_index.inc");
}

if ($link_resources || !$noHTML) {
   symlink "$docdir/images", "$outdir/images";
   foreach my $file (glob("$docdir/*.{js,css}")) {
      symlink $file, "$outdir/".substr($file, length($docdir)+1);
   }
}


# Local Variables:
# mode: perl
# cperl-indent-level: 3
# indent-tabs-mode:nil
# End: