moved examples to Wiki
This commit is contained in:
40
README.md
40
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 🍆 💦 😝
|
||||||
|
|
||||||
@ -389,4 +353,4 @@ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|||||||
[daviddm-image]: https://david-dm.org/dolanmiu/docx.svg?theme=shields.io
|
[daviddm-image]: https://david-dm.org/dolanmiu/docx.svg?theme=shields.io
|
||||||
[daviddm-url]: https://david-dm.org/dolanmiu/docx
|
[daviddm-url]: https://david-dm.org/dolanmiu/docx
|
||||||
[snky-image]: https://snyk.io/test/github/dolanmiu/docx/badge.svg
|
[snky-image]: https://snyk.io/test/github/dolanmiu/docx/badge.svg
|
||||||
[snky-url]: https://snyk.io/test/github/dolanmiu/docx
|
[snky-url]: https://snyk.io/test/github/dolanmiu/docx
|
||||||
|
Reference in New Issue
Block a user