NUWEB(1)

πŸ“¦ version 1.64, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

This is the NUWEB(1) page from the General Commands Manual, and it’s all about Nuweb, a literate programming tool. That’s the name, bestie β€” slay. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

nuweb
nuweb [options] [file] ...

πŸ”₯ DESCRIPTION πŸ”₯

Okay so Nuweb is a literate programming tool like Knuth’s WEB, only simpler. A nuweb file contains program source code interleaved with documentation.

When nuweb is given a nuweb file, it writes the program file(s), and also produces LaTeX source for typeset documentation. Iconic. πŸ’…


🌈 COMMAND LINE OPTIONS 🌈

Bestie, here are the command-line flags, one by one, no skipping:

  • -t β€” suppresses generation of the {t .tex} file.
  • -o β€” suppresses generation of the output files.
  • -d β€” list dangling identifier references in indexes.
  • -c β€” forces output files to overwrite old files of the same name without comparing for equality first.
  • -v β€” the verbose flag. Forces output of progress reports.
  • -n β€” forces sequential numbering of scraps (instead of page numbers).
  • -s β€” doesn’t print the list of scraps making up the file at the end of each scrap.
  • -p path β€” prepend path to the filenames for all the output files.
  • -V string β€” provide the string for replacement of the @v operation. This is intended as a means for including version information in generated output.
  • -x β€” include cross-references in comments in output files.
  • -h options β€” turn on hyperlinks using the hyperref package of LaTeX and provide the options to the package.
  • -r β€” turn on hyperlinks using the hyperref package of LaTeX, with the package options being in the text.
  • -I path β€” provide a directory to search for included files. This may appear several times.

πŸ¦‹ FORMAT OF NUWEB FILES πŸ¦‹

A nuweb file contains mostly ordinary LaTeX. The file is read and copied to output (.tex file) unless a nuweb command is encountered. All nuweb commands start with an β€œat-sign” (@). Files and fragments are defined with the following commands:

  • @o file-name flags scrap β€” where scrap is smaller than one page.
  • @O file-name flags scrap β€” where scrap is bigger than one page.
  • @d fragment-name scrap. β€” where scrap is smallar than one page.
  • @D fragment-name scrap. β€” where scrap is bigger than one page.
  • @q fragment-name scrap. β€” where scrap is smallar than one page. The scrap is not expanded in the output, allowing you to construct output files which can, perhaps after further processing, be input to nuweb.
  • @Q fragment-name scrap. β€” where scrap is bigger than one page. Likewise.

Scraps have specific begin and end markers; which begin and end marker you use determines how the scrap will be typeset in the .tex file:

  • @{...@} β€” verbatim β€œterminal style” formatting or, with the -l flag, LaTeX listing package.
  • @[...@] β€” LaTeX paragraph mode formatting.
  • @(...@) β€” LaTeX math mode formmating (yes, that spelling is in the original, keeping it πŸ’…).

Any amount of whitespace (including carriage returns) may appear between a name and the begining of a scrap β€” and yes, the original really says β€œbegining.” 🫢

Several code/file scraps may have the same name; nuweb concatenates their definitions to produce a single scrap. Code scrap definitions are like macro definitions; nuweb extracts a program by expanding one scrap. The definition of that scrap contains references to other scraps, which are themselves expanded, and so on. Nuweb’s output is readable; it preserves the indentation of expanded scraps with respect to the scraps in which they appear. No cap. πŸ”₯


🌸 PER FILE OPTIONS 🌸

When defining an output file, the programmer has the option of using flags to control the output:

  • -d option β€” Nuweb will emit line number indications at scrap boundaries.
  • -i option β€” Nuweb supresses the indentation of fragments (useful for Fortran).
  • -t option β€” makes nuweb copy tabs untouched from input to output.
  • -cx β€” include comments in the output file. x may be c for C-style comments, + for C++ and p for perl and similar.

πŸŽ€ MINOR COMMANDS πŸŽ€

These are the little side-quest commands:

  • @@ β€” causes a single β€œat-sign” to be copied into the output.
  • @_ β€” causes the text between it and the next {t @_} to be made bold (for keywords, etc.) in the formatted document. (Yes, {t @_} is literally what the original says. πŸ’€)
  • @% β€” comments out a line so that it doesn’t appear in the output.
  • @i filename β€” causes the file named to be included.
  • @f β€” creates an index of output files.
  • @m β€” creates an index of fragments.
  • @u β€” creates an index of user-specified identifiers.

To mark an identifier for inclusion in the index, it must be mentioned at the end of the scrap it was defined in. The line starts with @| and ends with the end of scrap mark @}. Periodt. 🫢


πŸ’€ ERROR MESSAGES πŸ’€

The original page has this heading but literally zero content under it β€” no error messages listed. Not me staring at an empty section. πŸ™ˆ


😭 BUGS 😭

Same energy: the heading is here, but the original lists no bugs. πŸ’€


πŸ‘‘ AUTHOR πŸ‘‘

Preston Briggs. Internet address preston@cs.rice.edu.


πŸ’œ MAINTAINER πŸ’œ

  • Simon Wright β€” Internet address simon@pushface.org
  • Keith Harwood β€” Internet address Keith.Harwood@vitalmis.com

okay bye bestie β€” this is the NUWEB(1) manual, and the footer says local, dated 3/22/95. πŸ’…πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from