292: def main_url
293: main_page = @options.main_page
294: ref = nil
295: if main_page
296: ref = AllReferences[main_page]
297: if ref
298: ref = ref.path
299: else
300: $stderr.puts "Could not find main page #{main_page}"
301: end
302: end
303:
304: unless ref
305: for file in @files
306: if file.document_self and file.context.global
307: ref = CGI.escapeHTML("#{CLASS_DIR}/#{file.context.module_name}.html")
308: break
309: end
310: end
311: end
312:
313: unless ref
314: for file in @files
315: if file.document_self and !file.context.global
316: ref = CGI.escapeHTML("#{CLASS_DIR}/#{file.context.module_name}.html")
317: break
318: end
319: end
320: end
321:
322: unless ref
323: $stderr.puts "Couldn't find anything to document"
324: $stderr.puts "Perhaps you've used :stopdoc: in all classes"
325: exit(1)
326: end
327:
328: ref
329: end