448: def create_source_code_file(code_body)
449: template_regexp = Regexp.new("\\." + @options.template + "$")
450: meth_path = @html_class.path.sub(template_regexp, '.src')
451: File.makedirs(meth_path)
452: file_path = File.join(meth_path, @seq) + '.' + @options.template
453:
454: template = TemplatePage.new(RDoc::Page::SRC_PAGE)
455: File.open(file_path, "w") do |f|
456: values = {
457: 'title' => CGI.escapeHTML(index_name),
458: 'code' => code_body,
459: 'style_url' => style_url(file_path, @options.css),
460: 'mathml_xsl_url' => style_url('', "mathml.xsl"),
461: 'charset' => @options.charset
462: }
463: template.write_html_on(f, values)
464: end
465: XHTMLGenerator.gen_url(path, file_path)
466: end