Hello,
not 1:1 like in your example, but this basically does the same job:
- Load the parcel "Assets-IDE"
- create a subclass of class Assets, e.g. "HTMLAssets"
- on the class side, implement
HTMLAssets class>>import_zip: aFilename
^ self importBytes: aFilename
- in the refactoring browser, open the context menu on the class HTMLAssets. Select "Sync assets". Point it to a directory containing the ZIP file. The assets IDE will import all files in the directory which match a known file extension (see the various #import_ext: methods in class Assets)
- HTMLAssets should now contain a method named similar to the ZIP archive (without extension), e.g. "style.zip" is imported as #style.
- In your HTML exporter, extract the assets (requires Compression-Zip):
(Zip.Archive on: HTMLAssets stylereadStream) extractTo: 'd:\'
You'll need to add the parcel "Assets" as prerequisite for deployments. Assets-IDE is for development.
vpena wrote
I'm working on a HTML exporter and I need to attach some libraries for
it to work (d3.js and other files .js, .css, etc). So I would like to
include them and if possible extract them when I generate my html file.