Skip to content

Commit

Permalink
try wu2
Browse files Browse the repository at this point in the history
  • Loading branch information
jbroll committed Sep 17, 2024
1 parent 03762dd commit 52b58a6
Show file tree
Hide file tree
Showing 147 changed files with 8,180 additions and 99 deletions.
25 changes: 14 additions & 11 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
WU_FILES := $(wildcard *.wu)
MD_FILES := $(patsubst %.wu,../docs/%.md,$(WU_FILES))

lib:
c2man -Swu -I. -I/data/mmti/include -P "cpp -D__STDC__ -E -C" ../tablelib/table.h
wu set Outline starbase.3.wu table_*.wu
wu 2html table_*.wu
cat starbase.3.ABC.head > starbase.3.ABC.wu
awk '$$2 ~ /^-/ { $$1 = " * @{"$$1", "$$1".html}"; print }' table_*.wu >> starbase.3.ABC.wu
cat starbase.3.ABC.tail >> starbase.3.ABC.wu
wu 2html starbase.3.ABC.wu

ABC:
mawk '/^NAME/,/^SYNOPSYS/ { if ( $$2 ~ /^-$$/ ) { $$1 = " * @["$$1", "$$1".html]"; print } }' *.wu | grep -v table_ | sed -e s/#//g > xxABC
WI_FILES := $(notdir $(wildcard ./include/*.wi))
MI_FILES := $(patsubst %.wi,../docs/_includes/%.md,$(WI_FILES))

all: $(MD_FILES) $(MI_FILES)

../docs/%.md: %.wu wu2markdown.tcl
@cat $< | expand | ./wu2markdown.tcl > $@

../docs/_includes/%.md: include/%.wi wu2markdown.tcl
@cat $< | expand | ./wu2markdown.tcl > $@

.PHONY: all

18 changes: 9 additions & 9 deletions doc/Others.wu
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ I'm not the only one who can write UNIX filters. Here are some other
efforts at implimenting the concepts outlined in the
@{UNIX Review /RDB White Paper, http://www.rdb.com/lib/4gl.ps}

* @[No SQL, http://www.linux.it/~carlos/nosql/] by Carlo Strozzi, Italian Linux Society.
* @[/RDB, http://www.rdb.com] from @[Revolutionary Software, http://www.zuvaya.com/rsw/index.html]
* @[/RDB-Hobbs, http://cfa-www/~john/starbase/RDB-2.6d.tar.gz] from RAND.
* @[Unity, http://www.bell-labs.com/project/wwexptools/unity/] from Bell Labs.
* @[dbops, http://www.simtech-soft.com/dbops.shtml] from @[simtech, http://www.simtech-soft.com/]
* @[jink, http://wwwtios.cs.utwente.nl/doc/jinx-doc/] A nice interactive table editor is available @{here, http://archive.cs.ruu.nl/pub/PERL}.
* @[reldb, http://sources.isc.org/apps/database/reldb.txt] by Gunnar Stefansson.
* @[|Stat, http://www.acm.org/~perlman/stat/] by Gary Perlman.
* @[JDB, http://www.isi.edu/~johnh/SOFTWARE/JDB/index.html]
* @[No SQL, http://www.linux.it/~carlos/nosql/] by Carlo Strozzi, Italian Linux Society.
* @[/RDB, http://www.rdb.com] from @[Revolutionary Software, http://www.zuvaya.com/rsw/index.html]
* @[/RDB-Hobbs, http://cfa-www/~john/starbase/RDB-2.6d.tar.gz] from RAND.
* @[Unity, http://www.bell-labs.com/project/wwexptools/unity/] from Bell Labs.
* @[dbops, http://www.simtech-soft.com/dbops.shtml] from @[simtech, http://www.simtech-soft.com/]
* @[jink, http://wwwtios.cs.utwente.nl/doc/jinx-doc/] A nice interactive table editor is available @{here, http://archive.cs.ruu.nl/pub/PERL}.
* @[reldb, http://sources.isc.org/apps/database/reldb.txt] by Gunnar Stefansson.
* @[|Stat, http://www.acm.org/~perlman/stat/] by Gary Perlman.
* @[JDB, http://www.isi.edu/~johnh/SOFTWARE/JDB/index.html]



7 changes: 0 additions & 7 deletions doc/Wu.def

This file was deleted.

2 changes: 1 addition & 1 deletion doc/cvstattable.wu
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ DESCRIPTION
SEE ALSO
========

include statbase.seealso
include starbase.seealso
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added doc/include/plottable-tab.wi
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/index.wu
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ OPTIONS
EXAMPLES
========

`

Example of primary indexing. Make a numeric primary index of file foo
on column A.

Expand Down
6 changes: 0 additions & 6 deletions doc/starbase.3.ABC.head

This file was deleted.

6 changes: 0 additions & 6 deletions doc/starbase.3.ABC.tail

This file was deleted.

22 changes: 11 additions & 11 deletions doc/starbase.wu
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Starbase Data Tables
* @{project, column.html} - project columns from a starbase data table.
* @{trim, trim.html} - trim columns of an starbase data table.

Header Access:
Header Access:

* @{dashline, dashline.html} - print the dashline from a starbase data table.
* @{headoff, headoff.html} - remove the header from a starbase data table.
Expand All @@ -79,7 +79,7 @@ Starbase Data Tables
* @{sorttable, sorttable.html} - sort a starbase data table by specified columns.
* @{uniontable, uniontable.html} - produce the union of two starbase data tables.

Astronomical Programs:
Astronomical Programs:

* @{precess, precess.html} - precess coordinates

Expand All @@ -106,7 +106,7 @@ Starbase Data Tables
* @{xytotng, xytotng.html} - place circle regions at X, Y points on saotng
image display.

Beyond Compute:
Beyond Compute:

* @{coproctable, coproctable.html} - run a coprocess on the rows of a table.
* @{jiggletable, jiggletable.html} - add a random gausian distribution to a column.
Expand All @@ -120,13 +120,13 @@ Starbase Data Tables
* @{xytorttable, xytorttable.html} - convert a pair of columns in cartesain coordinates to polar coordinates.


Fitting:
Fitting:

* @{simplexfittable, simplexfittable.html} - coefficient fit of a an expression to a dependent column.
* @{svdfittable, svdfittable.html} - fit any set of columns to with linear coefficients on arbitrary basis functions.
* @{xyfittable, xyfittable.html} - fit two pair of columns with a linear model of translation, scale, rotation and optional shear.

@{Combining Lab Data Tables, datasets.html}:
@{Combining Lab Data Tables, datasets.html}:

* @{avg3dtable, avg3dtable.html} - stack several similar tables, compute the average value in each cell
* @{compute3dtable, compute3dtable.html} - stack several similar tables, evaluate statements for each cell
Expand All @@ -136,7 +136,7 @@ Starbase Data Tables
* @{sub3dtable, sub3dtable.html} - stack two similar tables, compute the difference for each cell
* @{sum3dtable, sum3dtable.html} - stack several similar tables, compute the sum for each cell

Statistics:
Statistics:

* @{statstable, statstable.html} - compute basic stats about the columns of a table.

Expand All @@ -154,7 +154,7 @@ Starbase Data Tables
* @{histtable, histtable.html} - compute the histogram of a column in a table.


Table Input
Table Input

* @{cvstattable, cvstattable.html} - display CVS stat as a table.
* @{daophototable, daophototable.html} - convert a daophot table to starbase
Expand All @@ -170,7 +170,7 @@ Starbase Data Tables
data table.
* @{sextotable, sextotable.html} - inport a sextractor table to starbase.

Table Output
Table Output

* @{justify, justify.html} - justify columns of a starbase data table.
* @{extracttable, extracttable.html} - execute a program for each matching table in the input
Expand All @@ -184,23 +184,23 @@ Starbase Data Tables
* @{tabletosed, tabletosed.html} - write a set of sed substitution commands.
format.

Utilities
Utilities

* @{headtable, headtable.html} - use the head utility on a starbase data table.
* @{randtable, headtable.html} - pick random rows from a starbase data table.
* @{tactable, tactable.html} - use the tac utility on a starbase data table.
* @{tailtable, tailtable.html} - use the tail utility on a starbase data table.
* @{wctable, wctable.html} - use the wc utility on a starbase data table.

File Substitution:
File Substitution:

* @{grestable, grestable.html} - table driven general regular expression
substitution.
* @{tabletosed, tabletosed.html} - convert a table to sed substitutions.
* @{trantable, trantable.html} - table driven token substitution.
* @{tabletom4, tabletom4.html} - convert a table to m4 substitutions.

Associated Programs and Documentation:
Associated Programs and Documentation:

* @{calc, calc.html} - a command line calculator.
* @{filebytes, filebytes.html} - output a specified byte range from a file
Expand Down
91 changes: 91 additions & 0 deletions doc/wu2markdown.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env tclsh

# Initialize variables
set header 1
set in_code_block 0
set in_list 0
set in_plus_code_block 0
set prev_line ""
set prev_line_length 0

proc process_line {line} {
global header in_code_block in_list in_plus_code_block prev_line prev_line_length

# Skip header lines
if {$header && [regexp {^[A-Za-z]+:} $line]} {
return
}
set header 0

# Handle code blocks
if {$line eq "-"} {
if {$in_code_block || $in_plus_code_block} {
puts "```"
set in_code_block 0
set in_plus_code_block 0
} else {
puts "```"
set in_code_block 1
}
return
}

# Handle plus code blocks
if {$line eq "+"} {
if {!$in_code_block && !$in_plus_code_block} {
puts "```"
set in_plus_code_block 1
}
return
}

if {[regexp {^include (.*)$} $line -> file]} {
set file [string map { . - } $file].md
puts "{% include $file %}"
return
}

# Convert list items
if {[regexp {^ \* } $line]} {
if {!$in_list} {
puts ""
set in_list 1
}
regsub {^ \* } $line "- " line
} else {
# End list if line doesn't start with ' * '
if {![regexp {^[ *]} $line]} {
if {$in_list} {
puts ""
set in_list 0
}
}
}

# Convert links
while {[regsub {@{([^\}]+),([^\}]+)}} $line {[\1](\2)} line]} {}
while {[regsub {@\[([^]]+),([^]]+)\]} $line {[\1](\2)} line]} {}

# Convert inline formatting
if {!$in_code_block} {
set line [regsub -all {\*\*\*([^*]+)\*\*\*} $line {**\1**}]
set line [regsub -all {~([^~]+)~} $line {*\1*}]
set line [regsub -all {#([^ ]+)} $line {`\1`}]
set line [regsub -all { @\[([^ \t]+)\]} $line {[\1](\1.html)}]
set line [regsub -all { @([^ \t]+)} $line { [\1](\1.html)}]
}

# Print the processed line
if {$in_code_block || $in_plus_code_block} {
puts $line
} else {
puts $line
}

set prev_line $line
set prev_line_length [string length $line]
}

while {[gets stdin line] >= 0} {
process_line $line
}
37 changes: 37 additions & 0 deletions docs/Download.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Download the Starbase Source
============================

Starbase is available in source code and binary distribution. The binary distribution
includes the entire source and can be rebuilt without additional downloads.
Starbase has recently been compiled on SunOS, Linux, Mac OS X (ppc and intel)
and on Windows XP under Cygwin.


```
{% include starbase-tab.md %}
```

Plottable is a command line plotting package for use with Starbase.

```
{% include plottable-tab.md %}
```

Here is the output from the[example](example.html) script that comes with plottable:

```
-rw-rw-r-- 1 john instruments 5451 Mar 4 14:34[example.5.gif](example.5.gif.html)
-rw-rw-r-- 1 john instruments 12598 Mar 4 14:34[example.4.gif](example.4.gif.html)
-rw-rw-r-- 1 john instruments 12991 Mar 4 14:34[example.3.gif](example.3.gif.html)
-rw-rw-r-- 1 john instruments 13699 Mar 4 14:34[example.2.gif](example.2.gif.html)
-rw-rw-r-- 1 john instruments 6156 Mar 4 14:34[example.1.gif](example.1.gif.html)
-rw-rw-r-- 1 john instruments 90403 Mar 4 14:33[example.5.ps](example.5.ps.html)
-rw-rw-r-- 1 john instruments 369089 Mar 4 14:33[example.4.ps](example.4.ps.html)
-rw-rw-r-- 1 john instruments 205366 Mar 4 14:33[example.2.ps](example.2.ps.html)
-rw-rw-r-- 1 john instruments 76103 Mar 4 14:33[example.3.ps](example.3.ps.html)
-rw-rw-r-- 1 john instruments 44026 Mar 4 14:33[example.1.ps](example.1.ps.html)
```

22 changes: 22 additions & 0 deletions docs/Others.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Other ASCII database systems for UNIX
=====================================

I'm not the only one who can write UNIX filters. Here are some other
efforts at implimenting the concepts outlined in the
[UNIX Review /RDB White Paper]( http://www.rdb.com/lib/4gl.ps)


- [No SQL]( http://www.linux.it/~carlos/nosql/) by Carlo Strozzi, Italian Linux Society.
- [/RDB]( http://www.rdb.com) from [Revolutionary Software]( http://www.zuvaya.com/rsw/index.html)
- [/RDB-Hobbs]( http://cfa-www/~john/starbase/RDB-2.6d.tar.gz) from RAND.
- [Unity]( http://www.bell-labs.com/project/wwexptools/unity/) from Bell Labs.
- [dbops]( http://www.simtech-soft.com/dbops.shtml) from [simtech]( http://www.simtech-soft.com/)
- [jink]( http://wwwtios.cs.utwente.nl/doc/jinx-doc/) A nice interactive table editor is available [here]( http://archive.cs.ruu.nl/pub/PERL).
- [reldb]( http://sources.isc.org/apps/database/reldb.txt) by Gunnar Stefansson.
- [|Stat]( http://www.acm.org/~perlman/stat/) by Gary Perlman.
- [JDB]( http://www.isi.edu/~johnh/SOFTWARE/JDB/index.html)




2 changes: 2 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

index_page: starbase.html
7 changes: 7 additions & 0 deletions docs/_includes/colstd-opts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

- -i *file* Read input from *file* instead of the standard input.
- -o *file* Write output to *file* instead of the standard output.
- -t *template* Only the tables whose table names (first line in the table
header) match *template* are output. Care should be taken with this
option, unnamed tables are skipped if it is specified. This is the primary
mechanism for selecting a table from a multi-table file.
Loading

0 comments on commit 52b58a6

Please sign in to comment.