CN110929495A - Typesetting method for automatically beautifying article - Google Patents
Typesetting method for automatically beautifying article Download PDFInfo
- Publication number
- CN110929495A CN110929495A CN201911090237.2A CN201911090237A CN110929495A CN 110929495 A CN110929495 A CN 110929495A CN 201911090237 A CN201911090237 A CN 201911090237A CN 110929495 A CN110929495 A CN 110929495A
- Authority
- CN
- China
- Prior art keywords
- article
- typesetting
- articles
- customized
- app
- 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.)
- Granted
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Document Processing Apparatus (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a method for automatically beautifying article typesetting, which comprises the following steps: s1: developing customized templates of a plurality of articles of different types and typesetting; s2: packaging a plurality of customized templates developed in the S1 and automatically generating an applicable wap and app environment use template; s3: analyzing, splitting and synthesizing the plurality of customized templates packaged in the S2 by using an HtmlWebpackPlugin method to finally obtain template files suitable for the wap version and the app version; s4: and updating the template files of the wap version and the app version obtained in the S3 to the server. The method is reasonable in design, and the customized unique media attribute typesetting is newly given according to different categories by removing the default styles of the articles. The interpretative articles with the markedness belong to a certain category, for example, the articles in the science and technology category can carry science and technology elements. Therefore, the article typesetting can be beautified, and the reading experience of the user is improved.
Description
Technical Field
The invention relates to the technical field of media attributes, in particular to a method for automatically beautifying article typesetting.
Background
Since the media age and the rapid rise of internet technology, the media article is popular with the public. The articles come from different authors and are published on different platforms, so that the typesetting of the articles is disordered, the paragraph hierarchy is unclear, various unfriendly layouts and the like cause the reading of users to be reduced. All large information platforms can be published after establishing editing departments to carry out operations such as personnel examination, typesetting again, font beautifying, paragraph beautifying and the like. A large amount of manpower and material resources of a company are consumed to beautify the typesetting of the articles, errors or omission change are easy to occur in the process of auditing and re-typesetting, and the typesetting style of each editor is not uniform. The efficiency is low due to too much repetitive work, and therefore, the inventor thinks that it is necessary to develop a method for beautifying the typesetting of the article.
Disclosure of Invention
Based on the technical problems in the background art, the invention provides a method for automatically beautifying article typesetting.
The invention provides a method for automatically beautifying article typesetting, which comprises the following steps:
s1: developing customized templates of a plurality of articles of different types and typesetting;
s2: packaging a plurality of customized templates developed in the S1 and automatically generating an applicable wap and app environment use template;
s3: analyzing, splitting and synthesizing the plurality of customized templates packaged in the S2 by using an HtmlWebpackPlugin method to finally obtain template files suitable for the wap version and the app version;
s4: updating the template files of the wap version and the app version obtained in the step S3 to a server;
s5: automatically applying a customized template to the articles according to the articles of different categories, responding to the article publishing request, and acquiring the specific title font names according to the articles of different categories;
s6: clearing original styles of article contents, clearing redundant space symbols and indented symbol carriage returns symbols;
s7: traversing each picture of the original article, replacing all pictures with own picture components, and providing different types of article paragraphs with own special typesetting attributes to finish the rendering of the page.
Preferably, in S1, specific layout and header images, such as author and time, font size, color, alignment, layout position, and specific icon images, are set on different customized templates.
Preferably, in S2, the requirements of the app version and the web version configuration environments are node v8.7.0 or more, npmv5.5.1 or more, and webpack v2.0 or more.
Preferably, in S3, the app uses zip webpackplug to pack app codes into a zip compressed package, and the zip compressed package is provided in an app dynamic download template package, where the dynamic download template package only needs to be downloaded from one side and downloaded to the server, and the web version is directly updated to the server.
Preferably, in S5, the Fontmin method is used to blend out the category and font name of the article to obtain the ttfBase64 file corresponding to the title custom media attribute font, and the ttfBase64 file is used to set the css style of the page: the code of the specific JS is as follows.
Preferably, in S6, the pre _ place is used to remove the original style of the article content, remove the redundant space character and the indented character carriage return character, and reset the font size, line height, color and background of the article according to the article type configuration, and add the customized unique media attribute typesetting, so as to beautify the article paragraph typesetting, and bring its own unique typesetting attributes to the different article paragraphs.
Preferably, in S7, the picture of each original article is traversed, the pre _ place is used to reset the picture to obtain a new img _ box picture component, a corresponding customized media picture pattern is set for the img _ box picture component, lazyload is used to bind and load logic to the img _ box picture, and a width and height logic is set.
Preferably, in S7, the beautified article pictures and the description layouts are configured according to the category articles, and the customized unique media attribute layouts such as picture rounding, center alignment, width-full screen, and height adaptation are added.
Compared with the prior art, the invention automatically generates the use template suitable for wap and app environments by packaging a set of templates, realizes multi-end use of the set of templates, reduces development and maintenance cost, obtains simplified fonts corresponding to the title customized media attributes through Fontmin, requires dozens of megabytes for traditional font loading, only needs about 10KB for obtaining the simplified fonts by using the Fontmin method, greatly improves loading speed and improves reading experience of users.
The invention removes the default style of the article, gives the customized unique media attribute typesetting again according to different categories, and explains that the article with the sign belongs to a certain category, for example, the article in the scientific and technological category can carry scientific and technological elements, thereby beautifying the article typesetting and improving the reading experience of users.
Description of the drawings:
FIG. 1 is a flow chart for developing a template of articles in each category;
FIG. 2 is a flow chart of generating a reduced font based on the categories and titles of articles;
FIG. 3 is a flow chart of composing and rendering beautified articles by obtaining article configuration data, content data, templates (FIG. 1) and reduced fonts (FIG. 2) in response to a request.
Detailed Description
The present invention will be further illustrated with reference to the following specific examples.
Examples
The embodiment provides a method for automatically beautifying article typesetting, which comprises the following steps:
s1: developing customized templates of a plurality of articles of different types and typesetting;
s2: packaging a plurality of customized templates developed in the S1 and automatically generating an applicable wap and app environment use template;
s3: analyzing, splitting and synthesizing the plurality of customized templates packaged in the S2 by using an HtmlWebpackPlugin method to finally obtain template files suitable for the wap version and the app version;
s4: updating the template files of the wap version and the app version obtained in the step S3 to a server;
s5: automatically applying a customized template to the articles according to the articles of different categories, responding to the article publishing request, and acquiring the specific title font names according to the articles of different categories;
s6: clearing original styles of article contents, clearing redundant space symbols and indented symbol carriage returns symbols;
s7: traversing each picture of the original article, replacing all pictures with own picture components, and providing different types of article paragraphs with own special typesetting attributes to finish the rendering of the page.
In this embodiment, in S1, specific layout and header map are set on different customized templates, such as author and time, font size, color, alignment mode, layout position, and specific icon map, in S2, the requirements of the app version and web version configuration environment are node v8.7.0 and above, npm v5.5.1 and above, and webpack v2.0 and above, in S3, the app version uses zipwebpack to package app version codes into zip compressed packages, which are provided in an app dynamic download template package, the dynamic download template package only needs to download one side and download on a server, the web version is directly updated on the server, in S5, the Fontmin method is used to mix out the categories and font names of articles to obtain ttfBase64 file corresponding to the title customized media attribute, and the ttfBase64 file is used to set css style of the page: the specific JS code is as follows, in S6, the pre _ place is used to remove the original style of the article content, the redundant space character and the indented return character are removed, the article font size, line height, color and background are reset according to the article configuration of the category, and the customized unique media attribute typesetting is added. The beautifying article paragraph typesetting is to bring own special typesetting attributes to different article paragraphs, in S7, pictures of each original article are traversed, a picture is reset by a preg _ place to obtain a new img _ box picture component, a corresponding customized media picture pattern is set for the img _ box picture component, lazyload is used to bind and load logic to the img _ box picture, width and height logic is set, in S7, the beautifying article pictures are configured according to the article categories, typesetting is described, and customized special media attribute typesetting such as picture rounding, centered alignment, width full screen and height self-adaption is added.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.
Claims (8)
1. A method for automatically beautifying typesetting of articles is characterized by comprising the following steps:
s1: developing customized templates of a plurality of articles of different types and typesetting;
s2: packaging a plurality of customized templates developed in the S1 and automatically generating an applicable wap and app environment use template;
s3: analyzing, splitting and synthesizing the plurality of customized templates packaged in the S2 by using an HtmlWebpackPlugin method to finally obtain template files suitable for the wap version and the app version;
s4: updating the template files of the wap version and the app version obtained in the step S3 to a server;
s5: automatically applying a customized template to the articles according to the articles of different categories, responding to the article publishing request, and acquiring the specific title font names according to the articles of different categories;
s6: clearing original styles of article contents, clearing redundant space symbols and indented symbol carriage returns symbols;
s7: traversing each picture of the original article, replacing all pictures with own picture components, and providing different types of article paragraphs with own special typesetting attributes to finish the rendering of the page.
2. The method for automatically beautifying the typesetting of an article as claimed in claim 1, wherein in S1, specific typesetting and header drawings are set on different customized templates, such as author and time, font size, color, alignment, typesetting position and specific icon drawings.
3. The method of claim 1, wherein in S2, the requirements of the environment configured by the app version and the web version are node v8.7.0 or more, npm v5.5.1 or more, and webpack v2.0 or more.
4. The method as claimed in claim 1, wherein in S3, the app uses zip webpackplug to package app codes into zip compressed package, and the zip compressed package is provided in the app dynamic download template package, and the dynamic download template package only needs to be downloaded from one side to the server, and the web is directly updated to the server.
5. The method of claim 1, wherein in S5, Fontmin method is used to mix out the type and font name of the article to obtain ttfBase64 file corresponding to the title custom media attribute font, ttfBase64 file is used to set the css style of the page: the code for the specific JS is as follows: @ font-face { font-family: 'zaker _ font _ title'; src: url (ttfBase 6).
6. The method of claim 1, wherein in S6, preg _ place is used to remove original style of article content, redundant space character and indent character carriage return character, and the article font size, line height, color and background are reset according to article type configuration, and customized unique media attribute typesetting is added; the beautifying article paragraph typesetting brings own special typesetting attributes to article paragraphs of different categories.
7. The method of claim 1, wherein in S7, the picture of each original article is traversed, the picture is reset using preg _ place to obtain a new img _ box picture element, a corresponding customized media picture pattern is set for the img _ box picture element, lazyload is used to bind and load logic to the img _ box picture, and a width and height logic is set.
8. The method of claim 1, wherein in S7, the beautifying article picture is configured according to the category article, the description layout is configured, and the customized unique media attribute layout such as picture rounding, center alignment, width full screen, height adaptation is added.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911090237.2A CN110929495B (en) | 2019-11-08 | 2019-11-08 | Method for automatically beautifying typesetting of articles |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911090237.2A CN110929495B (en) | 2019-11-08 | 2019-11-08 | Method for automatically beautifying typesetting of articles |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110929495A true CN110929495A (en) | 2020-03-27 |
CN110929495B CN110929495B (en) | 2023-08-29 |
Family
ID=69853633
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911090237.2A Active CN110929495B (en) | 2019-11-08 | 2019-11-08 | Method for automatically beautifying typesetting of articles |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110929495B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111626036A (en) * | 2020-05-27 | 2020-09-04 | 南京蓝鲸人网络科技有限公司 | Novel image-text typesetting processing method |
CN112052003A (en) * | 2020-09-07 | 2020-12-08 | 江苏小梦科技有限公司 | Internet software web application page beautifying system |
CN112256379A (en) * | 2020-10-30 | 2021-01-22 | 广东耐思智慧科技有限公司 | Method for realizing mass production of multi-industry templates |
CN113743051A (en) * | 2021-08-10 | 2021-12-03 | 广州坚和网络科技有限公司 | Font setting method, user terminal, server and system |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030167355A1 (en) * | 2001-07-10 | 2003-09-04 | Smith Adam W. | Application program interface for network software platform |
CN102056150A (en) * | 2010-12-01 | 2011-05-11 | 北京迅捷英翔网络科技有限公司 | Mobile phone terminal strategy adapting device and method |
CN105573762A (en) * | 2015-12-18 | 2016-05-11 | 中山市飞骅数码科技有限公司 | Integrated system for producing and releasing digital media terminal applications |
CN106296120A (en) * | 2016-08-05 | 2017-01-04 | 安徽和信科技发展有限责任公司 | A kind of government and enterprises integration Content Management Platform |
CN106681979A (en) * | 2016-11-23 | 2017-05-17 | 广州阿里巴巴文学信息技术有限公司 | Article layout method and device, programmable device and article publishing platform |
CN108052491A (en) * | 2017-11-22 | 2018-05-18 | 李晓妮 | A kind of automatic processing method and device of certificate document |
CN109324836A (en) * | 2017-07-27 | 2019-02-12 | 阿里巴巴集团控股有限公司 | The processing method of the generation method and device of personalized photo, personalized splashette |
-
2019
- 2019-11-08 CN CN201911090237.2A patent/CN110929495B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030167355A1 (en) * | 2001-07-10 | 2003-09-04 | Smith Adam W. | Application program interface for network software platform |
CN102056150A (en) * | 2010-12-01 | 2011-05-11 | 北京迅捷英翔网络科技有限公司 | Mobile phone terminal strategy adapting device and method |
CN105573762A (en) * | 2015-12-18 | 2016-05-11 | 中山市飞骅数码科技有限公司 | Integrated system for producing and releasing digital media terminal applications |
CN106296120A (en) * | 2016-08-05 | 2017-01-04 | 安徽和信科技发展有限责任公司 | A kind of government and enterprises integration Content Management Platform |
CN106681979A (en) * | 2016-11-23 | 2017-05-17 | 广州阿里巴巴文学信息技术有限公司 | Article layout method and device, programmable device and article publishing platform |
CN109324836A (en) * | 2017-07-27 | 2019-02-12 | 阿里巴巴集团控股有限公司 | The processing method of the generation method and device of personalized photo, personalized splashette |
CN108052491A (en) * | 2017-11-22 | 2018-05-18 | 李晓妮 | A kind of automatic processing method and device of certificate document |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111626036A (en) * | 2020-05-27 | 2020-09-04 | 南京蓝鲸人网络科技有限公司 | Novel image-text typesetting processing method |
CN112052003A (en) * | 2020-09-07 | 2020-12-08 | 江苏小梦科技有限公司 | Internet software web application page beautifying system |
CN112256379A (en) * | 2020-10-30 | 2021-01-22 | 广东耐思智慧科技有限公司 | Method for realizing mass production of multi-industry templates |
CN112256379B (en) * | 2020-10-30 | 2024-05-24 | 广东耐思智慧科技有限公司 | Method for mass production of multi-industry templates |
CN113743051A (en) * | 2021-08-10 | 2021-12-03 | 广州坚和网络科技有限公司 | Font setting method, user terminal, server and system |
Also Published As
Publication number | Publication date |
---|---|
CN110929495B (en) | 2023-08-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110929495A (en) | Typesetting method for automatically beautifying article | |
CN111753499B (en) | Method for merging and displaying electronic form and OFD format file and generating directory | |
US8245132B2 (en) | Publication layout system | |
US7469380B2 (en) | Dynamic document and template previews | |
US20130326333A1 (en) | Mobile Content Management System | |
CN108595389B (en) | Method for converting Word document into txt plain text document | |
CN111752899B (en) | Environment report generation method and device, electronic equipment and storage medium | |
CN107783949B (en) | PPT document processing method and device | |
CN113609820A (en) | Method, device and equipment for generating word file based on extensible markup language file | |
GB2423387A (en) | Application-Generic Sequence Diagram Generator Driven by a Non-Proprietary Language | |
US20180101974A1 (en) | Portable typelet file | |
CN110705237A (en) | Automatic document generation method, data processing device, and storage medium | |
CN112330532A (en) | Image analysis processing method and equipment | |
CN106708506A (en) | Method and device for optimizing starting speed of Android applications visually | |
CN111859053B (en) | Data definition method of visual chart and chart library system | |
JP4185175B2 (en) | How to display structured documents | |
US6330073B1 (en) | System and method for merging multi-platform documents | |
CN114489640A (en) | Visual page generation method, storage medium and device | |
CN102132313B (en) | There is the content of the machine part and export section | |
CN115293124A (en) | Automatic generation method and device for software engineering document | |
CN111339467A (en) | Method for standardizing template of commodity detail page based on E-commerce platform | |
CN111367514A (en) | Page card development method and device, computing device and storage medium | |
Bagley et al. | Creating reusable well-structured PDF as a sequence of component object graphic (COG) elements | |
CN116954450A (en) | Screenshot method and device for front-end webpage, storage medium and terminal | |
CA2602749A1 (en) | System and method of report representation |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |