... | @@ -25,8 +25,33 @@ Global Options |
... | @@ -25,8 +25,33 @@ Global Options |
|
--mhtmlroot <root> Use <root> as the MHTML root for the file.
|
|
--mhtmlroot <root> Use <root> as the MHTML root for the file.
|
|
-v, --verbose Display informational messages and warnings.
|
|
-v, --verbose Display informational messages and warnings.
|
|
--root <root> Prepends <root> to all relative URLs.
|
|
--root <root> Prepends <root> to all relative URLs.
|
|
|
|
--skip-missing Don't throw an error for missing image files.
|
|
|
|
--max-uri-length len Maximum length for a data URI. Defaults to 32768.
|
|
|
|
--max-image-size size Maximum image size (in bytes) to convert.
|
|
-o <file> Place the output into <file>. Defaults to stdout.
|
|
-o <file> Place the output into <file>. Defaults to stdout.
|
|
|
|
|
|
|
|
h1. Ant Task Usage
|
|
|
|
|
|
|
|
Define the task
|
|
|
|
|
|
|
|
bc.. <taskdef
|
|
|
|
name="cssembed"
|
|
|
|
classname="net.nczonline.web.cssembed.CSSEmbedTask"
|
|
|
|
classpath="/path/to/cssembed.jar"
|
|
|
|
/>
|
|
|
|
|
|
|
|
p. then use it.
|
|
|
|
|
|
|
|
bc.. <cssembed
|
|
|
|
root="."
|
|
|
|
skipMissing="true"
|
|
|
|
maxImageSize="4096"
|
|
|
|
>
|
|
|
|
<fileset dir="." includes="**/*.css" />
|
|
|
|
</cssembed>
|
|
|
|
|
|
|
|
p. Attributes on the @cssembed@ task line up with the command-line arguments, simply replace @-@ with camelCase.
|
|
|
|
|
|
h1. Resolving Files
|
|
h1. Resolving Files
|
|
|
|
|
|
When CSSEmbed comes across a URL reference in CSS (@url(filename)@), it inspects the filename to determine where the file is actually located. If the filename begins with "http://", then the file is downloaded from that location. Files that don't begin with "http://" are assumed to be local and their location is resolved relative to the location of the CSS file. If, for example, the CSS code contains @url(../../image.png)@, then CSSEmbed looks to the directory that is two levels above the CSS file for @image.png@.
|
|
When CSSEmbed comes across a URL reference in CSS (@url(filename)@), it inspects the filename to determine where the file is actually located. If the filename begins with "http://", then the file is downloaded from that location. Files that don't begin with "http://" are assumed to be local and their location is resolved relative to the location of the CSS file. If, for example, the CSS code contains @url(../../image.png)@, then CSSEmbed looks to the directory that is two levels above the CSS file for @image.png@.
|
... | | ... | |