Skip to content

Commit d9954c0

Browse files
committed
Add a texinfo file for the download, build and install directions and
use this to replace README.Install and software-instructions.html. Add the Makefile, filter and README files to support generating text and html output from texinfo. The advantage of texinfo is that it is possible to produce text, html and latex output (almost anything) from a single source. Remove spack/README.spack, superseded by top-level README.Install.
1 parent 3722330 commit d9954c0

File tree

12 files changed

+2405
-1807
lines changed

12 files changed

+2405
-1807
lines changed

README.Install

Lines changed: 639 additions & 17 deletions
Large diffs are not rendered by default.

doc/README

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ directory used by latex. On Linux platfom, it's usually at
3131

3232
/home/<user>/texmf/tex/latex/<package>
3333

34+
---------------------------------
35+
Texinfo directory and html files
36+
---------------------------------
37+
38+
The source for www/software-instructions.html is now in texinfo format
39+
in the texinfo directory. See the README file in that directory to
40+
see how to edit that file.
41+
3442
-----------------------------
3543
WWW directory and html files
3644
-----------------------------

doc/texinfo/Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#
2+
# Make html and text files from texinfo.
3+
#
4+
# make -- use makeinfo to convert .texi to html and text.
5+
# make install -- copy .html files to ../www/
6+
#
7+
8+
MAKEINFO = makeinfo
9+
10+
BASE_FILES = software-instructions
11+
12+
README = README.Install
13+
README_SOURCE = software-instructions.texi
14+
15+
HTML_FILES = $(addsuffix .html,$(BASE_FILES))
16+
TEMP_FILES = $(addsuffix .temp,$(BASE_FILES))
17+
18+
FILTER = ./filter-html.pl
19+
20+
#------------------------------------------------------------
21+
22+
.PHONY: all install clean
23+
24+
# Don't automatically delete intermediate files.
25+
.SECONDARY: $(TEMP_FILES)
26+
27+
all: $(HTML_FILES) $(README)
28+
29+
install: all
30+
for f in $(HTML_FILES) ; do \
31+
cp -f "$$f" "../www/$$f" ; \
32+
done
33+
cp -f $(README) ../../$(README)
34+
35+
$(README): $(README_SOURCE)
36+
$(MAKEINFO) --plaintext $< -o $@
37+
38+
%.temp: %.texi
39+
$(MAKEINFO) --html --no-split $< -o $@
40+
41+
%.html: %.temp
42+
$(FILTER) $< >$@
43+
44+
clean:
45+
rm -f $(TEMP_FILES) $(HTML_FILES) $(README)
46+

doc/texinfo/README

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This directory replaces some of the *.html.in files in ../www/ with
2+
texinfo files. For now, only the build and install directions from
3+
software-instructions.html. The advantage of texinfo is that it is
4+
possible to produce text, html and latex output (almost anything) from
5+
a single source. This works well for directions that are mostly text.
6+
7+
Requirements: texinfo (makeinfo) version 6.x or later, and perl
8+
version 5.x or later. Texinfo is available as a spack package and
9+
builds simply and robustly with no prerequisites other than perl.
10+
11+
Update the .html files in two phases. First, outside of the normal
12+
build for hpctoolkit, edit the .texi files in this directory and use
13+
'make install' to copy them to the ../www/ directory. Then, the
14+
normal 'make install' for hpctoolkit will copy them to the install
15+
prefix (in share/doc/hpctoolkit).
16+
17+
1. edit the .texi files with a text editor.
18+
19+
2. make (in this directory) -- this uses makeinfo to convert .texi
20+
to html.
21+
22+
3. make install (this directory) -- this copies the .html files to
23+
the ../www/ directory.
24+
25+
4. make install (for hpctoolkit) -- this copies the .html files to
26+
the install prefix.
27+
28+
Note: you don't need to rerun hpctoolkit configure after editing the
29+
texinfo files, just make install.
30+
31+
Note: only developers editing the documentation ever need to run these
32+
steps. The .html files are generated from texinfo and we keep the
33+
generated version in the repository. This means that normal users who
34+
clone hpctoolkit already have the generated files and 'make install'
35+
for hpctoolkit will copy them to the install directory.
36+

doc/texinfo/filter-html.pl

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/usr/bin/env perl
2+
#
3+
# Read the raw html from texinfo on stdin and print the modified html
4+
# for hpctoolkit on stdout.
5+
#
6+
# ./filter-html.pl <html-from-texinfo >html-for-hpctoolkit
7+
#
8+
9+
open(PART1, "<part1") || die "unable to open: part1";
10+
11+
open(HEADER, "<../www/style/header-hpctoolkit.html")
12+
|| die "unable to open: header-hpctoolkit.html";
13+
14+
open(FOOTER, "<../www/style/footer-hpctoolkit.html")
15+
|| die "unable to open: footer-hpctoolkit.html";
16+
17+
#------------------------------------------------------------
18+
19+
# 1 -- <?xml>, <!DOCTYPE>, <head> from part1 file.
20+
21+
while ($_ = <PART1>) {
22+
print $_;
23+
}
24+
25+
#------------------------------------------------------------
26+
27+
# 2 -- <title> from texinfo (stdin), skip lines before that.
28+
29+
while ($_ = <>) {
30+
if (m/<title/) {
31+
print " $_";
32+
last;
33+
}
34+
}
35+
36+
#------------------------------------------------------------
37+
38+
# 3 -- end </head>, begin <body>
39+
40+
print "</head>\n\n<body>\n\n";
41+
42+
#------------------------------------------------------------
43+
44+
# 4 -- hpctoolkit header
45+
46+
while ($_ = <HEADER>) {
47+
print $_;
48+
}
49+
print "\n";
50+
51+
#------------------------------------------------------------
52+
53+
# 5 -- main body from texinfo, starting with <h1>, up to </body>.
54+
55+
while ($_ = <>) {
56+
if (m/<body/) {
57+
last;
58+
}
59+
}
60+
61+
while ($_ = <>) {
62+
if (m/<h/) {
63+
print $_;
64+
last;
65+
}
66+
}
67+
68+
while ($_ = <>) {
69+
if (m|</body|) {
70+
last;
71+
}
72+
print $_;
73+
}
74+
75+
#------------------------------------------------------------
76+
77+
# 6 -- hpctoolkit footer
78+
79+
while ($_ = <FOOTER>) {
80+
print $_;
81+
}
82+
83+
#------------------------------------------------------------
84+
85+
# 7 -- end </body> and </html>
86+
87+
print "\n</body>\n</html>\n";
88+

doc/texinfo/part1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- -*- coding: utf-8 -*- -->
3+
4+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
5+
"http://www.w3.org/TR/html4/loose.dtd">
6+
7+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8+
9+
<head>
10+
<!-- meta http-equiv="Content-Type" content="text/html; charset=utf-8" -->
11+
<link rel="stylesheet" type="text/css" href="style/style.css" />
12+

0 commit comments

Comments
 (0)