Skip to content

Commit fe54545

Browse files
committed
Merge branch 'master' into 1.x
Conflicts: coffee/docxgen.coffee
2 parents d3be84a + afa66db commit fe54545

File tree

6 files changed

+11
-62
lines changed

6 files changed

+11
-62
lines changed

docs/source/conf.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@
5252
# |version| and |release|, also used in various other places throughout the
5353
# built documents.
5454
#
55-
# The short X.Y version.
56-
version = '0.5.4'
57-
# The full version, including alpha/beta/rc tags.
58-
release = '0.5.4'
5955

6056
# The language for content autogenerated by Sphinx. Refer to documentation
6157
# for a list of supported languages.
@@ -248,7 +244,7 @@
248244
# dir menu entry, description, category)
249245
texinfo_documents = [
250246
('index', 'docxtemplater', u'docxtemplater Documentation',
251-
u'Edgar Hipp', 'docxtemplater', 'One line description of project.',
247+
u'Edgar Hipp', 'docxtemplater', 'Generate docx documents from docx templates',
252248
'Miscellaneous'),
253249
]
254250

docs/source/configuration.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ So I decided to use the qrCode format, which is a format that lets you identify
2525

2626
The option for this is `qrCode` (false for off, a function for on, default off)
2727

28-
The function takes two parameter: The first one is the string, the second the callback.
28+
The function takes two parameter: The first one is the string that was decoded by the qrcode module, the second the callback.
2929

3030
For example your configuration could be:
3131

@@ -53,13 +53,13 @@ For example your configuration could be:
5353
5454
.. note::
5555

56-
If you don't use that functionality, you should disable it, because it is quite slow (the image decoding)
56+
If you don't use that functionality, you should not enable it (you don't have to do anything), because the qrcode module is quite slow.
5757

5858
.. warning::
5959

6060
The qrCode functionality only works for PNG !
6161
They is no support for other file formats yet.
62-
The main problem being that their is no decoder for other file formats in Node.js
62+
The main problem being that their is no decoder for other file formats in Node.js.
6363
The library https://github.com/zhangyuanwei/node-images does support decoding for more file formats (gif, png, jpeg), but depends on 3 other none node dependencies.
6464

6565
.. warning::
@@ -108,16 +108,14 @@ https://github.com/Automattic/node-canvas/wiki
108108
canvas.pngStream().pipe(fs.createWriteStream('qr.png'));
109109
110110
111-
Angular Parser
111+
Custom Parser
112112
--------------
113113

114-
The name of this option `parser` (function).
115-
116-
You can set the angular parser with the following code:
114+
The name of this option is `parser` (function).
117115

118116
With a custom parser you can parse the tags to for example add operators
119117
like '+', '-', or whatever the way you want to parse expressions. See for
120-
a complete reference of all possibilities
118+
a complete reference of all possibilities of angularjs parsing:
121119
http://teropa.info/blog/2014/03/23/angularjs-expressions-cheatsheet.html
122120

123121
To enable this, you need to specify a custom parser.
@@ -131,6 +129,7 @@ docxtemplater comes shipped with this parser:
131129
{
132130
return {
133131
get:function(scope) {
132+
if (expression===".") return scope;
134133
return scope[expression]
135134
}
136135
};
@@ -157,7 +156,7 @@ To use the angular-parser, do the following:
157156
Intelligent LoopTagging
158157
-----------------------
159158

160-
The name of this option `intelligentTagging` (boolean).
159+
The name of this option is `intelligentTagging` (boolean).
161160

162161
When looping over an element, docxtemplater needs to know over which
163162
element you want to loop. By default, it tries to do that intelligently

docs/source/full_doc.rst

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -137,26 +137,6 @@ Docxgen methods
137137
138138
This requires to include Downloadify.js, that needs flash version 10. Have a look at the *output* function if you don't want to depend on it. This function has the advantage that it works regardless of the file size
139139
140-
getImageList()
141-
142-
this gets all images that have one of the following extension: 'gif','jpeg','jpg','emf','png'
143-
Return format: Array of Object:
144-
[{path:string,files:ZipFile Object}]
145-
146-
You should'nt call this method before calling **applyTags()**, because applyTags can modify the images or their path when replacing images with other (particularly when qrCode is set to true, which is not the default case). You can call this method after **applyTags()** without any problems
147-
148-
setImage(path,imgData)
149-
150-
path
151-
Type:"String"
152-
Path of the image, given by getImageList()
153-
imgData
154-
Type:"String"
155-
imgData in txt/plain
156-
157-
This sets the image given by a path and an imgData in txt/plain.
158-
You should'nt call this method before calling **applyTags()**, because applyTags can modify the images or their path when replacing images with other (particularly when qrCode is set to true, which is not the default case). You can call this method after **applyTags()** without any problems
159-
160140
getFullText:([path])
161141
162142
path

docs/source/installation.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ I recommend you to use browserify.
3535
npm install -g gulp jasmine-node uglify-js
3636
npm install
3737
gulp allCoffee
38+
mkdir build -p
3839
browserify -r './js/docxgen.js' > build/docxgen.js
3940
uglifyjs build/docxgen.js > build/docxgen.min.js
4041

docs/source/platform_support.rst

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,9 @@ Internet explorer is not supported -even IE10- (basically because xhr Requests c
1717

1818
You can test if everything works fine on your browser by using the test runner: http://javascript-ninja.fr/docxgenjs/test/SpecRunner.html
1919

20-
Firefox has an other implementation of the xml parser, that's why all tests don't pass now.
21-
However, all of the functionality works on Firefox too.
22-
The output files are not exactly the same byte wise but the generated XML is correct.
23-
2420
Dependencies
2521
============
2622

2723
1. **docxgen.js** uses [jszip.js](http://stuk.github.io/jszip/) to zip and unzip the docx files
2824

2925
2. Optionally, if you want to be able to name the output files, you can use **Downloadify.js**, which is required to use method download. Be informed that it uses flash, this is why the method is not recommended. This method is howewer useful because a lot of browsers are limited for the download size with the Data-URI method. **Update**: I will probably implement in the future a way to use the FileSaver API, with [FileSaverJS](http://eligrey.com/demos/FileSaver.js/)
30-
31-
3. Optionnaly, if you want to replace images by images situated at a particular URL, you can use QR codes. For example If you store an image at http://website.com/image.png , you should encode the URL in QR-Code format. ![Qr Code Sample](http://qrfree.kaywa.com/?l=1&s=8&d=http%3A%2F%2Fwebsite.com%2Fimage.png "Qrcode Sample to http://website.com/image.png"). You can even use bracket tags in images. http://website.com/image.png?color={color} will take the *Tags[color]* variable to make a dynamic URL. For this too work, you will need [jsqrcode](http://github.com/edi9999/jsqrcode "jsqrcode repositoty forked") and include the following files, in this order (only for browser support, node support already comes out of the box):
32-
33-
34-
.. code-block:: javascript
35-
36-
<script type="text/javascript" src="grid.js"></script>
37-
<script type="text/javascript" src="version.js"></script>
38-
<script type="text/javascript" src="detector.js"></script>
39-
<script type="text/javascript" src="formatinf.js"></script>
40-
<script type="text/javascript" src="errorlevel.js"></script>
41-
<script type="text/javascript" src="bitmat.js"></script>
42-
<script type="text/javascript" src="datablock.js"></script>
43-
<script type="text/javascript" src="bmparser.js"></script>
44-
<script type="text/javascript" src="datamask.js"></script>
45-
<script type="text/javascript" src="rsdecoder.js"></script>
46-
<script type="text/javascript" src="gf256poly.js"></script>
47-
<script type="text/javascript" src="gf256.js"></script>
48-
<script type="text/javascript" src="decoder.js"></script>
49-
<script type="text/javascript" src="qrcode.js"></script>
50-
<script type="text/javascript" src="findpat.js"></script>
51-
<script type="text/javascript" src="alignpat.js"></script>
52-
<script type="text/javascript" src="databr.js"></script>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"url": "https://github.com/edi9999/docxtemplater"
2424
},
2525
"dependencies": {
26-
"angular-expressions": "~0.2.1",
2726
"jszip": "^2.4.0",
2827
"png-js": "^0.1.1",
2928
"qrcode-reader": "0.0.5",
3029
"url": "^0.10.1",
3130
"xmldom": "0.1.x"
3231
},
3332
"devDependencies": {
33+
"angular-expressions": "~0.2.1",
3434
"gulp": "~3.8.0",
3535
"gulp-browserify": "^0.5.0",
3636
"gulp-coffee": "~2.0.1",

0 commit comments

Comments
 (0)