Skip to content

Commit 2a6f11d

Browse files
authored
Merge pull request #4 from unidoc-build/prep-rc-v0.4.0
prepare release v0.4.0
2 parents ca9bdb6 + 4876935 commit 2a6f11d

File tree

7 files changed

+343
-343
lines changed

7 files changed

+343
-343
lines changed

cli/cmd/cmd.go

Lines changed: 34 additions & 32 deletions
Large diffs are not rendered by default.

cli/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
// Use of this source code is governed by the UniDoc End User License Agreement
1010
// terms that can be accessed at https://unidoc.io/eula/
1111

12-
package main ;import _cc "github.com/unidoc/unihtml/cli/cmd";func main (){_cc .Execute ()};
12+
package main ;import _c "github.com/unidoc/unihtml/cli/cmd";func main (){_c .Execute ()};

client/client.go

Lines changed: 109 additions & 110 deletions
Large diffs are not rendered by default.

common/common.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
// terms that can be accessed at https://unidoc.io/eula/
1111

1212
// Package common contains common properties used by the subpackages.
13-
package common ;import _e "time";const _f ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";var ReleasedAt =_e .Date (_ac ,_b ,_bg ,_ba ,_ad ,0,0,_e .UTC );const _ba =12;
14-
13+
package common ;import _g "time";const _ee =20;const _gb =3;var ReleasedAt =_g .Date (_a ,_gb ,_c ,_af ,_ee ,0,0,_g .UTC );
1514

1615
// UtcTimeFormat returns a formatted string describing a UTC timestamp.
17-
func UtcTimeFormat (t _e .Time )string {return t .Format (_f )+"\u0020\u0055\u0054\u0043"};const _ac =2021;const Version ="\u0030\u002e\u0033.\u0030";const _bg =23;const _ad =20;const _b =3;
16+
func UtcTimeFormat (t _g .Time )string {return t .Format (_e )+"\u0020\u0055\u0054\u0043"};const _e ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";const _c =27;const Version ="\u0030\u002e\u0034.\u0030";
17+
const _a =2021;const _af =12;

content/content.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,41 @@
99
// Use of this source code is governed by the UniDoc End User License Agreement
1010
// terms that can be accessed at https://unidoc.io/eula/
1111

12-
package content ;import (_f "archive/zip";_ca "bytes";_fc "encoding/json";_a "golang.org/x/xerrors";_g "io/ioutil";_bd "net/url";_d "os";_b "strings";);
12+
package content ;import (_b "archive/zip";_g "bytes";_ce "encoding/json";_cgc "golang.org/x/xerrors";_e "io/ioutil";_cg "net/url";_dc "os";_d "strings";);func (_bgd *zipDirectory )zipPath (_ef ,_db string )error {_bc ,_ae :=_e .ReadDir (_ef );if _ae !=nil {return _cgc .Errorf ("\u0072\u0065\u0061di\u006e\u0067\u0020\u0064\u0069\u0072\u0065\u0063\u0074o\u0072y\u003a \u0027%\u0073\u0027\u0020\u0066\u0061\u0069\u006c\u0065\u0064\u003a\u0020\u0025\u0077",_ef ,_ae );
13+
};_bcf :=&_d .Builder {};for _ ,_gb :=range _bc {_bb ,_cgd :=_bgd .zipBasePaths (_gb ,_ef ,_db ,_gb .IsDir (),_bcf );if _gb .IsDir (){if _cbc :=_bgd .zipPath (_bb ,_cgd );_cbc !=nil {return _cbc ;};continue ;};_dg ,_ee :=_e .ReadFile (_bb );if _ee !=nil {return _ee ;
14+
};_bce ,_ee :=_bgd ._cgae .Create (_cgd );if _ee !=nil {return _ee ;};if _ ,_ee =_bce .Write (_dg );_ee !=nil {return _ee ;};};return nil ;};
1315

1416
// NewHTMLFile creates new Content htmFile for provided input path.
15-
func NewHTMLFile (path string )(Content ,error ){_cad ,_ag :=_d .Open (path );if _ag !=nil {return nil ,_ag ;};_df :=&htmFile {_cf :_ca .Buffer {}};if _ ,_ag =_df ._cf .ReadFrom (_cad );_ag !=nil {return nil ,_ag ;};return _df ,nil ;};
17+
func NewHTMLFile (path string )(Content ,error ){_f ,_ed :=_dc .Open (path );if _ed !=nil {return nil ,_ed ;};_gc :=&htmFile {_cb :_g .Buffer {}};if _ ,_ed =_gc ._cb .ReadFrom (_f );_ed !=nil {return nil ,_ed ;};return _gc ,nil ;};
1618

1719
// ContentType implements Content interface.
18-
func (_ce *webURL )ContentType ()string {return "\u0061\u0070p\u006c\u0069\u0063a\u0074\u0069\u006f\u006e\u002f\u006a\u0073\u006f\u006e";};
20+
func (_bg *htmFile )ContentType ()string {return "\u0074e\u0078\u0074\u002f\u0068\u0074\u006dl"};
1921

20-
// NewWebURL creates new Content webURL for provided input URL path.
21-
func NewWebURL (path string )(Content ,error ){if _ ,_aa :=_bd .Parse (path );_aa !=nil {return nil ,_aa ;};type urlOutput struct{URL string `json:"url"`;};_cb :=urlOutput {URL :path };_e ,_ae :=_fc .Marshal (_cb );if _ae !=nil {return nil ,_ae ;};return &webURL {_bb :path ,_fg :_e },nil ;
22-
};type webURL struct{_bb string ;_fg []byte ;};
22+
// Data implements Content interface.
23+
func (_cbb *htmFile )Data ()[]byte {return _cbb ._cb .Bytes ()};
2324

2425
// Data implements Content interface.
25-
func (_ggd *webURL )Data ()[]byte {return _ggd ._fg };
26+
func (_ba *webURL )Data ()[]byte {return _ba ._gd };type webURL struct{_a string ;_gd []byte ;};func (_dgf *zipDirectory )zipBasePaths (_ga _dc .FileInfo ,_fac ,_gbg string ,_fag bool ,_cbf *_d .Builder )(string ,string ){_cbf .WriteString (_fac );if !_d .HasSuffix (_fac ,"\u002f"){_cbf .WriteRune ('/');
27+
};_cbf .WriteString (_ga .Name ());if _fag {_cbf .WriteRune ('/');};_de :=_cbf .String ();_cbf .Reset ();_cbf .WriteString (_gbg );_cbf .WriteString (_ga .Name ());if _fag {_cbf .WriteRune ('/');};_eg :=_cbf .String ();_cbf .Reset ();return _de ,_eg ;};
2628

27-
// ContentType implements Content interface.
28-
func (_ab *zipDirectory )ContentType ()string {return "\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u007a\u0069\u0070";};
2929

30-
// Data implements Content interface.
31-
func (_gf *htmFile )Data ()[]byte {return _gf ._cf .Bytes ()};type htmFile struct{_cf _ca .Buffer };
30+
// NewWebURL creates new Content webURL for provided input URL path.
31+
func NewWebURL (path string )(Content ,error ){if _ ,_bf :=_cg .Parse (path );_bf !=nil {return nil ,_bf ;};type urlOutput struct{URL string `json:"url"`;};_da :=urlOutput {URL :path };_be ,_bd :=_ce .Marshal (_da );if _bd !=nil {return nil ,_bd ;};return &webURL {_a :path ,_gd :_be },nil ;
32+
};
3233

3334
// NewZipDirectory creates new zip compressed file that recursively reads the directory at the 'dirPath'
3435
// and stores in it's in-memory buffer.
35-
func NewZipDirectory (dirPath string )(Content ,error ){_bc :=&zipDirectory {_bf :_ca .Buffer {}};_bc ._cba =_f .NewWriter (&_bc ._bf );if _gff :=_bc .zipPath (dirPath ,"");_gff !=nil {return nil ,_gff ;};if _ad :=_bc ._cba .Close ();_ad !=nil {return nil ,_ad ;
36-
};return _bc ,nil ;};
37-
38-
// ContentType implements Content interface.
39-
func (_gg *htmFile )ContentType ()string {return "\u0074e\u0078\u0074\u002f\u0068\u0074\u006dl"};
36+
func NewZipDirectory (dirPath string )(Content ,error ){_eb :=&zipDirectory {_cga :_g .Buffer {}};_eb ._cgae =_b .NewWriter (&_eb ._cga );if _fed :=_eb .zipPath (dirPath ,"");_fed !=nil {return nil ,_fed ;};if _dd :=_eb ._cgae .Close ();_dd !=nil {return nil ,_dd ;
37+
};return _eb ,nil ;};
4038

4139
// Content is an interface used for putting the content into Client Query.
42-
type Content interface{ContentType ()string ;Data ()[]byte ;};func (_cc *zipDirectory )zipBasePaths (_fbc _d .FileInfo ,_aeb ,_dgg string ,_ec bool ,_abe *_b .Builder )(string ,string ){_abe .WriteString (_aeb );if !_b .HasSuffix (_aeb ,"\u002f"){_abe .WriteRune ('/');
43-
};_abe .WriteString (_fbc .Name ());if _ec {_abe .WriteRune ('/');};_bfg :=_abe .String ();_abe .Reset ();_abe .WriteString (_dgg );_abe .WriteString (_fbc .Name ());if _ec {_abe .WriteRune ('/');};_gc :=_abe .String ();_abe .Reset ();return _bfg ,_gc ;
44-
};func (_dde *zipDirectory )zipPath (_aed ,_de string )error {_ded ,_dg :=_g .ReadDir (_aed );if _dg !=nil {return _a .Errorf ("\u0072\u0065\u0061di\u006e\u0067\u0020\u0064\u0069\u0072\u0065\u0063\u0074o\u0072y\u003a \u0027%\u0073\u0027\u0020\u0066\u0061\u0069\u006c\u0065\u0064\u003a\u0020\u0025\u0077",_aed ,_dg );
45-
};_add :=&_b .Builder {};for _ ,_cfd :=range _ded {_ceg ,_fb :=_dde .zipBasePaths (_cfd ,_aed ,_de ,_cfd .IsDir (),_add );if _cfd .IsDir (){if _ea :=_dde .zipPath (_ceg ,_fb );_ea !=nil {return _ea ;};continue ;};_bfb ,_gfg :=_g .ReadFile (_ceg );if _gfg !=nil {return _gfg ;
46-
};_cd ,_gfg :=_dde ._cba .Create (_fb );if _gfg !=nil {return _gfg ;};if _ ,_gfg =_cd .Write (_bfb );_gfg !=nil {return _gfg ;};};return nil ;};type zipDirectory struct{_bf _ca .Buffer ;_cba *_f .Writer ;};
40+
type Content interface{ContentType ()string ;Data ()[]byte ;};
41+
42+
// ContentType implements Content interface.
43+
func (_df *zipDirectory )ContentType ()string {return "\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u007a\u0069\u0070";};type zipDirectory struct{_cga _g .Buffer ;_cgae *_b .Writer ;};type htmFile struct{_cb _g .Buffer };
4744

4845
// Data implements Content interface.
49-
func (_bdc *zipDirectory )Data ()[]byte {return _bdc ._bf .Bytes ()};
46+
func (_fa *zipDirectory )Data ()[]byte {return _fa ._cga .Bytes ()};
47+
48+
// ContentType implements Content interface.
49+
func (_bgc *webURL )ContentType ()string {return "\u0061\u0070p\u006c\u0069\u0063a\u0074\u0069\u006f\u006e\u002f\u006a\u0073\u006f\u006e";};

0 commit comments

Comments
 (0)