CN111814429A - Article typesetting method and device, terminal equipment and storage medium - Google Patents
Article typesetting method and device, terminal equipment and storage medium Download PDFInfo
- Publication number
- CN111814429A CN111814429A CN202010753270.5A CN202010753270A CN111814429A CN 111814429 A CN111814429 A CN 111814429A CN 202010753270 A CN202010753270 A CN 202010753270A CN 111814429 A CN111814429 A CN 111814429A
- Authority
- CN
- China
- Prior art keywords
- article
- style
- html
- typesetting
- query table
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/109—Font handling; Temporal or kinetic typography
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
- G06F16/83—Querying
- G06F16/832—Query formulation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Mathematical Physics (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Document Processing Apparatus (AREA)
Abstract
The application is suitable for the technical field of research and development management, and provides an article typesetting method, an article typesetting device, a terminal device and a storage medium, wherein in the article typesetting method, a user only needs to set an HTML mark and a style mark in a typesetting setting file, a target HTML file can be automatically generated based on the typesetting setting file after the mark is set, and style typesetting can be automatically performed on different article paragraphs in an article to be typeset based on the target HTML file, so that the user does not need to respectively perform CSS style setting on the different article paragraphs again, the automation effect of article typesetting is improved, and the article typesetting efficiency is improved.
Description
Technical Field
The present application relates to the field of research and development management technologies, and in particular, to an article typesetting method and apparatus, a terminal device, and a storage medium.
Background
The articles of the WeChat public number are more time in content updating, after one or more sets of suitable typesetting styles are selected and determined, the user only needs to update and set the content every day without updating and setting the article typesetting, the user only needs to input the content of the plain text to realize the automatic typesetting of the articles, and the typesetted articles are automatically sent to the corresponding platform.
However, in the existing article typesetting process, even though the same typesetting Style is used, when the number of article paragraphs of the article to be typeset input by the user is different, the user needs to manually set the stacking styles (CSS styles) again for the different article paragraphs, so that the automation effect of article typesetting is low, and the article typesetting efficiency is reduced.
Disclosure of Invention
In view of this, embodiments of the present application provide an article typesetting method, an apparatus, a terminal device, and a storage medium, so as to solve the problem in the prior art that the article typesetting efficiency is low due to the need to manually set CSS styles for different article paragraphs respectively.
A first aspect of an embodiment of the present application provides an article typesetting method, including:
obtaining an HTML (hypertext markup language) file of a sample article, and carrying out paragraph style analysis on an HTML label in the HTML file to obtain a CSS (cascading style sheet) style corresponding to a chapter in the sample article;
marking different HTML tags to obtain corresponding HTML marks, and marking different CSS styles to obtain corresponding style marks;
generating a tag query table and an identification query table according to the HTML tag and the identification marking result of the CSS style, and displaying the tag query table and the identification query table, wherein the tag query table stores corresponding relations between different HTML tags and corresponding HTML identifications, and the identification query table stores corresponding relations between different CSS styles and corresponding style identifications;
if receiving a typesetting setting file aiming at any article to be typeset, carrying out mark replacement on an HTML mark and a style mark in the typesetting setting file according to the label query table and the mark query table to obtain a target HTML file;
and typesetting the article to be typeset according to the target HTML file.
Further, the obtaining an HTML file of the sample article and performing paragraph style analysis on an HTML tag in the HTML file to obtain a CSS style corresponding to a chapter paragraph in the sample article includes:
element frame examination is carried out on the sample article according to a preset previewer, and the HTML file is obtained;
acquiring a paragraph structure of the sample article;
and carrying out paragraph style query on the HTML label according to the paragraph structure, and setting the queried paragraph style as the CSS style of the corresponding article paragraph.
Further, the performing identifier replacement on the HTML identifier and the style identifier in the layout setting file according to the tag lookup table and the identifier lookup table to obtain a target HTML file includes:
matching HTML marks in the typesetting setting file with the tag query table, and replacing the HTML marks in the typesetting setting file by the HTML tags matched in the tag query table;
and matching the style identification in the typesetting setting file with the identification query table, and replacing the style identification in the typesetting setting file with the CSS style matched in the label query table.
Further, the typesetting the article to be typeset according to the target HTML file includes:
acquiring the corresponding relation between the style identification in the target HTML file and the identification between the chapter paragraphs in the article to be typeset;
determining the style corresponding relation between the CSS style in the target HTML file and the corresponding article paragraph according to the identification corresponding relation;
setting typesetting parameters for the article paragraphs corresponding to the article to be typeset according to the style corresponding relation and the CSS style;
and if the article paragraphs in the article to be typeset are all set by the typesetting parameters, displaying the article to be typeset after the typesetting parameters are set.
Further, the method further comprises:
acquiring picture information of a display picture in the sample article, and carrying out identification marking on the picture information to obtain a corresponding picture identification, wherein the picture information comprises a picture downloading address and/or a picture display address;
generating a picture query table according to the identification marking result of the picture information, wherein the picture query table stores corresponding relations between different picture information and corresponding picture identifications;
specifically, after receiving the layout setting file for any article to be laid out, the method further includes:
and replacing the picture identification in the typesetting setting file according to the picture query table.
Further, the replacing the picture identifier in the composition setting file according to the picture lookup table includes:
matching the picture identification in the typesetting setting file with the picture query table, and generating an IMG label according to the matched picture information in the picture query table;
and replacing the picture identification in the typesetting setting file by the IMG label.
Further, the method further comprises:
and uploading the typeset article to be typeset to a block chain.
A second aspect of the embodiments of the present application provides an article typesetting apparatus, including:
the paragraph style analysis unit is used for acquiring an HTML (hypertext markup language) file of a sample article and analyzing the paragraph style of an HTML label in the HTML file to obtain a CSS (cascading style sheet) style corresponding to a chapter paragraph in the sample article;
the identification marking unit is used for carrying out identification marking on different HTML tags to obtain corresponding HTML identifications and carrying out identification marking on different CSS styles to obtain corresponding style identifications;
a query table generating unit, configured to generate a tag query table and an identifier query table according to the HTML tag and the identifier tag result of the CSS style, and display the tag query table and the identifier query table, where a correspondence between different HTML tags and corresponding HTML identifiers is stored in the tag query table, and a correspondence between different CSS styles and corresponding style identifiers is stored in the identifier query table;
the mark replacing unit is used for carrying out mark replacement on the HTML marks and the style marks in the typesetting setting files according to the label query table and the mark query table to obtain target HTML files if the typesetting setting files aiming at any article to be typeset are received;
and the article typesetting unit is used for typesetting the article to be typeset according to the target HTML file.
A fourth aspect of the embodiments of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and being executable on the terminal device, where the processor implements each step of the article typesetting method provided by the first scheme when executing the computer program.
A fifth aspect of the embodiments of the present application provides a storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the article typesetting method provided by the first aspect.
The method, the device, the terminal equipment and the storage medium for article typesetting provided by the embodiment of the application have the following beneficial effects that:
according to the article typesetting method provided by the embodiment of the application, a user only needs to set the HTML identifier and the style identifier in the typesetting setting file, the target HTML file can be automatically generated based on the typesetting setting file after the identifier is set, and the style typesetting can be automatically performed on different article paragraphs in the article to be typeset based on the target HTML file, so that the user does not need to respectively set CSS styles on different article paragraphs again, the automation effect of article typesetting is improved, and the article typesetting efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating an implementation of a method for article layout according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating an implementation of a method for article layout according to another embodiment of the present application;
FIG. 3 is a flowchart illustrating an implementation of a method for article layout according to yet another embodiment of the present application;
FIG. 4 is a flowchart illustrating an implementation of a method for article layout according to yet another embodiment of the present application;
fig. 5 is a block diagram illustrating a structure of an article layout apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The article typesetting method according to the embodiment of the present application may be executed by a control device or a terminal (hereinafter referred to as a "mobile terminal").
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of an article typesetting method according to an embodiment of the present application, including:
step S10, obtaining an HTML file of a sample article, and carrying out paragraph style analysis on an HTML label in the HTML file to obtain a CSS style corresponding to a chapter paragraph in the sample article;
the method comprises the steps of obtaining a sample setting instruction sent by a user, and inquiring articles according to article identifications in the sample setting instruction to obtain the sample articles, wherein the sample setting instruction is used for setting any article as the sample article according to the setting requirement of the user.
Optionally, a plurality of different article identifiers are stored in the sample setting instruction to query a plurality of different sample articles, and therefore in this step, the HTML file of each sample article is respectively obtained, and paragraph style analysis is respectively performed on the HTML tags in the different HTML files to obtain CSS styles corresponding to article paragraphs in the different sample articles.
Optionally, in this step, the chapter identifier in the sample setting instruction further carries a corresponding paragraph identifier, where the paragraph identifier is used to point to a corresponding article paragraph, and if the article identifier carries the paragraph identifier, when performing paragraph style analysis on an HTML tag in an HTML file, only performing paragraph style analysis on a specified paragraph corresponding to the paragraph identifier, so as to obtain a CSS style corresponding to the specified paragraph in different sample articles.
Step S20, marking different HTML labels to obtain corresponding HTML marks, and marking different CSS styles to obtain corresponding style marks;
for example, when the obtained HTML tag includes an HTML tag a, an HTML tag b and an HTML tag c, the HTML tag a, the HTML tag b and the HTML tag c can be marked sequentially by using digital marks 1, 2 and 3, where the digital mark 1 is an HTML mark corresponding to the HTML tag a, the digital mark 2 is an HTML mark corresponding to the HTML tag b, and the digital mark 3 is an HTML mark corresponding to the HTML tag c;
for example, when the acquired CSS style includes CSS style d, CSS style e, and CSS style f, identification marks may be sequentially performed on CSS style d, CSS style e, and CSS style f using letter identification A, B and C, where letter identification a is a style identification corresponding to CSS style d, letter identification B is a style identification corresponding to CSS style e, and letter identification C is a style identification corresponding to CSS style f.
Step S30, generating a label query table and an identification query table according to the HTML label and the identification marking result of the CSS style, and displaying the label query table and the identification query table;
the tag query table stores corresponding relations between different HTML tags and corresponding HTML marks, and the mark query table stores corresponding relations between different CSS styles and corresponding style marks.
For example, the tag lookup table stores the corresponding relationship between the numeric identifier 1 and the HTML tag a, between the numeric identifier 2 and the HTML tag B, and between the numeric identifier 3 and the HTML tag c, and the tag lookup table stores the corresponding relationship between the alphabetic identifier a and the CSS style D, between the alphabetic identifier B and the CSS style e, and between the alphabetic identifier D and the CSS style f.
Specifically, in the step, through the design of displaying the tag query table and the identification query table, the setting of the HTML tag and the CSS style of the article to be typeset by the user is effectively facilitated, so that the user can select the corresponding HTML identification or style identification to set the HTML tag and the CSS style of the article to be typeset according to the requirement.
Step S40, if receiving a typesetting setting file for any article to be typeset, performing mark replacement on an HTML mark and a style mark in the typesetting setting file according to the label query table and the mark query table to obtain a target HTML file;
the typesetting setting file stores HTML marks and style marks of a user aiming at preset values of articles to be typeset, and the style marks stored in the typesetting setting file correspond to article paragraphs in the articles to be typeset one by one.
In the step, through the design of carrying out identification replacement on the HTML identification and the style identification in the typesetting setting file according to the label query table and the identification query table, the identification mark aiming at the article to be typeset can be effectively converted into the corresponding HTML label and the CSS style so as to obtain the target HTML file, so that a user does not need to respectively carry out the CSS style setting of the article paragraphs aiming at the article to be typeset, and the automatic effect of article typesetting is improved.
Specifically, in this step, the replacing, according to the tag lookup table and the identifier lookup table, the HTML identifier and the style identifier in the composition setting file to obtain the target HTML file includes:
matching HTML marks in the typesetting setting file with the tag query table, and replacing the HTML marks in the typesetting setting file by the HTML tags matched in the tag query table;
and matching the style identification in the typesetting setting file with the identification query table, and replacing the style identification in the typesetting setting file with the CSS style matched in the label query table.
Step S50, typesetting the article to be typeset according to the target HTML file;
the typesetting parameter of the article to be typeset is set according to the HTML label and the CSS style in the replaced target HTML file, and the article to be typeset after the typesetting parameter is set is displayed for the user, so that the user can conveniently check the typesetting result of the article to be typeset.
As can be seen from the above, according to the article typesetting method provided by this embodiment, the user only needs to set the HTML identifier and the style identifier in the typesetting setting file, the target HTML file can be automatically generated based on the typesetting setting file after the identifier is set, and the style typesetting can be automatically performed for different article paragraphs in the article to be typeset based on the target HTML file, so that the user does not need to respectively perform CSS style setting on different article paragraphs again, thereby improving the automation effect of article typesetting, and improving the article typesetting efficiency.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of an article layout method according to another embodiment of the present application. With respect to the embodiment corresponding to fig. 1, the article typesetting method provided in this embodiment is further detailed in step S10 in the embodiment corresponding to fig. 1, and step S10 includes:
s11, performing element frame examination on the sample article according to a preset previewer to obtain the HTML file;
the element frame examination is also called an examination element, and the HTML file corresponding to the sample article is obtained by examining the element frame for the sample article.
Optionally, a previewer address is stored locally in advance, the previewer address is used for pointing to a corresponding preset previewer, when any sample article is obtained, the corresponding preset previewer is operated based on the previewer address, and when the preset previewer is in an operating state, the preset previewer is instructed to perform element box review on the sample article.
S12, acquiring a paragraph structure of the sample article, and performing paragraph style query on the HTML label according to the paragraph structure;
the paragraph structure includes a paragraph number corresponding to each article paragraph in the sample article, for example, if the sample article sequentially includes a first paragraph, a second paragraph, and a third paragraph, the paragraph structure is the first paragraph, the second paragraph, and the third paragraph, and the paragraph style query is performed on the HTML tag according to the paragraph structure;
s13, setting the inquired paragraph style as the CSS style of the corresponding article paragraph;
when the queried paragraph style is sequentially the first style, the second style and the third style, the first style is set as the CSS style of the first paragraph, the second style is set as the CSS style of the second paragraph, and the third style is set as the CSS style of the third paragraph.
In this embodiment, the HTML file of the sample article is automatically queried by designing an element frame examination for the sample article according to a preset previewer, and the accuracy of CSS style setting for the article paragraphs is improved by designing a paragraph style query for the HTML tag according to a paragraph structure.
Referring to fig. 3, fig. 3 is a flowchart illustrating an implementation of an article layout method according to another embodiment of the present application. With respect to the embodiment corresponding to fig. 1, the article typesetting method provided in this embodiment is further detailed in step S50 in the embodiment corresponding to fig. 1, and step S50 includes:
s51, acquiring the corresponding relation between the style identification in the target HTML file and the identification between the chapter sections in the article to be typeset;
the mark correspondence includes a correspondence between different style marks and corresponding article paragraphs, for example, the style mark in the target HTML file includes a style mark g, a style mark h, and a style mark i, and the typesetting article includes a fourth paragraph, a fifth paragraph, and a sixth paragraph;
the correspondence stored in the identifier correspondence is: the style flag g corresponds to the sixth paragraph, the style flag h corresponds to the fifth paragraph, and the style flag i corresponds to the sixth paragraph.
S52, determining the style corresponding relation between the CSS style in the target HTML file and the corresponding article paragraph according to the identification corresponding relation;
s53, performing layout parameter setting on the article paragraphs corresponding to the article to be laid out according to the style corresponding relation and the CSS style;
the method comprises the steps of respectively inquiring a CSS style corresponding to each article paragraph, inquiring typesetting parameters corresponding to the CSS style, and setting the typesetting parameters of the article paragraphs corresponding to the CSS styles based on the inquired typesetting parameters.
For example, the style identifier corresponding to the sixth paragraph is a style identifier g, the style identifier g is matched with an identifier lookup table to obtain a target CSS style, a target layout parameter corresponding to the target CSS style is queried, and layout parameter setting is performed on the sixth paragraph according to the target layout parameter.
And S54, if the article paragraphs in the article to be typeset are all set with the typesetting parameters, displaying the article to be typeset after the typesetting parameters are set.
In this embodiment, by obtaining the design of the correspondence relationship between the style identifier in the target HTML file and the identifier between the chapter sections in the article to be typeset, the style correspondence relationship between the CSS style in the target HTML file and the corresponding article section can be effectively determined, and the typesetting parameter setting can be accurately performed on the article section corresponding to the article to be typeset based on the style correspondence relationship and the CSS style, so that the typesetting accuracy of the article to be typeset is improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating an article layout method according to still another embodiment of the present application. With respect to the embodiment corresponding to fig. 1, the article typesetting method provided in this embodiment further includes steps S60 to S70 before step S50. The details are as follows:
s60, acquiring picture information of a display picture in the sample article, and marking the picture information to obtain a corresponding picture mark;
the picture information comprises a picture downloading address and/or a picture displaying address;
s70, generating a picture query table according to the identification marking result of the picture information;
the picture query table stores corresponding relations between different picture information and corresponding picture identifications, optionally, the picture query table can be stored in a local json file, so that the phenomenon of picture uploading errors caused by the fact that the network of the mobile terminal is not good or the mobile terminal is stuck and the like is avoided, the picture can be rapidly continuously uploaded without re-uploading the existing picture.
In this embodiment, after receiving the layout setting file for any article to be laid out, the method further includes:
and replacing the picture identification in the typesetting setting file according to the picture query table.
Specifically, the replacing the picture identifier in the composition setting file according to the picture lookup table includes:
matching the picture identification in the typesetting setting file with the picture query table, and generating an IMG label according to the matched picture information in the picture query table;
and replacing the picture identification in the typesetting setting file by the IMG label.
In the embodiment, the IMG tag is generated according to the matched picture information in the picture query table, and the IMG tag is used for replacing the picture identifier in the typesetting setting file, so that the picture download address can be effectively added in the target HTML file, the pictures and the article paragraphs in the article to be typeset can be synchronously typeset, and the typesetting accuracy of the article to be typeset is improved.
In all embodiments of the present application, the article to be typeset after the typesetting is obtained based on the target HTML file, and specifically, the article to be typeset after the typesetting is obtained by typesetting the article to be typeset with the target HTML file, for example, by using a typesetter. The safety and the fair transparency to the user can be ensured by uploading the typeset article to be typeset to the block chain. The user equipment can download the typeset article to be typeset from the blockchain so as to check whether the typeset article to be typeset is tampered. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Referring to fig. 5, fig. 5 is a block diagram illustrating an article typesetting apparatus 100 according to an embodiment of the present application. The article typesetting device 100 in this embodiment includes units for executing the steps in the embodiments corresponding to fig. 1 to fig. 3. Please refer to fig. 1 to 4 and fig. 1 to 4 for the corresponding embodiments. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 5, the article layout apparatus 100 includes: a paragraph style analysis unit 10, an identification marking unit 11, a lookup table generation unit 12, an identification replacement unit 13 and an article typesetting unit 14, wherein:
the paragraph style analyzing unit 10 is configured to obtain an HTML file of a sample article, and perform paragraph style analysis on an HTML tag in the HTML file to obtain a CSS style corresponding to a chapter in the sample article.
And the identification marking unit 11 is configured to perform identification marking on different HTML tags to obtain corresponding HTML identifications, and perform identification marking on different CSS styles to obtain corresponding style identifications.
And the query table generating unit 12 is configured to generate a tag query table and an identifier query table according to the HTML tag and the identifier tag result of the CSS style, and display the tag query table and the identifier query table, where the tag query table stores corresponding relationships between different HTML tags and corresponding HTML identifiers, and the identifier query table stores corresponding relationships between different CSS styles and corresponding style identifiers.
And the mark replacing unit 13 is configured to, if a layout setting file for any article to be typeset is received, perform mark replacement on an HTML mark and a style mark in the layout setting file according to the tag lookup table and the mark lookup table to obtain a target HTML file.
And the article typesetting unit 14 is used for typesetting the article to be typeset according to the target HTML file.
As an embodiment of the present application, the paragraph pattern analysis unit 10 is further configured to: element frame examination is carried out on the sample article according to a preset previewer, and the HTML file is obtained;
obtaining a paragraph structure of the sample article, and performing paragraph style query on the HTML tag according to the paragraph structure;
and setting the inquired paragraph style as the CSS style of the corresponding article paragraph.
As an embodiment of the present application, the identifier replacing unit 13 is further configured to: matching HTML marks in the typesetting setting file with the tag query table, and replacing the HTML marks in the typesetting setting file by the HTML tags matched in the tag query table;
and matching the style identification in the typesetting setting file with the identification query table, and replacing the style identification in the typesetting setting file with the CSS style matched in the label query table.
As an embodiment of the present application, the article typesetting unit 14 is further configured to: acquiring the corresponding relation between the style identification in the target HTML file and the identification between the chapter paragraphs in the article to be typeset;
determining the style corresponding relation between the CSS style in the target HTML file and the corresponding article paragraph according to the identification corresponding relation;
setting typesetting parameters for the article paragraphs corresponding to the article to be typeset according to the style corresponding relation and the CSS style;
and if the article paragraphs in the article to be typeset are all set by the typesetting parameters, displaying the article to be typeset after the typesetting parameters are set.
As an embodiment of the present application, the look-up table generating unit 12 is further configured to: acquiring picture information of a display picture in the sample article, and carrying out identification marking on the picture information to obtain a corresponding picture identification, wherein the picture information comprises a picture downloading address and/or a picture display address;
and generating a picture query table according to the identification marking result of the picture information, wherein the picture query table stores the corresponding relation between different picture information and the corresponding picture identification.
As an embodiment of the present application, the identifier replacing unit 13 is further configured to: and replacing the picture identification in the typesetting setting file according to the picture query table.
As an embodiment of the present application, the identifier replacing unit 13 is further configured to: matching the picture identification in the typesetting setting file with the picture query table, and generating an IMG label according to the matched picture information in the picture query table;
and replacing the picture identification in the typesetting setting file by the IMG label.
It can be seen from the above that, a user only needs to set the HTML identifier and the style identifier in the composition setting file, the target HTML file can be automatically generated based on the composition setting file after the identifier is set, and the style composition can be automatically performed for different article paragraphs in the article to be composed based on the target HTML file, so that the user does not need to respectively perform CSS style setting on different article paragraphs again, the automation effect of the article composition is improved, and the article composition efficiency is improved.
Fig. 6 is a block diagram of a terminal device 2 according to another embodiment of the present application. As shown in fig. 6, the terminal device 2 of this embodiment includes: a processor 20, a memory 21 and a computer program 22, such as a program for a method of composing an article, stored in said memory 21 and executable on said processor 20. The processor 20 executes the computer program 23 to implement the steps in the embodiments of the article layout methods, such as S10 to S50 shown in fig. 1, or S11 to S13 shown in fig. 2, or S51 to S54 shown in fig. 3, or S60 to S70 shown in fig. 4. Alternatively, when the processor 20 executes the computer program 22, the functions of the units in the embodiment corresponding to fig. 5, for example, the functions of the units 10 to 14 shown in fig. 5, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 6, which is not repeated herein.
Illustratively, the computer program 22 may be divided into one or more units, which are stored in the memory 21 and executed by the processor 20 to accomplish the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 22 in the terminal device 2. For example, the computer program 22 may be divided into the paragraph pattern analysis unit 10, the mark marking unit 11, the look-up table generation unit 12, the mark replacement unit 13, and the article layout unit 14, each of which functions as described above.
The terminal device may include, but is not limited to, a processor 20, a memory 21. Those skilled in the art will appreciate that fig. 6 is merely an example of a terminal device 2 and does not constitute a limitation of terminal device 2 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 20 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 21 may be an internal storage unit of the terminal device 2, such as a hard disk or a memory of the terminal device 2. The memory 21 may also be an external storage device of the terminal device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 2. Further, the memory 21 may also include both an internal storage unit and an external storage device of the terminal device 2. The memory 21 is used for storing the computer program and other programs and data required by the terminal device. The memory 21 may also be used to temporarily store data that has been output or is to be output.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (10)
1. An article typesetting method is characterized by comprising the following steps:
obtaining an HTML (hypertext markup language) file of a sample article, and carrying out paragraph style analysis on an HTML label in the HTML file to obtain a CSS (cascading style sheet) style corresponding to a chapter in the sample article;
marking different HTML tags to obtain corresponding HTML marks, and marking different CSS styles to obtain corresponding style marks;
generating a tag query table and an identification query table according to the HTML tag and the identification marking result of the CSS style, and displaying the tag query table and the identification query table, wherein the tag query table stores corresponding relations between different HTML tags and corresponding HTML identifications, and the identification query table stores corresponding relations between different CSS styles and corresponding style identifications;
if receiving a typesetting setting file aiming at any article to be typeset, carrying out mark replacement on an HTML mark and a style mark in the typesetting setting file according to the label query table and the mark query table to obtain a target HTML file;
and typesetting the article to be typeset according to the target HTML file.
2. The article typesetting method according to claim 1, wherein the obtaining of the HTML file of the sample article and the paragraph style analysis of the HTML tag in the HTML file to obtain the CSS style corresponding to the chapter in the sample article comprises:
element frame examination is carried out on the sample article according to a preset previewer, and the HTML file is obtained;
acquiring a paragraph structure of the sample article, and performing paragraph style query on the HTML tag according to the paragraph structure;
and setting the inquired paragraph style as the CSS style of the corresponding article paragraph.
3. The article typesetting method according to claim 1, wherein the performing identification replacement on the HTML identification and the style identification in the typesetting setting file according to the tag query table and the identification query table to obtain a target HTML file comprises:
matching HTML marks in the typesetting setting file with the tag query table, and replacing the HTML marks in the typesetting setting file by the HTML tags matched in the tag query table;
and matching the style identification in the typesetting setting file with the identification query table, and replacing the style identification in the typesetting setting file with the CSS style matched in the label query table.
4. The article layout method according to claim 1, wherein the typesetting the article to be laid out according to the target HTML file comprises:
acquiring the corresponding relation between the style identification in the target HTML file and the identification between the chapter paragraphs in the article to be typeset;
determining the style corresponding relation between the CSS style in the target HTML file and the corresponding article paragraph according to the identification corresponding relation;
setting typesetting parameters for the article paragraphs corresponding to the article to be typeset according to the style corresponding relation and the CSS style;
and if the article paragraphs in the article to be typeset are all set by the typesetting parameters, displaying the article to be typeset after the typesetting parameters are set.
5. The method of article layout according to claim 1, further comprising:
acquiring picture information of a display picture in the sample article, and carrying out identification marking on the picture information to obtain a corresponding picture identification, wherein the picture information comprises a picture downloading address and/or a picture display address;
generating a picture query table according to the identification marking result of the picture information, wherein the picture query table stores corresponding relations between different picture information and corresponding picture identifications;
specifically, after receiving the layout setting file for any article to be laid out, the method further includes:
and replacing the picture identification in the typesetting setting file according to the picture query table.
6. The article typesetting method according to claim 5, wherein the replacing the picture identifiers in the typesetting setting file according to the picture lookup table comprises:
matching the picture identification in the typesetting setting file with the picture query table, and generating an IMG label according to the matched picture information in the picture query table;
and replacing the picture identification in the typesetting setting file by the IMG label.
7. The method of article layout according to claim 1, further comprising:
and uploading the typeset article to be typeset to a block chain.
8. An article composition apparatus, comprising:
the paragraph style analysis unit is used for acquiring an HTML (hypertext markup language) file of a sample article and analyzing the paragraph style of an HTML label in the HTML file to obtain a CSS (cascading style sheet) style corresponding to a chapter paragraph in the sample article;
the identification marking unit is used for carrying out identification marking on different HTML tags to obtain corresponding HTML identifications and carrying out identification marking on different CSS styles to obtain corresponding style identifications;
a query table generating unit, configured to generate a tag query table and an identifier query table according to the HTML tag and the identifier tag result of the CSS style, and display the tag query table and the identifier query table, where a correspondence between different HTML tags and corresponding HTML identifiers is stored in the tag query table, and a correspondence between different CSS styles and corresponding style identifiers is stored in the identifier query table;
the mark replacing unit is used for carrying out mark replacement on the HTML marks and the style marks in the typesetting setting files according to the label query table and the mark query table to obtain target HTML files if the typesetting setting files aiming at any article to be typeset are received;
and the article typesetting unit is used for typesetting the article to be typeset according to the target HTML file.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A storage medium storing a computer program, characterized in that the computer program realizes the steps of the method according to any one of claims 1 to 7 when executed by a processor.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010753270.5A CN111814429A (en) | 2020-07-30 | 2020-07-30 | Article typesetting method and device, terminal equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010753270.5A CN111814429A (en) | 2020-07-30 | 2020-07-30 | Article typesetting method and device, terminal equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN111814429A true CN111814429A (en) | 2020-10-23 |
Family
ID=72864049
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010753270.5A Pending CN111814429A (en) | 2020-07-30 | 2020-07-30 | Article typesetting method and device, terminal equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111814429A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112101317A (en) * | 2020-11-17 | 2020-12-18 | 深圳壹账通智能科技有限公司 | Page direction identification method, device, equipment and computer readable storage medium |
| CN113569532A (en) * | 2021-09-22 | 2021-10-29 | 北京仁和汇智信息技术有限公司 | HTML editing method and device, electronic equipment and computer readable storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030204814A1 (en) * | 1999-09-27 | 2003-10-30 | Sara Elo | System & method for creating, editing, an on-line publication |
| KR101341996B1 (en) * | 2012-12-11 | 2013-12-16 | 김제수 | N-screen layout system using semantic web tag of html 5 and method threof |
| CN104239305A (en) * | 2013-06-07 | 2014-12-24 | 阿里巴巴集团控股有限公司 | Electronic document generating and displaying method and apparatus |
| CN111046645A (en) * | 2019-12-11 | 2020-04-21 | 浙江大搜车软件技术有限公司 | Method and device for generating article, computer equipment and storage medium |
-
2020
- 2020-07-30 CN CN202010753270.5A patent/CN111814429A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030204814A1 (en) * | 1999-09-27 | 2003-10-30 | Sara Elo | System & method for creating, editing, an on-line publication |
| KR101341996B1 (en) * | 2012-12-11 | 2013-12-16 | 김제수 | N-screen layout system using semantic web tag of html 5 and method threof |
| CN104239305A (en) * | 2013-06-07 | 2014-12-24 | 阿里巴巴集团控股有限公司 | Electronic document generating and displaying method and apparatus |
| CN111046645A (en) * | 2019-12-11 | 2020-04-21 | 浙江大搜车软件技术有限公司 | Method and device for generating article, computer equipment and storage medium |
Non-Patent Citations (2)
| Title |
|---|
| 李文博, 戴玉刚, 胡敏: "基于XML的藏文网页排版的初步研究", 西北民族大学学报(自然科学版), no. 02 * |
| 杨海亮;徐用吉;: "提取方正排版文件广义元数据并生成全文HTML的探索", 中国科技期刊研究, no. 02 * |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112101317A (en) * | 2020-11-17 | 2020-12-18 | 深圳壹账通智能科技有限公司 | Page direction identification method, device, equipment and computer readable storage medium |
| CN112101317B (en) * | 2020-11-17 | 2021-02-19 | 深圳壹账通智能科技有限公司 | Page direction identification method, device, equipment and computer readable storage medium |
| CN113569532A (en) * | 2021-09-22 | 2021-10-29 | 北京仁和汇智信息技术有限公司 | HTML editing method and device, electronic equipment and computer readable storage medium |
| CN113569532B (en) * | 2021-09-22 | 2022-01-25 | 北京仁和汇智信息技术有限公司 | HTML editing method and device, electronic equipment and computer readable storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112149390A (en) | Report generation method, system, computer device and computer-readable storage medium | |
| CN113434674A (en) | Data analysis method and device, electronic equipment and readable storage medium | |
| CN112947986B (en) | Multi-version code sign-on control method, device, client and storage medium | |
| CN111985202A (en) | Method, equipment and storage medium for generating PDF electronic signature based on template | |
| CN112115145A (en) | Data acquisition method and device, electronic equipment and storage medium | |
| CN112948418A (en) | Dynamic query method, device, equipment and storage medium | |
| CN111352623B (en) | Page generation method and device | |
| CN111814429A (en) | Article typesetting method and device, terminal equipment and storage medium | |
| CN111342992A (en) | Method and system for processing equipment information change record | |
| CN110503404A (en) | Asset tag generation method, device, equipment and storage medium | |
| CN109033049B (en) | PPT document generation method and device, storage medium and terminal | |
| CN107885781B (en) | Version management method and system | |
| CN113268665A (en) | Information recommendation method, device and equipment based on random forest and storage medium | |
| CN113504865B (en) | Work order label adding method, device, equipment and storage medium | |
| CN115185727B (en) | ECU information processing method, device, server and storage medium | |
| CN113139145B (en) | Page generation method and device, electronic equipment and readable storage medium | |
| CN115271889B (en) | Intelligent label automatic linkage generation method, device, equipment and storage medium | |
| CN116954528A (en) | Multi-label printing method, device, electronic equipment and storage medium | |
| CN111506285A (en) | Electronic price tag updating method and device, electronic equipment and readable medium | |
| CN118411216A (en) | Supplier recommendation method based on smart supply chain platform for agricultural products | |
| CN114090572A (en) | Method and device for displaying mapping relation of data table fields in webpage synchronization task | |
| CN116991842A (en) | Data distribution method and device based on data element label and readable medium | |
| CN114169306A (en) | A method, apparatus, device and readable storage medium for generating an electronic receipt | |
| CN107861963B (en) | Generation method and device of dangerous contract | |
| CN113177543A (en) | Certificate identification method, device, equipment and storage medium |
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 | ||
| AD01 | Patent right deemed abandoned |
Effective date of abandoning: 20240621 |
|
| AD01 | Patent right deemed abandoned |