Doc updates for noweb (bug #5444).

Patch based on Kayvan Sylvan input.
This commit is contained in:
Pavel Sanda 2012-10-11 01:33:54 +02:00
parent c34e53719f
commit b54c782718
4 changed files with 46 additions and 90 deletions

View File

@ -21817,7 +21817,7 @@ Converter
\family typewriter
build-script $$i
\family default
$$r
\begin_inset Quotes erd
\end_inset
@ -21831,7 +21831,7 @@ build-script
\end_inset
(a program or script) with the name of the Noweb file (normally a file
in the LyX temp directory).
in the LyX temp directory) and the directory path of the original LyX file.
\end_layout
@ -21856,7 +21856,7 @@ build-script
\end_layout
\begin_layout LyX-Code
notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 sh
notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 NOWEB_OUTPUT_DIR=$2 sh
\end_layout
\begin_layout Standard
@ -21874,7 +21874,7 @@ Flags
\family typewriter
parselog=listerrors
parselog=$$s/scripts/listerrors
\family default
\begin_inset Quotes erd
@ -21900,26 +21900,6 @@ listerrors
program.
\end_layout
\begin_layout Standard
The converter code looks in
\emph on
MYLYXDIR/scripts
\emph default
first, then in
\emph on
LIBDIR/scripts
\emph default
then on the path for the
\begin_inset Quotes eld
\end_inset
listerrors
\begin_inset Quotes erd
\end_inset
program.
\end_layout
\begin_layout Standard
The build will normally take place in LyX's temporary directory, so the
files produced by the conversion will be in that directory.
@ -21929,61 +21909,8 @@ Noweb->Program
\family default
conversion may produce several files, and so most of these would then be
deleted when LyX was closed.
The present solution is to use a `copier',
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
See section
\emph on
Copiers
\emph default
of the
\emph on
Customization
\emph default
manual for information on these.
\end_layout
\end_inset
in this case, the
\family typewriter
ext_copy.py
\family default
script in its default mode, so that the entire contents of the temporary
directory is copied.
More will get copied than is needed, to be sure, but nothing will be lost.
If, however, you know what extensions the generated files will have, this
can be improved by using the
\family typewriter
-e
\family default
option to
\family typewriter
ext_copy
\family default
.
This option takes a comma-separated list of extensions to copy.
So, for example, if the conversion will generate only files with the extensions
\family typewriter
.c
\family default
and
\family typewriter
.h
\family default
, then the correct definition would be:
\end_layout
\begin_layout LyX-Code
python -tt $$s/scripts/ext_copy.py -e c,h $$i $$o
\end_layout
\begin_layout Standard
The result will be that only files with these two extensions will be copied
out.
This is why we pass in the NOWEB_OUTPUT_DIR environment variable so that
the build-script scrap can place the generated files in that location.
\end_layout
\begin_layout Paragraph
@ -22063,7 +21990,8 @@ fi
\end_inset
[...
code to extract files ...]
code to extract files ...
use NOWEB_OUTPUT_DIR here ...]
\begin_inset Newline newline
\end_inset
@ -22117,7 +22045,7 @@ Preferences
\begin_inset Quotes eld
\end_inset
Conversion
File Handling
\begin_inset Quotes erd
\end_inset
@ -22134,7 +22062,7 @@ the
\begin_inset Quotes eld
\end_inset
literate
NoWeb
\begin_inset Quotes erd
\end_inset
@ -22142,8 +22070,8 @@ literate
\begin_inset space ~
\end_inset
format Set up via the Formats tab, this is where the Noweb-specific pieces
are set up.
format Set up via the File Formats tab, this is where the Noweb-specific
pieces are set up.
The
\family sans
GUI Name
@ -22240,7 +22168,7 @@ tangling step
\family typewriter
build-script $$i
\family default
$$r
\begin_inset Quotes erd
\end_inset
@ -22250,7 +22178,7 @@ build-script $$i
\family typewriter
originaldir,parselog=listerrors
parselog=$$s/scripts/listerrors
\family default
\begin_inset Quotes erd

View File

@ -1735,6 +1735,26 @@ $$o
The output file
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
$$b The base name (without filename extension) in the LyX temporary directory
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
$$p The full directory path of the LyX temporary directory
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
$$r The full pathname to the original LyX file being processed
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
$$f The filename (without any directory path) of the LyX file.
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code

View File

@ -1679,7 +1679,11 @@ if [ -z "$NOWEB_SOURCE" ]; then NOWEB_SOURCE=Literate.nw; fi
\end_layout
\begin_layout Scrap
notangle -L -Rlisterrors.c ${NOWEB_SOURCE} > listerrors.c
if [ -z "$NOWEB_OUTPUT_DIR" ]; then NOWEB_OUTPUT_DIR=.; fi
\end_layout
\begin_layout Scrap
notangle -L -Rlisterrors.c ${NOWEB_SOURCE} > ${NOWEB_OUTPUT_DIR}/listerrors.c
\end_layout
\begin_layout Scrap
@ -1710,7 +1714,7 @@ build-script
\begin_inset Newline newline
\end_inset
notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 sh
notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 NOWEB_OUTPUT_DIR=$r sh
\end_layout
\begin_layout LyX-Code

View File

@ -1324,11 +1324,15 @@ if [ -z "$NOWEB_SOURCE" ]; then NOWEB_SOURCE=listerrors.nw; fi
\end_layout
\begin_layout Scrap
notangle -Rlisterrors ${NOWEB_SOURCE} > listerrors
if [ -z "$NOWEB_OUTPUT_DIR" ]; then NOWEB_OUTPUT_DIR=.; fi
\end_layout
\begin_layout Scrap
chmod +x listerrors
notangle -Rlisterrors ${NOWEB_SOURCE} > ${NOWEB_OUTPUT_DIR}/listerrors
\end_layout
\begin_layout Scrap
chmod +x ${NOWEB_OUTPUT_DIR}/listerrors
\end_layout
\begin_layout Scrap