mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Add jake task for generating Markdown language spec
This commit is contained in:
@@ -1,11 +1,3 @@
|
||||
// word2md - Word to Markdown conversion tool
|
||||
//
|
||||
// word2md converts a Microsoft Word document to Markdown formatted text. The tool uses the
|
||||
// Word Automation APIs to start an instance of Word and access the contents of the document
|
||||
// being converted. The tool must be run using the cscript.exe script host and requires Word
|
||||
// to be installed on the target machine. The name of the document to convert must be specified
|
||||
// as a command line argument and the resulting Markdown is written to standard output. The
|
||||
// tool recognizes the specific Word styles used in the TypeScript Language Specification.
|
||||
var sys = (function () {
|
||||
var args = [];
|
||||
for (var i = 0; i < WScript.Arguments.length; i++) {
|
||||
@@ -163,9 +155,9 @@ function convertDocumentToMarkdown(doc) {
|
||||
writeBlockEnd();
|
||||
}
|
||||
findReplace("", { font: { subscript: true } }, "<sub>^&</sub>", { font: { subscript: false } });
|
||||
findReplace("", { style: "Code Fragment" }, "`^&`", { style: -66 /* default font */ });
|
||||
findReplace("", { style: "Production" }, "*^&*", { style: -66 /* default font */ });
|
||||
findReplace("", { style: "Terminal" }, "`^&`", { style: -66 /* default font */ });
|
||||
findReplace("", { style: "Code Fragment" }, "`^&`", { style: -66 });
|
||||
findReplace("", { style: "Production" }, "*^&*", { style: -66 });
|
||||
findReplace("", { style: "Terminal" }, "`^&`", { style: -66 });
|
||||
findReplace("", { font: { bold: true, italic: true } }, "***^&***", { font: { bold: false, italic: false } });
|
||||
findReplace("", { font: { italic: true } }, "*^&*", { font: { italic: false } });
|
||||
doc.fields.toggleShowCodes();
|
||||
|
||||
@@ -97,7 +97,7 @@ module Word {
|
||||
}
|
||||
|
||||
export interface Fields extends Collection<Field> {
|
||||
toggleShowCodes();
|
||||
toggleShowCodes(): void;
|
||||
}
|
||||
|
||||
export interface Document {
|
||||
@@ -138,7 +138,7 @@ function convertDocumentToMarkdown(doc: Word.Document): string {
|
||||
var tableCellIndex: number;
|
||||
var columnAlignment: number[] = [];
|
||||
|
||||
function setProperties(target: {}, properties: {}) {
|
||||
function setProperties(target: any, properties: any) {
|
||||
for (var name in properties) {
|
||||
if (properties.hasOwnProperty(name)) {
|
||||
var value = properties[name];
|
||||
|
||||
Reference in New Issue
Block a user