* Paul A. Rubin wrote, On 09/07/09 20:40:
> Probably better to post it on the wiki (http://wiki.lyx.org/pmwiki.php)
> -- it would be easier to find (and keep up to date) there.

I've made a page at http://wiki.lyx.org/Tools/Noweb but I can't upload
the files because I don't have a password or username to login and can't
find out how to register.

I've attached the two files, please could someone upload them.

Sam
#! /usr/bin/awk -f

function emit_buffer() {
  print indent buffer;
  buffer = "";
}

BEGIN {
  buffer = "";
  indent = "";
}

/^ *#line [0-9]/ {
  indent=buffer;
  buffer="";
}

/^  */ {
  if (length(buffer) > 0) gsub("^ *", "");
}

/\\begin_inset Newline newline$/ {
  if (NR > 1) emit_buffer();
}

/^ *\\backslash/ {
  buffer = buffer "\\";
  $0 = "";
}

/\\/ {
  gsub("\\\\.*$", "");
}

{
  buffer = buffer $0;
}

END {
  if (length(buffer) > 0) emit_buffer();
}

Attachment: noweb-lyx.lyx
Description: application/lyx

Reply via email to