文档介绍:本科毕业设计说明书(论文) (201 2 届) 论文题目 JavaScript 在线 API 文档生成 I 摘要 JavaScript 是目前最流行的脚本语言。它起初是为网页提供交互能力而设计的一门基于对象的普通脚本语言。但随着一些 Web 新标准的出现和一些像 Nodej s 之类的 JavaScript 客户端宿主程序的流行, JavaScript 的用途也越来越广,一个 JavaScript 的项目也随之变大。因此现在对 JavaScript 项目的 API 文档的需求也迅速膨胀。为了将作者从手动书写 API 文档的繁琐过程中解脱出来,必须要有一个强大的工具能够提取代码中的注释,并自动生成一份完整的 API 文档。传统的一些 JavaScript 文档生成项目,比如 jsdoc ,只能生成比较简单的文档,无法很好地满足现在的新需求。本文研究对 JavaScript 源码中的注释进行解析,然后提取有用的 API 信息,并最后生成一个完整的文档页面供读者阅读。解析过程充分考虑了 JavaScript 语言的灵活特性,让 JavaScript 源码作者可以快速地为自己的代码生成对应的文档。同时为了方便用户进行文档生成操作,使用 C# 开发一个 WinForm 软件。生成的文档是一个普通的网页,用户可以自定义文档界面模板。生成的文档可以放在 服务器上直接运行。读者可以在线阅读文档,并在文档的任何一页添加评论。关键词: JavaScript , API, 文档生成, WinForm I Abstract JavaScript is the most popular script language nowadays, which is designed asa simple object-based script language to provide the ability of interaction for web pages at first. But along w ith the appearance of new web standard s and the popularity of some JavaScript clients like Nodejs, the usage of JavaScript increase s soon and the JavaScript projects e plex, which leads to new requirement of JavaScript documentation as well. To avoid authors writing API Document word by word, there should bea powerful tool to export an API document from the source code automatically . The traditional related projects such as Jsdoc show their ing when meeting new requirements. This article focuses on analyz ing source code of JavaScript and then generating a full API document. The analyz ing program is fit for JavaScript, which can save a lotof time for JavaScript authors. This article also talks about developing a program of WinForm to make it easier to operate. On the other hand, users can custom the templates of document if needed. The generated API document can run on server directly. Readers can view the document online and leave ment son any page . Key w ords : JavaScript , API, Document Generator, WinForm II 目录摘要.................................................................................................................