CN104020984B - A kind of method and device for generating static page - Google Patents
A kind of method and device for generating static page Download PDFInfo
- Publication number
- CN104020984B CN104020984B CN201310062812.4A CN201310062812A CN104020984B CN 104020984 B CN104020984 B CN 104020984B CN 201310062812 A CN201310062812 A CN 201310062812A CN 104020984 B CN104020984 B CN 104020984B
- Authority
- CN
- China
- Prior art keywords
- page
- picture
- file
- map data
- static page
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
This application discloses a kind of method and device for generating static page;Methods described includes:The PSD files of static page to be generated are carried out into section and obtains one or more pictures;The map data mining platform in the PSD files is parsed, the attribute information of each picture is obtained, the attribute information of each picture is packaged into map data mining platform data;By map data mining platform data conversion into DOM Document Object Model DOM structure, the file for describing page structure is generated according to the DOM structure;The picture is derived, and described saves as a static page for describing the file of page structure.The application can be rapidly completed the exploitation of the static page of the compatible various browsers of energy.
Description
Technical field
The present invention relates to network field, more particularly to a kind of method and device for generating static page.
Background technology
EDM (Email Direct Marketing, Email is sold directly to households), forum's note, active page are that product operation is most normal
The mode for using, accounting is very high in operation demand.The common ground of this kind of static page is short life cycle, durability and semanteme
Change less demanding.Static page refers to the compiling for needing not move through server, is loaded directly into what is shown on client browser
The page.
At present, the mode of the most frequently used exploitation static page has following two:
Exploitation manually:Manual compiling code, completes page development.
Use slice tool:The slice tool carried using photoshop, completes exploitation.
But, the time cost of exploitation is higher manually, and the page derived from slice tool has browser-safe problem.
Application content
The application technical problem to be solved be to provide how to be rapidly completed can compatible various browsers static page
Exploitation.
In order to solve the above problems, this application provides a kind of method for generating static page, including:
The PSD files of static page to be generated are carried out into section and obtains one or more pictures;
The map data mining platform in the PSD files is parsed, the attribute information of each picture is obtained, by the category of each picture
Property Information encapsulation is into map data mining platform data;
By map data mining platform data conversion into DOM Document Object Model DOM structure, generated for describing the page according to the DOM structure
The file of structure;
The picture is derived, and described saves as a static page for describing the file of page structure.
Further, the map data mining platform data are json objects.
Further, the attribute information includes:
Position, width, height, color.
Further, described method also includes:
Receive the configuration information of input;The configuration information includes export type, derives picture format, static page
Storing path;
It is described generated according to DOM structure for describing page structure file the step of include:
According to the export type in the configuration information, according to DOM structure generation respective type for describing page
The file of face structure;
The step of derivation picture, includes:
Derive picture and save as the derivation picture format in the configuration information.
Further, it is described to derive the picture, and described save as a static state for describing the file of page structure
Also included before the step of page:
Judge that the storing path of static page whether there is, if there is no storing path wound then according to the static page
Build corresponding catalogue.
Present invention also provides a kind of device for generating static page, including:
Section module, one or more pictures are obtained for the PSD files of static page to be generated to be carried out into section;
Figure layer resolver, for parsing the map data mining platform in the PSD files, obtains the attribute information of each picture,
The attribute information of each picture is packaged into map data mining platform data;
Auto-building html files device, for by map data mining platform data conversion into DOM structure, being generated for describing according to the DOM structure
The file of page structure;
Memory module, for deriving the picture, and described saves as a static state for describing the file of page structure
The page.
Further, the map data mining platform data are json objects.
Further, the attribute information includes:
Position, width, height, color.
Further, described device also includes:
Configuration module, the configuration information for receiving input;The configuration information includes export type, derives picture
The storing path of form, static page;
The auto-building html files device is generated according to DOM structure:
The auto-building html files device generates respective class according to the export type in the configuration information according to DOM structure
The file for describing page structure of type;
The memory module derives the picture:
The memory module derives picture and saves as the derivation picture format in the configuration information.
Further, the figure layer resolver is additionally operable to judge that the storing path of static page whether there is, if do not deposited
Corresponding catalogue is created in storing path then according to the static page.
At least one embodiment of the application can quickly generate static page, and the static state for being generated according to PSD files
The page is compatible in various browsers.Another embodiment of the application can voluntarily set picture format, export type,
Storing path etc..
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the method for the generation static page of embodiment one;
Fig. 2 is a schematic flow sheet for alternative of embodiment one;
Fig. 3 is the schematic block diagram of the device of the generation static page of embodiment two;
Fig. 4 be embodiment two an alternative in figure layer resolver course of work schematic diagram;
Fig. 5 be embodiment two an alternative in auto-building html files device course of work schematic diagram.
Specific embodiment
The technical scheme of the application is described in detail below in conjunction with drawings and Examples.
If it should be noted that not conflicting, each feature in the embodiment of the present application and embodiment can be tied mutually
Close, within the protection domain of the application.In addition, though logical order is shown in flow charts, but in some situations
Under, shown or described step can be performed with different from order herein.
Embodiment one, a kind of method for generating static page, as shown in figure 1, including:
S101, by the PSD files of static page to be generated carry out section obtain one or more pictures;
S102, the map data mining platform parsed in the PSD files, obtain the attribute information of each picture, by each figure
The attribute information of piece is packaged into map data mining platform data;
S103, by map data mining platform data conversion into DOM (Document Object Model, DOM Document Object Model) structure,
File for describing page structure is generated according to the DOM structure;
S104, the picture is derived, and described save as a static page for describing the file of page structure.
Static page can be quickly generated according to PSD files in the present embodiment, the PSD files are adobe
The private file form of PhotoShop, it remains the full detail of the image files such as figure layer, and wherein step S101 can be according to
Existing microtomy is realized.The file for describing page structure can be HTML (HTML) file,
Can also be XML (extensible markup language) file, the text that the language that can also be other can describe page structure is write
Part.
The page derived from existing slice tool is usually table layouts, because different browsers are to table labels
Analysis mode is not quite similar, it is possible that causing compatibling problem;And the present embodiment is first to be converted to DOM structure, wrapped in DOM structure
The page structure information such as layout and pattern of the page is included;Generating html file or other further according to DOM structure can describe the page
The file of structure;Because DOM structure meets usual browser resolves standard, therefore the html file and picture of generation are constituted
Static page is compatible with various browsers.
In one alternative of the present embodiment, the map data mining platform data can be, but not limited to be json
A kind of (JavaScript Object Notation, data interchange format of lightweight) object.
In one alternative of the present embodiment, the attribute information can be, but not limited to include:Position, width, height,
Color etc..
In one alternative of the present embodiment, map data mining platform data conversion can also be wrapped into before the step of DOM structure
Include:Remove the redundant data in the map data mining platform data.
In one alternative of the present embodiment, methods described can also include:
Receive the configuration information of input;The configuration information includes export type, derives picture format, static page
Storing path.
Include in the alternative, the step of generate the file for describing page structure according to DOM structure:
According to the export type in the configuration information, according to DOM structure generation respective type for describing page
The file of face structure.
In the alternative, derive the picture the step of include:
Derive picture and save as the derivation picture format in the configuration information.
Export type includes html file, XML file etc.;Derivation picture format is including jpg, png, gif etc..
In the alternative, can also include before the step S104:
Judge that the storing path of static page whether there is, if there is no storing path wound then according to the static page
Build corresponding catalogue.
In the specific alternative of the present embodiment one, the above method is realized by a plug-in unit, its generation static page
Flow as shown in Fig. 2 including step 201~208.
201st, user opens PSD files using Photoshop, starts plug-in unit.
202nd, plug-in unit display allocation window.
203rd, user set derive picture format, design original text type (be such as the page that shows in a browser or
In mail show the page), the storing path of static page.
204th, user after accomplishing the setting up clicks on operation.
205th, the PSD files section that plug-in unit opens user, obtains multiple pictures;The map data mining platform of the PSD files is parsed,
Obtain the attribute information (including the position of the picture, width, height, color etc.) of each picture.
206th, map data mining platform data are generated according to attribute information, by map data mining platform data conversion into DOM structure, according to this
DOM structure generates the page, that is, generate the picture and html file of set derivation picture format, and is saved in set quiet
In the storing path of the state page.
207th, notify that user completes.
208th, the flow terminates after user confirms.
Embodiment two, a kind of device for generating static page, as shown in figure 3, including:
Section module 31, one or more pictures are obtained for the PSD files of static page to be generated to be carried out into section;
Figure layer resolver 32, for parsing the map data mining platform in the PSD files, obtains the attribute letter of each picture
Breath, map data mining platform data are packaged into by the attribute information of each picture;
Auto-building html files device 33, for by map data mining platform data conversion into DOM structure, being generated for retouching according to the DOM structure
State the file of page structure;
Memory module 34, for deriving the picture, and it is described for describe the file of page structure save as one it is quiet
The state page.
In one alternative of the present embodiment, the map data mining platform data are json objects.
In one alternative of the present embodiment, the attribute information includes:
Position, width, height, color.
In one alternative of the present embodiment, the figure layer resolver 32 is tied by map data mining platform data conversion into DOM
Before structure, it is additionally operable to remove the redundant data in the map data mining platform data.
In one alternative of the present embodiment, described device also includes:
Configuration module 35, the configuration information for receiving input;The configuration information includes export type, derives figure
The storing path of piece form, static page.
In the alternative, the auto-building html files device 33 is generated according to DOM structure is for describing the file of page structure
Refer to:
The auto-building html files device 33 is corresponding according to DOM structure generation according to the export type in the configuration information
The file for describing page structure of type.
In the alternative, the memory module 34 derives the picture and refers to:
The memory module 34 derives picture and saves as the derivation picture format in the configuration information.
In the alternative, the figure layer resolver 32 is additionally operable to judge that the storing path of static page whether there is, such as
Fruit creates corresponding catalogue in the absence of storing path then according to the static page.
In one alternative of the present embodiment, the workflow of figure layer resolver 32 is as shown in figure 4, including step 401
~405.
401st, input figure layer object (PSD files).
402nd, check that the storing path of static page whether there is, if there is no then carrying out step 403;If there is then
Carry out step 404.
403rd, create directory, then carry out step 404.
404th, figure layer data are processed, including is parsed attribute information and is packaged into map data mining platform data;When All Layers treatment
After complete, step 405 is carried out.
405th, map data mining platform data are exported;Terminate.
The workflow of auto-building html files device 33 as shown in figure 5, including step 501~505.
501st, map data mining platform data are input into.
502nd, the redundant data in the map data mining platform data is removed.
503rd, according to the map data mining platform data genaration DOM structure.
504th, html file is generated according to DOM structure.
505th, html file is exported;Terminate.
One of ordinary skill in the art will appreciate that all or part of step in the above method can be instructed by program
Related hardware is completed, and described program can be stored in computer-readable recording medium, such as read-only storage, disk or CD
Deng.Alternatively, all or part of step of above-described embodiment can also be realized using one or more integrated circuits.Accordingly
Ground, each module/unit in above-described embodiment can be realized in the form of hardware, it would however also be possible to employ the shape of software function module
Formula is realized.The application is not restricted to the combination of the hardware and software of any particular form.
Certainly, the application can also have other various embodiments, ripe in the case of without departing substantially from the application spirit and its essence
Know those skilled in the art and work as and various corresponding changes and deformation, but these corresponding changes and change can be made according to the application
Shape should all belong to the protection domain of claims hereof.
Claims (10)
1. it is a kind of generate static page method, it is characterised in that including:
The PSD files of static page to be generated are carried out into section and obtains one or more pictures;
The map data mining platform in the PSD files is parsed, the attribute information of each picture is obtained, the attribute of each picture is believed
Breath is packaged into map data mining platform data;
By map data mining platform data conversion into DOM Document Object Model DOM structure, generated for describing page structure according to the DOM structure
File;
The picture is derived, and described saves as a static page for describing the file of page structure.
2. the method for claim 1, it is characterised in that:
The map data mining platform data are json objects.
3. the method for claim 1, it is characterised in that the attribute information includes:
Position, width, height, color.
4. the method for claim 1, it is characterised in that also include:
Receive the configuration information of input;The configuration information includes export type, derives picture format, the guarantor of static page
Deposit path;
It is described generated according to DOM structure for describing page structure file the step of include:
According to the export type in the configuration information, according to DOM structure generation respective type for describing page knot
The file of structure;
The step of derivation picture, includes:
Derive picture and save as the derivation picture format in the configuration information.
5. method as claimed in claim 4, it is characterised in that the derivation picture, and it is described for describing page knot
Also include before the step of file of structure saves as a static page:
Judge that the storing path of static page whether there is, phase is created if there is no storing path then according to the static page
The catalogue answered.
6. it is a kind of generate static page device, it is characterised in that including:
Section module, one or more pictures are obtained for the PSD files of static page to be generated to be carried out into section;
Figure layer resolver, for parsing the map data mining platform in the PSD files, obtains the attribute information of each picture, will be each
The attribute information of the picture is packaged into map data mining platform data;
Auto-building html files device, for by map data mining platform data conversion into DOM structure, being generated for describing the page according to the DOM structure
The file of structure;
Memory module, for deriving the picture, and described saves as a static page for describing the file of page structure.
7. device as claimed in claim 6, it is characterised in that:
The map data mining platform data are json objects.
8. device as claimed in claim 6, it is characterised in that the attribute information includes:
Position, width, height, color.
9. device as claimed in claim 6, it is characterised in that also include:
Configuration module, the configuration information for receiving input;The configuration information includes export type, derives picture lattice
The storing path of formula, static page;
The auto-building html files device is generated according to DOM structure:
The auto-building html files device generates respective type according to the export type in the configuration information according to DOM structure
File for describing page structure;
The memory module derives the picture:
The memory module derives picture and saves as the derivation picture format in the configuration information.
10. device as claimed in claim 9, it is characterised in that:
The figure layer resolver is additionally operable to judge that the storing path of static page whether there is, if there is no then according to the static state
The storing path of the page creates corresponding catalogue.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310062812.4A CN104020984B (en) | 2013-02-28 | 2013-02-28 | A kind of method and device for generating static page |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310062812.4A CN104020984B (en) | 2013-02-28 | 2013-02-28 | A kind of method and device for generating static page |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104020984A CN104020984A (en) | 2014-09-03 |
CN104020984B true CN104020984B (en) | 2017-07-07 |
Family
ID=51437761
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310062812.4A Active CN104020984B (en) | 2013-02-28 | 2013-02-28 | A kind of method and device for generating static page |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104020984B (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104978723B (en) * | 2014-04-14 | 2018-04-03 | 阿里巴巴集团控股有限公司 | A kind of image processing method and device |
CN105739963B (en) * | 2014-12-12 | 2019-03-15 | 博雅网络游戏开发(深圳)有限公司 | The method and apparatus for generating webpage |
CN107203536A (en) * | 2016-03-16 | 2017-09-26 | 阿里巴巴集团控股有限公司 | Online browse method, device and the equipment of content |
CN105825402A (en) * | 2016-03-17 | 2016-08-03 | 广州筷子信息科技有限公司 | Method and device for orientating ad creative element |
CN106469220B (en) * | 2016-09-09 | 2020-07-24 | 北京星选科技有限公司 | Method and system for generating dynamic effect page |
CN106777077A (en) * | 2016-12-13 | 2017-05-31 | 网易(杭州)网络有限公司 | The generation method and device of webpage |
CN107454456B (en) * | 2017-09-06 | 2020-09-08 | 武汉斗鱼网络科技有限公司 | Management control method and system for floating layer elements |
CN108287707B (en) * | 2017-09-13 | 2021-03-02 | 深圳壹账通智能科技有限公司 | JSX file generation method and device, storage medium and computer equipment |
CN107622134B (en) * | 2017-10-16 | 2021-02-19 | 杭州时间线信息科技有限公司 | Method for manufacturing automatic design layout type detail page by combining visual identification and artificial intelligence |
CN108984172B (en) * | 2018-05-31 | 2022-04-26 | 北京奇艺世纪科技有限公司 | Interface file generation method and device |
CN109710258A (en) * | 2018-12-28 | 2019-05-03 | 北京金山安全软件有限公司 | WeChat applet interface generation method and device |
CN110138651A (en) * | 2019-05-17 | 2019-08-16 | 重庆八戒电子商务有限公司 | Email automatic generation method, system, medium and electronic equipment |
CN112989244A (en) * | 2019-12-02 | 2021-06-18 | 广州凡科互联网科技股份有限公司 | Psd importing method for generating H5 page based on web-side shortcut |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101101602A (en) * | 2007-07-27 | 2008-01-09 | 华为技术有限公司 | Data format verification method and device |
CN102695187A (en) * | 2012-06-01 | 2012-09-26 | 重庆邮电大学 | Distributed Web-based device and method for testing 6LoWPAN protocol consistency |
US8306255B1 (en) * | 2008-08-28 | 2012-11-06 | Intuit Inc. | Snapshot-based screen scraping |
-
2013
- 2013-02-28 CN CN201310062812.4A patent/CN104020984B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101101602A (en) * | 2007-07-27 | 2008-01-09 | 华为技术有限公司 | Data format verification method and device |
US8306255B1 (en) * | 2008-08-28 | 2012-11-06 | Intuit Inc. | Snapshot-based screen scraping |
CN102695187A (en) * | 2012-06-01 | 2012-09-26 | 重庆邮电大学 | Distributed Web-based device and method for testing 6LoWPAN protocol consistency |
Non-Patent Citations (1)
Title |
---|
PSD文档信息获取与XML表达自动阅卷研究;张丽娜;《中国优秀硕士学位论文全文数据库信息科技辑》;20100715(第07期);第26-30页,第36-49页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104020984A (en) | 2014-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104020984B (en) | A kind of method and device for generating static page | |
CN107451296B (en) | A kind of Website Module rendering intent component-based | |
JP6748071B2 (en) | Web content generation method and system | |
CN105574049B (en) | Page processing method, device and system for mobile application | |
US10282399B2 (en) | System and method for web content presentation management | |
US20130191732A1 (en) | Fixed Format Document Conversion Engine | |
CN103853806A (en) | Method and device for converting table | |
CN102929867A (en) | Technology used for automatically translating a document | |
CN103488732A (en) | Generation method and device of static pages | |
CN103136317A (en) | Implement method of on-line examination and approval informatization of engineering contracts in engineering management system | |
CN103383645A (en) | Code generation method and system | |
US9141403B2 (en) | Data-driven schema for describing and executing management tasks in a graphical user interface | |
CN107943915A (en) | The method and device of OFD file Real time displayings based on HTML5 | |
CN103389895A (en) | Method and system for generating front end page | |
CN102360274A (en) | Variable-data printing template realization device and application method for same | |
CN103927385A (en) | Unifying method and device of data model | |
CN108268260A (en) | It is a kind of quick micro- using assemble method based on integrated support technology | |
CN106933887A (en) | A kind of data visualization method and device | |
CN102830974A (en) | Visual auxiliary development tool for rapid generation of JAVA codes | |
CN103246503A (en) | Application development framework for enterprise management software | |
CN103294463A (en) | Editing system and method | |
CN111708529B (en) | Method for generating form through dragging based on angular | |
CN106502977B (en) | A kind of sheet disposal method and form system based on B/S framework | |
CN103870543B (en) | A kind of method and device reconstructed for document files | |
CN110058849A (en) | Generation method, device, computer equipment and the storage medium of flow chart |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |