CN113672833A - Method for generating webpage template and related equipment - Google Patents

Method for generating webpage template and related equipment Download PDF

Info

Publication number
CN113672833A
CN113672833A CN202010406351.8A CN202010406351A CN113672833A CN 113672833 A CN113672833 A CN 113672833A CN 202010406351 A CN202010406351 A CN 202010406351A CN 113672833 A CN113672833 A CN 113672833A
Authority
CN
China
Prior art keywords
webpage
tag
web page
file
template
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.)
Pending
Application number
CN202010406351.8A
Other languages
Chinese (zh)
Inventor
蒋文赛
王杭
帅煜韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010406351.8A priority Critical patent/CN113672833A/en
Publication of CN113672833A publication Critical patent/CN113672833A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The embodiment of the application provides a method for generating a webpage template and related equipment, wherein the method comprises the following steps: separating the content of a sample webpage to obtain a pure HTML file and an independent CSS file of a cascading style sheet, wherein the pure HTML refers to the independent CSS file in a linked mode; replacing the display tag in the clean HTML file with an editing tag; and then, generating an editable webpage template according to the editing tag, and by adopting the embodiment of the application, the webpage template can be generated quickly on the basis of saving development cost.

Description

Method for generating webpage template and related equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method for generating a web page template and a related device.
Background
With the continuous development of internet technology, in order to generate a webpage quickly, development is performed according to the existing webpage, although an expected effect can be achieved, a large amount of manpower and material resources are consumed, development cost is high, and under the condition that online time of the webpage is tight and a task is heavy, more time needs to be invested, so that how to save the development cost to generate a webpage template is achieved, and the technical problem that a person in the field is solving is to generate the webpage quickly.
Disclosure of Invention
The embodiment of the application discloses a method for generating a webpage template and related equipment, which can generate the webpage template on the basis of saving development cost.
The first aspect of the embodiment of the present application discloses a method for generating a web page template, which includes:
separating the content of a sample webpage to obtain a pure HTML file and an independent CSS file of a cascading style sheet, wherein the pure HTML refers to the independent CSS file in a linked mode;
replacing the display tag in the pure HTML file with an editing tag;
and generating an editable webpage template according to the editing label.
In the method, the independent CSS file and the pure HTML file are obtained by separating the content of the sample webpage, the operation and management are convenient, the development efficiency is improved, the development cost is saved, the display label is replaced by the editing label, the editable webpage template is generated according to the editing label, a user can independently edit and drag the editing label, the personalized template is customized, the user experience is greatly improved, the webpage templates of various sample webpages can be quickly obtained by the method for generating the webpage template, and the favorite or interested webpages of the user can be quickly converted into the editable webpage template by the user under the condition of low development cost, so that the target webpage is generated.
In an optional aspect, the generating an editable web page template according to the edit tag includes:
generating a plurality of webpage visual plates according to the editing labels;
and generating an editable webpage template according to the plurality of webpage visual plates.
In yet another optional aspect, before replacing the display tag in the clean HTML file with the edit tag, the method further includes:
and removing the text information and/or the wrongly displayed pictures in the pure HTML file.
In the method, the display of irrelevant information is avoided by removing the text information and/or the wrongly displayed picture, and the quality of the webpage template can be improved.
In another optional scheme, after separating the content of the sample web page to obtain a clean HTML file and an independent CSS file, the method further includes:
removing hidden styles in the separate CSS file.
In the method, the hidden style is removed, so that the disorder of the structure of the webpage template is avoided, and the quality of the webpage template is improved.
In yet another optional scheme, after the generating an editable webpage template according to the edit tag, the method further includes:
receiving content input in the edit tag in the web page template;
and generating a target webpage according to the content input in the editing label in the webpage template, wherein the editing label in the webpage template is transformed into a display label in the target webpage.
In the method, after the webpage template is generated, the user can input the content in the webpage template so as to generate the target webpage, so that the user can edit and store the webpage information, and the user experience is greatly improved.
In yet another optional scenario, after replacing the display tag in the clean HTML file with an edit tag, and before generating the target web page according to the content input in the edit tag in the web page template, the method further includes:
saving a first mapping relation between the display label and the editing label; the first mapping relation is used for determining an editing label needing to be converted into a display label when the webpage template is converted into the target webpage.
In the method, the first mapping relation between the display label and the edit label is stored, so that other equipment can configure the first mapping relation conveniently, and the first mapping relation can be changed dynamically in real time.
In another optional scheme, after separating the content of the sample web page to obtain a clean HTML file and a CSS file, the method further includes:
receiving first indication information sent by other equipment, wherein the first indication information is used for indicating a second mapping relation between the display tag and the editing tag, and the second mapping relation is used for determining the editing tag required to be converted into the display tag when the webpage template is converted into the target webpage, and/or is used for determining the display tag required to be converted into the editing tag when the webpage template is generated according to the sample webpage.
In the method, the first electronic device may convert the display tag into the edit tag according to the first indication information by receiving the first indication information of the other device, and store the second mapping relationship between the display tag and the edit tag through the other device, so that the other device can configure the second mapping relationship conveniently, and the second mapping relationship can be changed dynamically in real time.
In another optional scheme, before receiving the first indication information sent by the other device, the method further includes:
and sending a request message to other equipment, wherein the request message is used for requesting to send the first indication information.
In another optional scheme, after receiving the first indication information sent by the other device, the method further includes:
and receiving second indication information of other equipment, wherein the second indication information is used for indicating that one or more display tags in the second mapping relation are replaced by editing tags.
In the method, when the other device needs to replace one or more display tags in the second mapping relationship with the editing tag, the other device sends second indication information to the first electronic device, so that the other device can conveniently change the second mapping relationship in real time.
In yet another optional scheme, before separating the content of the sample web page to obtain a clean HTML file and a CSS file, the method further includes:
determining a web page view of the sample web page;
storing the content of the sample webpage into a preset file path by calling an interface in the webpage view;
and obtaining the content of the sample webpage from the preset path.
In the method, the content of the sample webpage can be rapidly stored in the preset file path, so that the subsequent use is facilitated.
In yet another alternative, the determining the web page view of the sample web page includes:
determining Activity of the sample webpage;
determining a root view according to the Activity;
traversing a view control in the root view to determine the web page view.
According to the method, the information of the sample webpage can be acquired without actively accessing the URL of the sample webpage, but the information of the sample webpage is directly acquired from the bottom-layer Activity View View in a traversing mode, so that the access times are reduced, and the application is wider.
In another alternative, the separating the content of the sample web page to obtain a clean HTML file and an independent CSS file includes:
separating the content of the sample webpage to obtain a pure HTML file, an independent CSS file and an independent JavaScript file, wherein the pure HTML refers to the JavaScript file in a linked mode.
The second aspect of the embodiment of the present application discloses an apparatus for generating a web page template, which includes:
the separation unit is used for separating the content of the sample webpage to obtain a pure HTML file and an independent CSS file, wherein the pure HTML file refers to the independent CSS file in a linked mode;
the replacing unit is used for replacing the display tag in the pure HTML file with an editing tag;
and the first generating unit is used for generating an editable webpage template according to the editing label.
In the device, independent CSS files and pure HTML files are obtained by separating the content of the sample webpage, operation and management are facilitated, development efficiency is improved, development cost is saved, the display label is replaced by the editing label, the editable webpage template is generated according to the editing label, a user can independently edit and drag the editing label, the personalized template is customized, user experience is greatly improved, the webpage templates of various sample webpages can be rapidly obtained by the method for generating the webpage template, and the favorite or interested webpages of the user can be rapidly converted into the editable webpage template by the user under the condition of low development cost, so that the target webpage is generated.
In an optional scheme, the first generating unit is further configured to generate a plurality of web page visual plates according to the editing tags; the first generating unit is further configured to generate an editable webpage template according to the plurality of webpage visual frames.
In yet another alternative, the apparatus further comprises: and the first removing unit is used for removing the text information and/or the wrongly displayed pictures in the clean HTML file before replacing the display tag in the clean HTML file with the editing tag.
In the device, the display of irrelevant information is avoided by removing the character information and/or the wrongly displayed picture, so that the quality of the webpage template can be improved.
In yet another alternative, the apparatus further comprises: and the second removing unit is used for removing the hidden style in the independent CSS file after separating the content of the sample webpage to obtain a pure HTML file of the hypertext markup language and the independent CSS file.
In the device, the hidden pattern is removed, so that the disorder of the structure of the webpage template is avoided, and the quality of the webpage template is improved.
In yet another alternative, the apparatus further comprises: a receiving unit configured to receive content input in the edit tag in the web page template after generating an editable web page template from the edit tag;
a second generating unit, configured to generate a target web page according to content input in the editing tag in the web page template, where the editing tag in the web page template is transformed into a display tag in the target web page.
In the device, after the webpage template is generated, the user can input the content in the webpage template so as to generate the target webpage, so that the user can edit and store the webpage information, and the user experience is greatly improved.
In yet another alternative, the apparatus further comprises: a storage unit, configured to, after replacing a display tag in the clean HTML file with an edit tag, store a first mapping relationship between the display tag and the edit tag before generating a target web page according to content input in the edit tag in the web page template; the first mapping relation is used for determining an editing label needing to be converted into a display label when the webpage template is converted into the target webpage.
In the device, the first mapping relation between the display label and the edit label is saved, so that other equipment can configure the first mapping relation conveniently, and the first mapping relation can be changed dynamically in real time.
In yet another alternative, the apparatus further comprises: the receiving unit is used for receiving first indication information sent by other equipment through the communication unit after separating the content of a sample webpage to obtain a pure hypertext markup language (HTML) file and an independent Cascading Style Sheet (CSS) file, wherein the first indication information is used for indicating a second mapping relation between the display tag and the editing tag, and the second mapping relation is used for determining the editing tag which needs to be converted into the display tag when the webpage template is converted into a target webpage and/or determining the display tag which needs to be converted into the editing tag when the webpage template is generated according to the sample webpage.
In the apparatus, the first electronic device may receive first indication information of another device, convert the display tag into the edit tag according to the first indication information, and store a second mapping relationship between the display tag and the edit tag through the another device, so that the another device may conveniently configure the second mapping relationship, and may dynamically change the second mapping relationship in real time.
In yet another alternative, the apparatus further comprises: the sending unit is further configured to send a request message to the other device before receiving the first indication information sent by the other device, where the request message is used to request sending of the first indication information.
In yet another optional scheme, the receiving unit is further configured to receive second indication information of another device after receiving the first indication information sent by the other device, where the second indication information is used to indicate that one or more display tags in the second mapping relationship are replaced with editing tags.
In the above apparatus, when the other device needs to replace one or more display tags in the second mapping relationship with the editing tag, the other device sends second indication information to the first electronic device, so that the other device can change the second mapping relationship in real time.
In yet another alternative, the apparatus further comprises: the determining unit is used for determining the webpage view of the sample webpage before separating the content of the sample webpage to obtain a pure HTML file and an independent CSS file; the storage unit is also used for storing the content of the sample webpage into a preset file path by calling an interface in the webpage view; and the acquisition unit is used for acquiring the content of the sample webpage from the preset path.
In the device, the content of the sample webpage can be rapidly stored in the preset file path, so that the subsequent use is facilitated.
In yet another optional scheme, the determining unit is further configured to determine Activity of the sample web page; the determining unit is further configured to determine a root view according to the Activity; the determining unit is further configured to traverse the view control in the root view to determine the web page view.
In the device, the information of the sample webpage can be obtained without actively accessing the URL of the sample webpage, but the information of the sample webpage is directly obtained from the bottom-layer Activity View View in a traversing manner, so that the access times are reduced, and the application is wider.
In another optional scheme, the separation unit is further configured to separate the content of the sample web page to obtain a pure HTML file, an independent CSS file, and an independent JavaScript, where the pure HTML refers to the JavaScript in a linked form.
A third aspect of the embodiments of the present application discloses an apparatus for generating a web page template, where the apparatus includes a processor, a memory, and a communication interface, where the memory is used to store a computer program, and the processor calls the computer program to perform the following operations:
separating the content of a sample webpage to obtain a pure HTML file and an independent CSS file of a cascading style sheet, wherein the pure HTML refers to the independent CSS file in a linked mode;
replacing the display tag in the pure HTML file with an editing tag;
and generating an editable webpage template according to the editing label.
In the device, independent CSS files and pure HTML files are obtained by separating the content of the sample webpage, operation and management are facilitated, development efficiency is improved, development cost is saved, the display label is replaced by the editing label, the editable webpage template is generated according to the editing label, a user can independently edit and drag the editing label, the personalized template is customized, user experience is greatly improved, the webpage templates of various sample webpages can be rapidly obtained by the method for generating the webpage template, and the favorite or interested webpages of the user can be rapidly converted into the editable webpage template by the user under the condition of low development cost, so that the target webpage is generated.
In an optional scheme, the processor is further configured to generate a plurality of web page visual plates according to the edit tag; and generating an editable webpage template according to the plurality of webpage visual plates.
In yet another alternative, the processor is further configured to remove text information and/or incorrectly displayed pictures in the clean HTML file before replacing the display tag in the clean HTML file with the edit tag.
In the device, the display of irrelevant information is avoided by removing the character information and/or the wrongly displayed picture, so that the quality of the webpage template can be improved.
In yet another alternative, the processor is further configured to remove hidden styles in the separate CSS file after separating the content of the sample web page to obtain a clean HTML file and a separate CSS file.
In the device, the hidden pattern is removed, so that the disorder of the structure of the webpage template is avoided, and the quality of the webpage template is improved.
In yet another alternative, the processor is further configured to receive, through the communication interface, content input in the edit tag in the web page template after generating an editable web page template according to the edit tag; and generating a target webpage according to the content input in the editing label in the webpage template, wherein the editing label in the webpage template is transformed into a display label in the target webpage.
In the device, after the webpage template is generated, the user can input the content in the webpage template so as to generate the target webpage, so that the user can edit and store the webpage information, and the user experience is greatly improved.
In yet another optional scheme, the processor is further configured to, after replacing a display tag in the clean HTML file with an edit tag, save a first mapping relationship between the display tag and the edit tag before generating a target web page according to content input in the edit tag in the web page template; the first mapping relation is used for determining an editing label needing to be converted into a display label when the webpage template is converted into the target webpage.
In the device, the first mapping relation between the display label and the edit label is saved, so that other equipment can configure the first mapping relation conveniently, and the first mapping relation can be changed dynamically in real time.
In yet another optional scheme, the processor is further configured to receive, through the communication interface, first indication information sent by another device after separating content of a sample web page to obtain a pure HTML file and an independent CSS file, where the first indication information is used to indicate a second mapping relationship between the display tag and the edit tag, and the second mapping relationship is used to determine the edit tag that needs to be converted into the display tag when the web page template is converted into a target web page, and/or is used to determine the display tag that needs to be converted into the edit tag when the web page template is generated according to the sample web page.
In the apparatus, the first electronic device may receive first indication information of another device, convert the display tag into the edit tag according to the first indication information, and store a second mapping relationship between the display tag and the edit tag through the another device, so that the another device may conveniently configure the second mapping relationship, and may dynamically change the second mapping relationship in real time.
In yet another optional scheme, the processor is further configured to send, through the communication interface, a request message to the other device before receiving the first indication information sent by the other device, where the request message is used to request to send the first indication information.
In yet another optional scheme, the processor is further configured to receive second indication information of the other device after receiving, through the communication interface, the first indication information sent by the other device, where the second indication information is used to indicate that one or more display tags in the second mapping relationship are replaced with editing tags.
In the above apparatus, when the other device needs to replace one or more display tags in the second mapping relationship with the editing tag, the other device sends second indication information to the first electronic device, so that the other device can change the second mapping relationship in real time.
In yet another alternative, the processor is further configured to determine a web page view of a sample web page before separating content of the sample web page to obtain a clean HTML file and a CSS file; storing the content of the sample webpage into a preset file path by calling an interface in the webpage view; and obtaining the content of the sample webpage from the preset path.
In the device, the content of the sample webpage can be rapidly stored in the preset file path, so that the subsequent use is facilitated.
In yet another alternative, the processor is further configured to determine Activity of the sample web page; determining a root view according to the Activity; traversing a view control in the root view to determine the web page view.
In the device, the information of the sample webpage can be obtained without actively accessing the URL of the sample webpage, but the information of the sample webpage is directly obtained from the bottom-layer Activity View View in a traversing manner, so that the access times are reduced, and the application is wider.
In yet another optional scheme, the processor is further configured to separate contents of the sample web page to obtain a pure HTML file, an independent CSS file, and an independent JavaScript, where the pure HTML references the JavaScript in a linked form.
A fourth aspect of the embodiments of the present application discloses a chip, where the chip includes at least one processor and an interface circuit, and optionally, the chip further includes a memory, where the memory, the interface circuit, and the at least one processor are interconnected by a line, and a computer program is stored in the at least one memory; the computer program, when executed by the processor, implements the method described in any aspect or alternative aspects of any aspect.
A fifth aspect of embodiments of the present application discloses a computer-readable storage medium storing a computer program which, when executed by a processor, implements the method described in any one of the aspects or in any alternative of the aspects.
A sixth aspect of embodiments of the present application discloses a computer program product for implementing the method described in any one of the aspects or in any alternative of the aspects when the computer program product runs on a processor.
Drawings
The drawings used in the embodiments of the present application are described below.
FIG. 1 is a schematic structural diagram of a system for generating a web page template according to an embodiment of the present application;
FIG. 2 is a schematic flowchart of generating a web page template according to an embodiment of the present disclosure;
FIG. 3 is a display page of a sample web page provided by an embodiment of the present application;
FIG. 4 is a schematic flowchart of determining a WebView instance according to an embodiment of the present application;
FIG. 5 is an editable web page template provided by an embodiment of the application;
FIG. 6 is a schematic structural diagram of an apparatus for generating a web page template according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an apparatus for generating a web page template according to an embodiment of the present application.
Detailed Description
The embodiments of the present application will be described below with reference to the drawings.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a system for generating a web page template according to an embodiment of the present application, where the system for generating a web page template includes a first electronic device 101 and a second electronic device 102, where the first electronic device 101 may be a tablet computer, a notebook computer, a palmtop computer, and the like, and the first electronic device 101 may also be a single server or a server cluster formed by multiple servers, or may also be other hardware devices with computing capability. The second electronic device 102 may be a single server, or may be a server cluster composed of a plurality of servers, or may be another hardware device with computing capability. The first electronic device 101 may include a self-programming platform, and the self-programming platform receives a Uniform Resource Locator (URL) of a sample web page to convert the sample web page into an editable web page template, so as to generate a target web page quickly. The second electronic device 102 can be used to configure or modify rules in the process of the first electronic device converting the sample web page into an editable web page template. The second electronic device 102 may refer to other devices described below.
A webpage template generating method comprises the following steps: performing aggregation calculation on similar webpages on the sample webpages to obtain a set formed by the similar webpages; analyzing the page structures of all the webpages in the set aiming at each set to obtain a DOM tree structure of each webpage; and analyzing the DOM tree structures of all the webpages in the sets, respectively generating a DOM tree template corresponding to each set, and taking the DOM tree template as the webpage structure template of the set. However, this method of generating a web page template involves a large amount of computation, is complicated, and is not easy to be actually operated.
The webpage template generating method comprises the following steps: downloading a source code of a page according to a Uniform Resource Locator (URL) of the page; then, automatically analyzing the page structure according to the source code of the page, and calculating the hash value of each structure in the page; then, manually judging which structures in the page correspond to the titles, which structures correspond to the texts, which structures correspond to the publication time and the like according to the source codes of the page, and marking; and then, generating a corresponding relation between the hash value of the structure and the content type of the structure to obtain a webpage template. However, this method of generating a web page template first needs to manually obtain the URL of the web page, and part of the scene cannot be obtained, and part of the URL carries security verification. Moreover, the content type of the manual marking page structure is performed through text editing, a large amount of irrelevant content exists in the webpage template, and some webpage templates even have tens of thousands of lines, so that the manual marking efficiency is very low. Therefore, how to generate the web page template with reduced development cost and thus generate the web page rapidly is a technical problem that is being solved by those in the art.
Referring to fig. 2, fig. 2 is a method for generating a web page template according to an embodiment of the present application, where the method includes, but is not limited to, the following steps:
step S201: the first electronic device obtains a Uniform Resource Locator (URL) of a sample web page.
In particular, the sample web page may be a web page that is liked, interesting to the user, and so on. The uniform resource locator is a uniform resource locator, i.e., a network address, of the world wide web (www). The first electronic device may obtain the URL of the sample webpage in various ways, such as the user copying the URL of the sample webpage to the first electronic device, or the user inputting the URL of the sample webpage through an input method.
For example, the display page of the sample webpage is shown in FIG. 3, the URL of the sample webpage is Http:// www.qiwei.com, and the user copies the URL of the sample webpage to the first electronic device, and the first electronic device receives the URL of the sample webpage.
Step S202: the first electronic device obtains content of a sample web page.
Specifically, the content of the sample web page includes a hypertext markup language (HTML), a Cascading Style Sheet (CSS), and/or a scripting language (JavaScript), that is, a language for describing a cascading style of the web page element is directly embodied in the HTML, and a scripting language for describing the web page element is directly embodied in the HTML (if a JavaScript language exists), and the content of the sample web page may be an offline cache file of the sample web page.
In an optional scheme, the obtaining, by the first electronic device, the content of the sample webpage may specifically be: determining, by the first electronic device, a web page view of the sample web page; and then, storing the content of the sample webpage into a preset file path by calling an interface in the webpage view, and then obtaining the content of the sample webpage from the preset path by the first electronic equipment.
Specifically, the web page view WebView is used for loading and displaying the sample web page, and the displayed information of the sample web page can be acquired through the WebView. The interface of the web page view may be a savebardive interface, and may also be an interface of other offline cache files for storing the sample web page, which is not limited in the embodiment of the present application. The preset file path may be customized for the first electronic device, or selected by the user in advance, or configured by other devices.
For example, if the preset file path is E: \, the first electronic device stores the content of the sample web page by calling a savebaachive interface of WebView (an interface provided by android for storing offline cache files) after acquiring the instance of WebView, and stores the content of the currently displayed sample web page into the preset file path, and the first electronic device can acquire the content of the sample web page under the preset file path.
In an alternative, the first electronic device determining the web page view of the sample web page includes: determining Activity of the sample webpage; determining a root view according to the Activity; traversing a view control in the root view to determine the web page view.
Specifically, Activity is one of four large components in an Android component, and comprises a default display window which is provided with a one-layer view, and the one-layer view comprises a root view for setting the window size. An Activity is typically a separate screen on which controls are displayed, and the specified controls may be displayed by View. An Activity construct initializes a Window, which has a root view DecoView. The root View refers to the root layout of the sample web page display, the outermost View. View controls include a title view TitleView, a text view textView, a content view ContentView, a Button, a picture view ImageView, a ListView, and a web view WebView, among others.
For example, as shown in fig. 4, fig. 4 shows a flowchart of determining WebView, step 1: the first electronic equipment acquires the Activity of the sample webpage, and step 2: obtaining a DecoView instance of the Window object in the context according to the Activity, and 3: and traversing a view control in the DecView instance to obtain an instance of the webpage view WebView.
In an alternative, the first electronic device determining the web page view of the sample web page includes: and acquiring the URL of the sample webpage, and then establishing an instance of a webpage view WebView to access the URL of the sample webpage.
Step S203: the first electronic equipment separates the content of the sample webpage to obtain a pure HTML file and an independent Cascading Style Sheet (CSS) file.
Specifically, the content of the sample web page includes HTML (hypertext markup language) and CSS (cascading style sheet), that is, the language for describing the cascading style of the web page elements is directly embodied in the HTML, and then the HTML and CSS files in the sample web page are separated to obtain a clean HTML file and an independent CSS file. The clean HTML may refer to the separate CSS file in the form of a link, which may refer to an access path, i.e., the separate CSS file may be referred to in the form of an access path in the clean HTML file.
For example, the content of the sample webpage obtained by the first electronic device is
<!DOCTYPE html>
<head>
<meta name="viewport"content="width=device-width,initial-scale=1.0user-scalable=no"/>
<style>
.divbox{
width:400px;
height:260px;
border:1px solid#02DF82;
background-color:#EEEEEE;
position:fixed;
top:50%;
left:50%;
margin-top:-130px;
margin-left:-200px;
}
</style>
</head>
<div class="divbox">
<div class="divtop"></div>
<div class="divmid"></div>
<div class="divlogin">
e799bee5baa6e78988e69d8331333335326133<table class="tablelogin">
<tr>
< td class ═ tdleft "> username: </td >
<td class="tdright"><input type="text"/><td>
</tr>
<tr>
< td class ═ tdleft "> password: </td >
<td class="tdright"><input type="text"/><td>
</tr>
<tr>
<td colspan="2"class="tdcmd">
Input type ═ button "value ═ registration"/>, and
< input type ═ button "value ═ cancel ═ class ═ btncl"/>, and
</td>
</tr>
</table>
</div>
</div>
the first electronic device creates a file named test.css and then puts the content in the < style > </style > frame into the test.css file, resulting in a separate CSS file as test.css file
<style>
.divbox{
width:400px;
height:260px;
border:1px solid#02DF82;
background-color:#EEEEEE;
position:fixed;
top:50%;
left:50%;
margin-top:-130px;
margin-left:-200px;
}
</style>
The first electronic device then creates a clean test.html file, and copies the files except the content in the < style > </style > frame into the test.html file, so that the clean HTML file is the HTML file
<!DOCTYPE html>
<head>
<meta name="viewport"content="width=device-width,initial-scale=1.0user-scalable=no"/>
</head>
<div class="divbox">
<div class="divtop"></div>
<div class="divmid"></div>
<div class="divlogin">
e799bee5baa6e78988e69d8331333335326133<table class="tablelogin">
<tr>
< td class ═ tdleft "> username: </td >
<td class="tdright"><input type="text"/><td>
</tr>
<tr>
< td class ═ tdleft "> password: </td >
<td class="tdright"><input type="text"/><td>
</tr>
<tr>
<td colspan="2"class="tdcmd">
Input type ═ button "value ═ registration"/>, and
< input type ═ button "value ═ cancel ═ class ═ btncl"/>, and
</td>
</tr>
</table>
</div>
</div>
the clean HTML may then refer to the separate CSS file by way of a link, which means that the separate CSS file may be referred to in the HTML file by a link type ═ text/CSS ═ rel ═ stylesheet "href ═ test.
In an optional scheme, the separating the content of the sample web page to obtain a clean HTML file and an independent CSS file includes:
separating the content of the sample webpage to obtain a pure HTML file, an independent CSS file and an independent JavaScript file, wherein the pure HTML refers to the JavaScript file in a linked mode.
Specifically, the content of the sample web page includes a hypertext markup language (HTML), a Cascading Style Sheet (CSS), and a scripting language (JavaScript), that is, a language for describing a cascading style of the web page element is directly embodied in the HTML, and a scripting language for describing the web page element is directly embodied in the HTML.
For example, the first electronic device creates a pure test1.HTML file, and copies the files except the content in the < style > </style > frame and the content in the < script > </script > frame into the test1.HTML file, thereby obtaining the pure HTML file. The method includes the steps that an independent file named as test.js is newly built by first electronic equipment, and then content in a < script > </script > frame is placed into the file named as test.js, so that an independent JavaScript file is obtained. The pure HTML may refer to the JavaScript file in the form of a link, which means that the JavaScript file may be referred to by a link type of "text/css" rel of "stylesheet" href of "test.
Step S204: and the first electronic equipment removes the text information and/or the wrongly displayed pictures in the pure HTML file.
Specifically, the wrongly displayed picture refers to a picture that cannot be displayed in a web page displayed by pure HTML. The text information is the text in the web page displayed by pure HTML.
Optionally, the relevant rules for removing text information and/or incorrectly displayed pictures may be configured or changed by other devices.
For example, the clean HTML file includes: the method comprises the steps that < imgsrc: "E: \ logo.png" width: "500" height ═ 500 "/>, and a picture which cannot be displayed in a webpage displayed through pure HTML and is named logo is removed by the first electronic device, so that the picture which is displayed in error in the < imsrc:" E: \ logo.png "width:" 500 "height ═ 500"/>, becomes < img >; the pure HTML file comprises < h1 odor milk tea </h1>, and then the first electronic equipment removes the character information in < h1 odor milk tea </h1> to become < h1> </h1 >.
Step S205: the first electronic device removes the hidden pattern in the separate CSS file.
In particular, the hidden styles may include hiding text, hiding hyperlinks, hiding statistical codes, hiding excess pictures, hiding scroll bars, and hiding div layers, among others. Optionally, the relevant rule for removing the hidden pattern may be configured or changed by other devices.
For example, none is included in the CSS file for stand-alone, such as < div style ═ display: none; "> you cannot see my </div >, and may also include overflow that hide overflow div content or pictures, such as < div style ═ overflow that is hidden; width of 30 px; height:20 px; "> you are invisible from my </div >, and can also include overflow-y: hidden; and overlay-x: hidden or displayed scroll bars corresponding to the horizontal or vertical direction, the first electronic device deletes the above-mentioned hidden styles, such as display: none, overlay: hidden, and overlay-y: hidden; and overflow-x: hidden, etc.
Step S206: and replacing the display tag in the clean HTML file with an editing tag by the first electronic equipment.
Specifically, the display tag may be a tag for displaying characters, a tag for displaying pictures, and the like, the edit tag may be a tag for uploading pictures, a tag for uploading files, and the like, and optionally, after the first electronic device replaces the display tag with the edit tag, the edit tag is initialized.
For example, if the display tag in the clean HTML is < h1> </h1>, the first electronic device replaces the display tag < h1> </h1> with an edit tag < input type ═ text ">, and optionally initializes the edit tag to < input type ═ text" value >, please input a shop name ">. Or the display tag in the pure HTML has < img >, the first electronic device replaces the display tag < img > with an edit tag < input type ═ file ">.
In an optional scheme, after replacing the display tag in the clean HTML file with an edit tag, the first electronic device stores a first mapping relationship between the display tag and the edit tag before generating a target web page according to content input in the edit tag in the web page template.
Specifically, the first mapping relationship is used for determining an edit tag that needs to be converted into a display tag when converting the webpage template into the target webpage. The first mapping relationship between the display label and the edit label may be a replacement mapping table.
For example, as shown in table 1, table 1 represents a first mapping relationship of a display tag and an edit tag, and the first row in table 1 represents that the display tag < h1> </h1> is replaced with the edit tag < input type ═ text >, and saved; the second row represents that the display tag < img > is replaced with an edit tag < input type ═ file > and saved; the third row represents replacing and saving the display tag < h2> </h2> with the edit tag < input type ═ text >.
Table 1
Serial number Display label Editing label
1 <h1></h1> <input type="text">
2 <img> <input type="file">
3 <h2></h2> <input type="text">
In an alternative scheme, after separating the content of the sample webpage to obtain a pure HTML file and a CSS file, the first electronic device receives first indication information sent by other devices.
Specifically, the first indication information is used to indicate a second mapping relationship between the display tag and the edit tag, where the second mapping relationship is used to determine the edit tag that needs to be converted into the display tag when the web page template is converted into the target web page, and/or is used to determine the display tag that needs to be converted into the edit tag when the web page template is generated according to the sample web page.
Specifically, when the first electronic device needs to convert the display tag into the edit tag, but the first electronic device does not know the second mapping relationship between the display tag and the edit tag, and the second mapping relationship between the display tag and the edit tag is stored in another device, the another device may send, to the first electronic device at regular time (or according to another policy), first indication information, where the first indication information is used to indicate the second mapping relationship between the display tag and the edit tag, and accordingly, the first electronic device converts the display tag in the second mapping relationship into the edit tag according to the first indication information.
For example, the second mapping relationship between the display tag and the edit tag is shown in table 1, and the other device may select to send the first indication information to the first electronic device every 1 minute, where the first indication information is shown in table 1. Correspondingly, the first electronic device receives the first indication information and converts the display label into an editing label according to the first indication information.
In an optional scheme, before the first electronic device receives first indication information sent by other devices, the first electronic device sends a request message to the other devices, where the request message is used to request sending of the first indication information. For example, the first electronic device may send a request message to the other device if the display tag needs to be converted into the edit tag, but the first electronic device does not know the second mapping relationship between the display tag and the edit tag, and the second mapping relationship between the display tag and the edit tag is stored at the other device.
In an optional scheme, after the first electronic device receives the first indication information sent by the other device, the first electronic device may also receive second indication information of the other device.
Specifically, the second indication information is used to indicate that one or more display tags in the second mapping relationship are replaced with editing tags.
Specifically, after the second mapping relationship between a specific display tag and an edit tag is changed by the other device, a second indication message is sent to the first electronic device to indicate which display tag and which edit tag the mapping relationship between is specifically changed, and accordingly, the first electronic device synchronously changes the mapping relationship between the display tag and the edit tag.
For example, as described in table 1, when the other device determines to change the display tag < h1> </h1> and the edit tag < input type ═ text > with the sequence number 1 to the display tag < h1> </h1> and the edit tag < input type ═ file >, the other device transmits, to the first electronic device, second indication information for indicating to change the edit tag < input type ═ text "> corresponding to the display tag < h1> </h1> to the edit tag < input type ═ file" >.
Step S207: and the first electronic equipment generates an editable webpage template according to the editing label.
Specifically, the web page template is used to generate a target web page. The network template is a prepared webpage frame, and a user can input required contents in the webpage frame so as to generate a favorite webpage.
In an optional scheme, the first electronic device generates a plurality of webpage visual plates according to the editing tags; and generating an editable webpage template according to the plurality of webpage visual plates.
Specifically, generating a plurality of webpage visual plates according to the editing tags may refer to combining one or more editing tags into one webpage visual plate, where the webpage visual plate may also be referred to as a component, the component supports editing and dragging of a user, and correspondingly, the editing tags inside the component also support editing and dragging of the user. Generating an editable web page template from a plurality of web page visual blocks may refer to combining a plurality of web page visual blocks into one editable web page template.
For example, as shown in fig. 5, fig. 5 shows an editable webpage template, the first electronic device combines edit tags of < input type ═ text ">, < input type ═ file" >, into one webpage visual tile, as shown in fig. 5, text information is on the left, and the entirety of the form of the picture on the right can be one webpage visual tile, named as component 1, the first electronic device combines the edit tags of < input type ═ text ">, < input type ═ file" > into one webpage visual tile, as shown in fig. 5, the upper part is text information, and the lower part is a picture, and named as component 2. Further, a web page may include a plurality of visible blocks, for example, as shown in FIG. 5, the editable web page template includes component 1 and component 2.
Step S208: the method comprises the steps that first electronic equipment receives content input in an editing label in a webpage template; and generating a target webpage according to the content input in the editing label in the webpage template.
Specifically, the edit tag in the web page template is transformed to a display tag in the target web page. After receiving the input content in the editing tag in the webpage template, the first electronic device saves the input content, and then restores the editing tag to the display tag according to the first mapping relation or the second mapping relation between the display tag and the editing tag, so as to generate a target webpage, and then can save and publish the target webpage.
For example, as shown in fig. 5, fig. 5 shows an editable web page template, in which a user can input a name of a store, a store introduction, an address, a contact phone, and upload a picture, and then the first electronic device stores the content input by the user, and converts an edit tag into a display tag according to the first mapping relationship or the second mapping relationship, such as changing an input type to "file" > or changing the input type to < h1> </h1>, so as to finally generate a target web page.
In the method described in fig. 2, the independent CSS file and the pure HTML file are obtained by separating the content of the sample web page, which facilitates operation and management, improves development efficiency, and saves development cost, and the display tag is replaced with the edit tag, and the editable web page template is generated according to the edit tag, so that the user can edit and drag the edit tag individually, and customize the personalized template, thereby greatly improving user experience.
The method of the embodiments of the present application is set forth above in detail and the apparatus of the embodiments of the present application is provided below.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an apparatus 600 for generating a web page template according to an embodiment of the present application, where the apparatus 600 for generating a web page template may be the first electronic device or a device in the first electronic device; the apparatus for generating a web page template may include a separating unit 601, a replacing unit 602, and a first generating unit 603, wherein the respective units are described in detail as follows.
A separating unit 601, configured to separate content of a sample web page to obtain a pure HTML file and an independent CSS file in a cascading style sheet, where the pure HTML file refers to the independent CSS file in a linked form;
a replacing unit 602, configured to replace a display tag in the clean HTML file with an editing tag;
a first generating unit 603, configured to generate an editable web page template according to the edit tag.
In the device, independent CSS files and pure HTML files are obtained by separating the content of the sample webpage, operation and management are facilitated, development efficiency is improved, development cost is saved, the display label is replaced by the editing label, the editable webpage template is generated according to the editing label, a user can independently edit and drag the editing label, the personalized template is customized, user experience is greatly improved, the webpage templates of various sample webpages can be rapidly obtained by the method for generating the webpage template, and the favorite or interested webpages of the user can be rapidly converted into the editable webpage template by the user under the condition of low development cost, so that the target webpage is generated.
In an optional scheme, the first generating unit 603 is further configured to generate a plurality of web page visual plates according to the edit tag; the first generating unit 603 is further configured to generate an editable webpage template according to the plurality of webpage visual frames.
In yet another alternative, the apparatus further comprises: and the first removing unit is used for removing the text information and/or the wrongly displayed pictures in the clean HTML file before replacing the display tag in the clean HTML file with the editing tag.
In the device, the display of irrelevant information is avoided by removing the character information and/or the wrongly displayed picture, so that the quality of the webpage template can be improved.
In yet another alternative, the apparatus further comprises: and the second removing unit is used for removing the hidden style in the independent CSS file after separating the content of the sample webpage to obtain a pure HTML file of the hypertext markup language and the independent CSS file.
In the device, the hidden pattern is removed, so that the disorder of the structure of the webpage template is avoided, and the quality of the webpage template is improved.
In yet another alternative, the apparatus further comprises: a receiving unit configured to receive content input in the edit tag in the web page template after generating an editable web page template from the edit tag; a second generating unit, configured to generate a target web page according to content input in the editing tag in the web page template, where the editing tag in the web page template is transformed into a display tag in the target web page.
In the device, after the webpage template is generated, the user can input the content in the webpage template so as to generate the target webpage, so that the user can edit and store the webpage information, and the user experience is greatly improved.
In yet another alternative, the apparatus further comprises: a storage unit, configured to, after replacing a display tag in the clean HTML file with an edit tag, store a first mapping relationship between the display tag and the edit tag before generating a target web page according to content input in the edit tag in the web page template; the first mapping relation is used for determining an editing label needing to be converted into a display label when the webpage template is converted into the target webpage.
In the device, the first mapping relation between the display label and the edit label is saved, so that other equipment can configure the first mapping relation conveniently, and the first mapping relation can be changed dynamically in real time.
In yet another optional scheme, the receiving unit is further configured to receive, by the communication unit, first indication information sent by another device after separating content of a sample web page to obtain a pure HTML file and an independent CSS file, where the first indication information is used to indicate a second mapping relationship between the display tag and the edit tag, and the second mapping relationship is used to determine the edit tag that needs to be converted into the display tag when the web page template is converted into a target web page, and/or is used to determine the display tag that needs to be converted into the edit tag when the web page template is generated according to the sample web page.
In the apparatus, the first electronic device may receive first indication information of another device, convert the display tag into the edit tag according to the first indication information, and store a second mapping relationship between the display tag and the edit tag through the another device, so that the another device may conveniently configure the second mapping relationship, and may dynamically change the second mapping relationship in real time.
In yet another alternative, the apparatus further comprises: the sending unit is further configured to send a request message to the other device before receiving the first indication information sent by the other device, where the request message is used to request sending of the first indication information.
In yet another optional scheme, the receiving unit is further configured to receive second indication information of another device after receiving the first indication information sent by the other device, where the second indication information is used to indicate that one or more display tags in the second mapping relationship are replaced with editing tags.
In the above apparatus, when the other device needs to replace one or more display tags in the second mapping relationship with the editing tag, the other device sends second indication information to the first electronic device, so that the other device can change the second mapping relationship in real time.
In yet another alternative, the apparatus further comprises: the determining unit is used for determining the webpage view of the sample webpage before separating the content of the sample webpage to obtain a pure HTML file and an independent CSS file; the storage unit is used for storing the content of the sample webpage into a preset file path by calling an interface in the webpage view; and the acquisition unit is used for acquiring the content of the sample webpage from the preset path.
In the device, the content of the sample webpage can be rapidly stored in the preset file path, so that the subsequent use is facilitated.
In yet another optional scheme, the determining unit is further configured to determine Activity of the sample web page; the determining unit is further configured to determine a root view according to the Activity; the determining unit is further configured to traverse the view control in the root view to determine the web page view.
In the device, the information of the sample webpage can be obtained without actively accessing the URL of the sample webpage, but the information of the sample webpage is directly obtained from the bottom-layer Activity View View in a traversing manner, so that the access times are reduced, and the application is wider.
In yet another optional scheme, the separation unit 601 is further configured to separate the content of the sample web page to obtain a pure HTML file, an independent CSS file, and an independent JavaScript, where the pure HTML references the JavaScript in a linked form.
It should be noted that the implementation and beneficial effects of each unit can also correspond to the corresponding description of the method embodiment shown in fig. 2.
Referring to fig. 7, fig. 7 is a device 700 for generating a web page template according to an embodiment of the present application, where the device 700 for generating a web page template may be the first electronic device or a component in the first electronic device; the apparatus 700 comprises a processor 701, a memory 702 and a communication interface 703, said processor 701, memory 702 and communication interface 703 being interconnected by a bus 704.
The memory 702 includes, but is not limited to, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM), and the memory 702 is used for related computer programs and data. The communication interface 703 is used for receiving and transmitting data.
The processor 701 may be one or more Central Processing Units (CPUs), and in the case that the processor 701 is one CPU, the CPU may be a single-core CPU or a multi-core CPU.
The processor 701 in the apparatus 700 reads the computer program stored in the memory 702 for performing the following operations:
separating the content of a sample webpage to obtain a pure HTML file and an independent CSS file of a cascading style sheet, wherein the pure HTML refers to the independent CSS file in a linked mode;
replacing the display tag in the pure HTML file with an editing tag;
and generating an editable webpage template according to the editing label.
In the device, independent CSS files and pure HTML files are obtained by separating the content of the sample webpage, operation and management are facilitated, development efficiency is improved, development cost is saved, the display label is replaced by the editing label, the editable webpage template is generated according to the editing label, a user can independently edit and drag the editing label, the personalized template is customized, user experience is greatly improved, the webpage templates of various sample webpages can be rapidly obtained by the method for generating the webpage template, and the favorite or interested webpages of the user can be rapidly converted into the editable webpage template by the user under the condition of low development cost, so that the target webpage is generated.
In an optional scheme, the processor 701 is further configured to generate a plurality of web page visual frames according to the edit tag; and generating an editable webpage template according to the plurality of webpage visual plates.
In yet another alternative, the processor 701 is further configured to remove text information and/or an incorrectly displayed picture from the clean HTML file before replacing the display tag in the clean HTML file with the edit tag.
In the device, the display of irrelevant information is avoided by removing the character information and/or the wrongly displayed picture, so that the quality of the webpage template can be improved.
In yet another alternative, the processor 701 is further configured to remove hidden styles in the separate CSS file after separating contents of the sample web page to obtain a clean HTML file and a separate CSS file.
In the device, the hidden pattern is removed, so that the disorder of the structure of the webpage template is avoided, and the quality of the webpage template is improved.
In yet another alternative, the processor 701 is further configured to receive, through the communication interface 703, content input in the edit tag in the web page template after generating an editable web page template according to the edit tag; and generating a target webpage according to the content input in the editing label in the webpage template, wherein the editing label in the webpage template is transformed into a display label in the target webpage.
In the device, after the webpage template is generated, the user can input the content in the webpage template so as to generate the target webpage, so that the user can edit and store the webpage information, and the user experience is greatly improved.
In yet another alternative, the processor 701 is further configured to, after replacing the display tag in the clean HTML file with an edit tag, save a first mapping relationship between the display tag and the edit tag before generating a target web page according to content input in the edit tag in the web page template; the first mapping relation is used for determining an editing label needing to be converted into a display label when the webpage template is converted into the target webpage.
In the device, the first mapping relation between the display label and the edit label is saved, so that other equipment can configure the first mapping relation conveniently, and the first mapping relation can be changed dynamically in real time.
In yet another optional scheme, the processor 701 is further configured to, after separating content of a sample web page to obtain a pure HTML file and an independent CSS file, receive, through the communication interface 703, first indication information sent by another device, where the first indication information is used to indicate a second mapping relationship between the display tag and the edit tag, and the second mapping relationship is used to determine the edit tag that needs to be converted into the display tag when the web page template is converted into a target web page, and/or is used to determine the display tag that needs to be converted into the edit tag when the web page template is generated according to the sample web page.
In the apparatus, the first electronic device may receive first indication information of another device, convert the display tag into the edit tag according to the first indication information, and store a second mapping relationship between the display tag and the edit tag through the another device, so that the another device may conveniently configure the second mapping relationship, and may dynamically change the second mapping relationship in real time.
In yet another optional scheme, the processor 701 is further configured to send, through the communication interface 703, a request message to the other device before receiving the first indication information sent by the other device, where the request message is used to request to send the first indication information.
In yet another optional scheme, the processor 701 is further configured to receive second indication information of another device after receiving, through the communication interface 703, the first indication information sent by the other device, where the second indication information is used to indicate that one or more display tags in the second mapping relationship are replaced with editing tags.
In the above apparatus, when the other device needs to replace one or more display tags in the second mapping relationship with the editing tag, the other device sends second indication information to the first electronic device, so that the other device can change the second mapping relationship in real time.
In yet another alternative, the processor 701 is further configured to determine a web page view of a sample web page before separating content of the sample web page to obtain a pure HTML file and an independent CSS file; storing the content of the sample webpage into a preset file path by calling an interface in the webpage view; and obtaining the content of the sample webpage from the preset path.
In the device, the content of the sample webpage can be rapidly stored in the preset file path, so that the subsequent use is facilitated.
In yet another alternative, the processor 701 is further configured to determine Activity of the sample web page; determining a root view according to the Activity; traversing a view control in the root view to determine the web page view.
In the device, the information of the sample webpage can be obtained without actively accessing the URL of the sample webpage, but the information of the sample webpage is directly obtained from the bottom-layer Activity View View in a traversing manner, so that the access times are reduced, and the application is wider.
In another optional scheme, the processor 701 is further configured to separate the content of the sample web page to obtain a pure HTML file, an independent CSS file, and an independent JavaScript, where the pure HTML references the JavaScript in a linked form.
It should be noted that the implementation and beneficial effects of the operations may also correspond to the corresponding descriptions of the method embodiment shown in fig. 2.
The embodiment of the present application further provides a chip system, where the chip system includes at least one processor, a memory and an interface circuit, where the memory, the transceiver and the at least one processor are interconnected by a line, and the at least one memory stores a computer program; the method flow shown in fig. 2 is implemented when the computer program is executed by the processor.
An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed on the first electronic device, the method flow illustrated in fig. 2 is implemented.
The embodiment of the present application further provides a computer program product, where when the computer program product runs on the first electronic device, the method flow shown in fig. 2 is implemented.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments can be implemented by hardware associated with a computer program that can be stored in a computer-readable storage medium, and when executed, can include the processes of the above method embodiments. And the aforementioned storage medium includes: various media that can store computer program code, such as ROM or RAM, magnetic or optical disks, etc.

Claims (25)

1. A method of generating a web page template, comprising:
separating the content of a sample webpage to obtain a pure HTML file and an independent CSS file of a cascading style sheet, wherein the pure HTML refers to the independent CSS file in a linked mode;
replacing the display tag in the pure HTML file with an editing tag;
and generating an editable webpage template according to the editing label.
2. The method of claim 1, wherein generating an editable web page template from the edit tags comprises:
generating a plurality of webpage visual plates according to the editing labels;
and generating an editable webpage template according to the plurality of webpage visual plates.
3. The method of claim 1 or 2, wherein prior to replacing the display tag in the clean HTML file with the edit tag, the method further comprises:
and removing the text information and/or the wrongly displayed pictures in the pure HTML file.
4. The method of any of claims 1-3, wherein after separating the content of the sample web page to obtain a clean HTML file and a separate CSS file, the method further comprises:
removing hidden styles in the separate CSS file.
5. The method of any of claims 1-4, wherein after generating an editable web page template from the edit tag, the method further comprises:
receiving content input in the edit tag in the web page template;
and generating a target webpage according to the content input in the editing label in the webpage template, wherein the editing label in the webpage template is transformed into a display label in the target webpage.
6. The method according to any one of claims 1-5, wherein after replacing the display tag in the clean HTML file with an edit tag, and before generating the target webpage from the content entered in the edit tag in the webpage template, the method further comprises:
saving a first mapping relation between the display label and the editing label; the first mapping relation is used for determining an editing label needing to be converted into a display label when the webpage template is converted into the target webpage.
7. The method according to any of claims 1-5, wherein after separating the content of the sample web page to obtain a clean HTML file and a CSS file, the method further comprises:
receiving first indication information sent by other equipment, wherein the first indication information is used for indicating a second mapping relation between the display tag and the editing tag, and the second mapping relation is used for determining the editing tag required to be converted into the display tag when the webpage template is converted into the target webpage, and/or is used for determining the display tag required to be converted into the editing tag when the webpage template is generated according to the sample webpage.
8. The method according to any one of claim 7, wherein before receiving the first indication information sent by the other device, the method further comprises:
and sending a request message to other equipment, wherein the request message is used for requesting to send the first indication information.
9. The method according to claim 7 or 8, wherein after receiving the first indication information sent by the other device, the method further comprises:
and receiving second indication information of other equipment, wherein the second indication information is used for indicating that one or more display tags in the second mapping relation are replaced by editing tags.
10. The method of any of claims 1-9, wherein before separating the content of the sample web page to obtain a clean HTML file and a CSS file, the method further comprises:
determining a web page view of the sample web page;
storing the content of the sample webpage into a preset file path by calling an interface in the webpage view;
and obtaining the content of the sample webpage from the preset path.
11. The method of claim 10, wherein the determining the web page view of the sample web page comprises:
determining Activity of the sample webpage;
determining a root view according to the Activity;
traversing a view control in the root view to determine the web page view.
12. The method according to any one of claims 1-11, wherein separating the content of the sample web page to obtain a clean HTML file and a CSS file, comprises:
separating the content of the sample webpage to obtain a pure HTML file, an independent CSS file and an independent JavaScript file, wherein the pure HTML refers to the JavaScript file in a linked mode.
13. An apparatus for generating a web page template, the apparatus comprising:
the separation unit is used for separating the content of the sample webpage to obtain a pure HTML file and an independent CSS file, wherein the pure HTML file refers to the independent CSS file in a linked mode;
the replacing unit is used for replacing the display tag in the pure HTML file with an editing tag;
and the first generating unit is used for generating an editable webpage template according to the editing label.
14. The apparatus of claim 13,
the first generating unit is further used for generating a plurality of webpage visual plates according to the editing tags;
the first generating unit is further configured to generate an editable webpage template according to the plurality of webpage visual frames.
15. The apparatus of claim 13 or 14, further comprising:
and the first removing unit is used for removing the text information and/or the wrongly displayed pictures in the clean HTML file before replacing the display tag in the clean HTML file with the editing tag.
16. The apparatus of any one of claims 13-15, further comprising:
and the second removing unit is used for removing the hidden style in the independent CSS file after separating the content of the sample webpage to obtain a pure HTML file of the hypertext markup language and the independent CSS file.
17. The apparatus of any one of claims 13-16, further comprising:
a receiving unit configured to receive content input in the edit tag in the web page template after generating an editable web page template from the edit tag;
a second generating unit, configured to generate a target web page according to content input in the editing tag in the web page template, where the editing tag in the web page template is transformed into a display tag in the target web page.
18. The apparatus of any one of claims 13-17, further comprising:
the storage unit is used for storing a first mapping relation between the display tag and the edit tag after the display tag in the clean HTML file is replaced by the edit tag and before a target webpage is generated according to the content input in the edit tag in the webpage template; the first mapping relation is used for determining an editing label needing to be converted into a display label when the webpage template is converted into the target webpage.
19. The apparatus of any one of claims 13-17,
the receiving unit is further configured to receive first indication information sent by other equipment after separating content of a sample webpage to obtain a pure hypertext markup language (HTML) file and an independent Cascading Style Sheet (CSS) file, where the first indication information is used to indicate a second mapping relationship between the display tag and the edit tag, and the second mapping relationship is used to determine the edit tag that needs to be converted into the display tag when the webpage template is converted into a target webpage, and/or is used to determine the display tag that needs to be converted into the edit tag when the webpage template is generated according to the sample webpage.
20. The apparatus of claim 19, further comprising:
a sending unit, configured to send a request message to another device before receiving first indication information sent by the other device, where the request message is used to request to send the first indication information.
21. The apparatus of claim 19 or 20,
the receiving unit is further configured to receive second indication information of the other device after receiving the first indication information sent by the other device, where the second indication information is used to indicate that one or more display tags in the second mapping relationship are replaced with editing tags.
22. The apparatus of any one of claims 13-21, further comprising:
the determining unit is used for determining the webpage view of the sample webpage before separating the content of the sample webpage to obtain a pure HTML file and an independent CSS file;
the storage unit is used for storing the content of the sample webpage into a preset file path by calling an interface in the webpage view;
and the acquisition unit is used for acquiring the content of the sample webpage from the preset path.
23. The apparatus of claim 22,
the determining unit is further configured to determine Activity of the sample web page;
the determining unit is further configured to determine a root view according to the Activity;
the determining unit is further configured to traverse the view control in the root view to determine the web page view.
24. The apparatus of any one of claims 13-23,
the separation unit is further used for separating the content of the sample webpage to obtain a pure HTML file, an independent CSS file and an independent JavaScript file, wherein the pure HTML file refers to the JavaScript file in a linked mode.
25. A computer-readable storage medium, in which a computer program is stored which, when run on a processor, implements the method of any one of claims 1-12.
CN202010406351.8A 2020-05-13 2020-05-13 Method for generating webpage template and related equipment Pending CN113672833A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010406351.8A CN113672833A (en) 2020-05-13 2020-05-13 Method for generating webpage template and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010406351.8A CN113672833A (en) 2020-05-13 2020-05-13 Method for generating webpage template and related equipment

Publications (1)

Publication Number Publication Date
CN113672833A true CN113672833A (en) 2021-11-19

Family

ID=78537167

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010406351.8A Pending CN113672833A (en) 2020-05-13 2020-05-13 Method for generating webpage template and related equipment

Country Status (1)

Country Link
CN (1) CN113672833A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115981650A (en) * 2023-03-14 2023-04-18 共道网络科技有限公司 Website building method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100318894A1 (en) * 2009-06-11 2010-12-16 Microsoft Corporation Modifications to Editable Elements of Web Pages Rendered in Word Processor Applications
CN101937427A (en) * 2009-06-30 2011-01-05 方正国际软件(北京)有限公司 Browser-based system and method for content edition and issue
CN101976260A (en) * 2010-11-04 2011-02-16 上海银杏界信息科技有限公司 Visual label and method for generating webpage by using visual label
CN109508187A (en) * 2018-10-10 2019-03-22 国网新疆电力有限公司信息通信公司 Wechat public platform video text editing device construction method and its editing machine based on HTML
CN109933322A (en) * 2019-01-28 2019-06-25 平安科技(深圳)有限公司 A kind of page editing method, apparatus and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100318894A1 (en) * 2009-06-11 2010-12-16 Microsoft Corporation Modifications to Editable Elements of Web Pages Rendered in Word Processor Applications
CN101937427A (en) * 2009-06-30 2011-01-05 方正国际软件(北京)有限公司 Browser-based system and method for content edition and issue
CN101976260A (en) * 2010-11-04 2011-02-16 上海银杏界信息科技有限公司 Visual label and method for generating webpage by using visual label
CN109508187A (en) * 2018-10-10 2019-03-22 国网新疆电力有限公司信息通信公司 Wechat public platform video text editing device construction method and its editing machine based on HTML
CN109933322A (en) * 2019-01-28 2019-06-25 平安科技(深圳)有限公司 A kind of page editing method, apparatus and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LUOMEI: "模仿网页", pages 3 - 16, Retrieved from the Internet <URL:https://www.cnblogs.com/luomei/p/12873899.html> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115981650A (en) * 2023-03-14 2023-04-18 共道网络科技有限公司 Website building method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10235349B2 (en) Systems and methods for automated content generation
CN107766359B (en) Method and device for converting page content into picture and computing equipment
US20130326333A1 (en) Mobile Content Management System
CN101364979B (en) Downloaded material parsing and processing system and method
CN110069683B (en) Method and device for crawling data based on browser
US20130305145A1 (en) A Method of Publishing Digital Content
WO2017085717A1 (en) System and method for presentation of content linked comments
KR20200030252A (en) Apparatus and method for providing artwork
US20100299591A1 (en) Markup language document conversion system, device, method, and program
US20090085921A1 (en) Populate Web-Based Content Based on Space Availability
CN101065723A (en) Method of displaying data in a table
JP2003085091A (en) Web page management support system
EP2599011A1 (en) Selection of main content in web pages
US20160259509A1 (en) Backend-to-frontend website development
CN102841790A (en) Web application interface dynamic adapting method for heterogeneous terminal
CA2918840A1 (en) Presenting fixed format documents in reflowed format
CN108700988A (en) Digital picture is presented
JP2018501551A (en) Formula processing method, apparatus, device, and program
DE102016015381A1 (en) Using Bloom filters to simplify the expansion and subdivision of a dynamic font
EP2599008A1 (en) Method for selecting user desirable content from web pages
US20220383381A1 (en) Video generation method, apparatus, terminal and storage medium
KR20170073693A (en) Extracting similar group elements
US20120072828A1 (en) Complex input to image transformation for distribution
CN113672833A (en) Method for generating webpage template and related equipment
TWI570579B (en) An information retrieving method utilizing webpage visual features and webpage language features and a system using thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination