Skip to content

Commit

Permalink
Release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anowak committed Aug 1, 2014
1 parent ad50321 commit 0e56cbe
Show file tree
Hide file tree
Showing 4 changed files with 10,419 additions and 6 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ html-docx-js

This is a very small library that is capable of converting HTML documents to DOCX format that
is used by Microsoft Word 2007 and onward. It manages to perform the conversion in the browser by
using mechanism called 'altchunk'. In a nutshell, it allows embedding content in a different markup
using a feature called 'altchunks'. In a nutshell, it allows embedding content in a different markup
language. After Word opens such file, it converts the external content to Word Processing ML (this
is how the markup language of DOCX files is called) and replaces the reference.

Expand All @@ -21,8 +21,21 @@ It also works on Node.js (tested on v0.10.12) using `Buffer` instead of `Blob`.
Usage and demo
--------------

Simple demo is available as `test/sample.html` in the repository and
[online](http://evidenceprime.github.io/html-docx-js/test/sample.html).
Very minimal demo is available as `test/sample.html` in the repository and
[online](http://evidenceprime.github.io/html-docx-js/test/sample.html). Please note that saving
files on Safari is a little bit convoluted and the only reliable method seems to be falling back
to a Flash-based approach (such as [Downloadify](https://github.com/dcneiner/Downloadify)).
Our demo does not include this workaround to keep things simple, so it will not work on Safari at
this point of time.

To generate DOCX, simply pass a HTML document to `asBlob` method to receive `Blob` (or `Buffer`)
containing the output file.

var converted = htmlDocx.asBlob(content);
saveAs(converted, 'test.docx');

**IMPORTANT**: please pass a complete, valid HTML (including DOCTYPE, `html` and `body` tags).
This may be less convenient, but gives you possibility of including CSS rules in `style` tags.

`html-docx-js` is distributed as 'standalone' Browserify module (UMD). You can `require` it as
`html-docx`. If no module loader is available, it will register itself as `window.htmlDocx`.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Converts HTML documents to DOCX in the browser",
"repository": {
"type": "git",
"url": "git://github.com:evidenceprime/html-docx-js.git"
"url": "git://github.com/evidenceprime/html-docx-js.git"
},
"main": "dist/html-docx.js",
"moduleType": [
Expand Down
Loading

0 comments on commit 0e56cbe

Please sign in to comment.