moved examples to Wiki
This commit is contained in:
38
README.md
38
README.md
@ -332,43 +332,7 @@ exporter.pack('My Document');
|
|||||||
```
|
```
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
## In practice
|
Check the Wiki for examples
|
||||||
I used this library in my personal portfolio/CV website. Click generate CV for a demonstration. [http://www.dolan.bio](http://www.dolan.bio)
|
|
||||||
|
|
||||||
## General
|
|
||||||
#### Simple paragraph
|
|
||||||
```js
|
|
||||||
var doc = new docx.Document();
|
|
||||||
|
|
||||||
var paragraph = new docx.Paragraph("Hello World");
|
|
||||||
var institutionText = new docx.TextRun("University College London").bold(),
|
|
||||||
var dateText = new docx.TextRun("5th Dec 2015").tab().bold();
|
|
||||||
paragraph.addText(institutionText);
|
|
||||||
paragraph.addText(dateText);
|
|
||||||
|
|
||||||
doc.addParagraph(paragraph);
|
|
||||||
var exporter = new docx.LocalPacker(doc);
|
|
||||||
exporter.pack('My Document');
|
|
||||||
```
|
|
||||||
|
|
||||||
Or:
|
|
||||||
```js
|
|
||||||
var doc = new docx.Document();
|
|
||||||
|
|
||||||
var paragraph = new docx.Paragraph("Hello World");
|
|
||||||
var institutionText = new docx.TextRun("University College London").bold(),
|
|
||||||
var dateText = new docx.TextRun("5th Dec 2015").tab().bold();
|
|
||||||
paragraph.addText(institutionText);
|
|
||||||
paragraph.addText(dateText);
|
|
||||||
|
|
||||||
var exporter = new docx.ExpressPacker(doc, res);
|
|
||||||
exporter.pack('My Document');
|
|
||||||
```
|
|
||||||
Would produce:
|
|
||||||
|
|
||||||
***University College London***
|
|
||||||
|
|
||||||
***5th Dec 2015***
|
|
||||||
|
|
||||||
Made with 💖 by Dolan Miu 🍆 💦 😝
|
Made with 💖 by Dolan Miu 🍆 💦 😝
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user