The external file can contain any data, all of which is interpreted as literal program code: lines beginning with @, for example, will not be processed as commands.
Note that the file is not written directly to the tangler's sink driver, it is written to the tangler. Therefore, if the code contains embedded documentation constructions in a form the tangler understands, documentation can still be woven. For example if a Perl module containing POD constructions is imported, a perl_tangler will still recognize these constructions and send appropriate documentation commens to its associated weaver.
The @include_code command is the same as the @insert_code command except that the tangler is passed as an argument, rather than the current tangler being used.
247: #line 403 "input_frame.ipk" 248: def insert_code(self,name): 249: self.tangler_push(self.tangler) 250: self.pass_frame.include_files.append((self.depth+1,'code: '+self.tangler.language,name)) 251: inpt = input_frame( 252: self.pass_frame, 253: named_file_source(self,name, self.source.directory), 254: [(self.any_line_re,self.process.do_web)], 255: self.weaver, 256: self.userdict.copy(), 257: self.depth+1) 258: inpt.file_pass() 259: 260: def include_code(self,name,tangler): 261: self.tangler_set(None) 262: self.pass_frame.include_files.append((self.depth+1,'code: '+self.tangler.language,name)) 263: inpt = input_frame( 264: self.pass_frame, 265: named_file_source(self,name, self.source.directory), 266: [(self.any_line_re,self.process.do_web)], 267: self.weaver, 268: self.userdict.copy(), 269: self.depth+1) 270: inpt.select(tangler) 271: inpt.file_pass() 272: