]> git.lyx.org Git - features.git/commitdiff
Doc updates for noweb (bug #5444).
authorPavel Sanda <sanda@lyx.org>
Wed, 10 Oct 2012 23:33:54 +0000 (01:33 +0200)
committerPavel Sanda <sanda@lyx.org>
Wed, 10 Oct 2012 23:33:54 +0000 (01:33 +0200)
Patch based on Kayvan Sylvan input.

lib/doc/Additional.lyx
lib/doc/Customization.lyx
lib/examples/Literate.lyx
lib/examples/listerrors.lyx

index c894003d3e650db96cb38858bea8695fbb36ebfc..4404d03dafadbef23bbd73f24d7ec3fc855bfdad 100644 (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
index 2dcd8324d7a206419a966be4091ca7f1705ccc80..95370757384661e66a9f24ab3721bb58bc8aaa6d 100644 (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
index b0bc5483d6e6de6b57b163d0a3f1382c5afd68f4..7ec15def393a5b7d529d0f79aa5fd8492ee762a2 100644 (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
index 7b5cbdc4dcd7196c1a2856b5b45eafbceaa93060..2bbc9250d4177706fcc06642edd22b08794d2f94 100644 (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