CN117454847B - Method for converting online document into offline document - Google Patents

Method for converting online document into offline document Download PDF

Info

Publication number
CN117454847B
CN117454847B CN202311798440.1A CN202311798440A CN117454847B CN 117454847 B CN117454847 B CN 117454847B CN 202311798440 A CN202311798440 A CN 202311798440A CN 117454847 B CN117454847 B CN 117454847B
Authority
CN
China
Prior art keywords
document
format
conversion
offline
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311798440.1A
Other languages
Chinese (zh)
Other versions
CN117454847A (en
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.)
Nanjing Yihui Information Technology Co ltd
Original Assignee
Nanjing Yihui Information Technology 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 Nanjing Yihui Information Technology Co ltd filed Critical Nanjing Yihui Information Technology Co ltd
Priority to CN202311798440.1A priority Critical patent/CN117454847B/en
Publication of CN117454847A publication Critical patent/CN117454847A/en
Application granted granted Critical
Publication of CN117454847B publication Critical patent/CN117454847B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The invention provides a method for converting an online document into an offline document, which comprises the following steps: 1) Installing a format conversion file and a help file making package; 2) Defining the style of the generated help file, and writing a cascading style document; 3) Traversing all the initial format documents to be converted under the current catalog, calling a format conversion file, generating a conversion format document with the same name as the document, and storing the conversion format document under the same catalog; 4) Traversing all generated documents with conversion formats, and modifying end hyperlinks in the formats to be converted into end hyperlinks in the conversion formats; 5) Checking whether the pattern is correct; 6) Writing a required document for generating a help file; 7) Calling a help file making package to load a required document, and generating a final offline help document; the help file system can solve the problem that the help file of the current online platform cannot be used in the traditional field, the special safety requirement field or the Internet-free environment, and is convenient to carry and check at any time.

Description

Method for converting online document into offline document
Technical Field
The invention relates to the technical field of online file conversion, in particular to a method for converting an online document into an offline document.
Background
With the development of internet technology, more and more online users have increased, so as to meet the demands of users, the requirements on the quality of various documents such as development files and use files are higher, and with the improvement of the quality of documents, the online users are not friendly.
Currently, the method of using online files in a development environment or a cloud platform is usually online, namely, a system is required to be provided with a network environment and a newer browser, online help is realized by opening the online files through the browser in the network environment, so that online documents need to use a development machine with the network environment and a browser matched with the system, and currently used offline documents are inconvenient to read mainly in a markdown format.
Thus, the use process of the online document in the prior art has the following defects and disadvantages:
1) The use of online documents must be on a machine with a network environment, nor must the browser version used be too old, and therefore not friendly to support machines without a network environment or machines with security requirements.
2) The offline document is provided directly in markdown format, which is cumbersome for the user to read.
3) The word help documents generated offline are too many, the searching and reading are troublesome, and the style and format are far less friendly than the online html.
Accordingly, there is a need to provide a method for converting an online document into an offline document, which overcomes the above-mentioned drawbacks and disadvantages of the prior art.
Disclosure of Invention
In order to solve the defects and shortcomings in the prior art, the invention provides a method for converting an online document into an offline document.
The specific scheme provided by the invention is as follows:
a method of converting an online document to an offline document, comprising: the method comprises the following steps:
1) Installing a format conversion file and a help file making package;
2) Defining the style of the generated help file, and writing a cascading style document;
3) Traversing all the initial format documents to be converted under the current catalog, calling a format conversion file, generating a conversion format document with the same name as the document, and storing the conversion format document under the same catalog;
4) Traversing all generated documents with conversion formats, and modifying end hyperlinks in the formats to be converted into end hyperlinks in the conversion formats;
5) Checking whether the pattern is correct;
6) Writing a required document for generating a help file;
7) And calling a help file production package to load the required document, and generating a final offline help document.
In a further preferred embodiment of the present invention, in the step 1), the format conversion file and the help file creation package are installed according to the corresponding installation command, respectively.
As a further preferred embodiment of the present invention, in the step 1), the format conversion file is a pandio file.
As a further preferred embodiment of the present invention, in the step 2), the styles that can be defined in the cascading style document include at least html style, body style, title style, code style and table style.
As a further preferred embodiment of the present invention, in the step 3), the original format document to be converted is a markdown document, and the converted format document is an html document.
As a further preferred embodiment of the present invention, in the step 4), the end hyperlink in the format to be converted is selected from an end hyperlink in the form of md, and the end hyperlink in the format to be converted is selected from an end hyperlink in the form of html.
As a further preferred embodiment of the present invention, in the step 5), it is checked whether the styles of the end hyperlinks of all the converted format documents are satisfactory.
As a further preferred embodiment of the present invention, in the step 6), the required documents include at least a catalog document, an index document and an engineering document.
As a further preferred embodiment of the present invention, in the step 6), the required catalog document, the index document and the engineering document are written sequentially in order of precedence.
As a further preferred embodiment of the present invention, in the step 7), the help file preparation package is hhw.
Compared with the prior art, the invention has the following technical effects:
1) The invention provides a method for converting an online document into an offline document, which can solve the problem that the help file of the current online platform cannot be used in the traditional field, the special safety requirement field or the internet-free environment, and is convenient to carry and check at any time.
2) The invention provides a method for converting an online document into an offline document, which solves the problems that the help document provided in a markdown format is inconvenient to view and cannot be viewed in a special format, and is more friendly to users.
3) The invention provides a method for converting an online document into an offline document, which enables the generated offline document to have the same use experience as the online document, and enables the help file to have higher flexibility and stability.
Drawings
A flowchart of the steps of the present invention is shown in fig. 1.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper", "lower", "inner", "outer", "front", "rear", "both ends", "one end", "the other end", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific direction, be configured and operated in the specific direction, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless explicitly specified and limited otherwise, the terms "mounted," "provided," "connected," and the like are to be construed broadly, and may be fixedly connected, detachably connected, or integrally connected, for example; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
First embodiment
Referring to FIG. 1, a first embodiment of the present invention is provided, which provides a method for converting an online document into an offline document, comprising the steps of:
1) According to the corresponding installation command, respectively creating a package of a format conversion file and a help file, wherein the format conversion file is used for converting an initial format document (markdown format) to be converted into a conversion format document (html format) with the same name, and the format conversion file in the embodiment adopts a pannoc file; the help file making package is used for generating a final offline help file later, and hhw is selected as the help file making package in the embodiment;
2) Defining a style of the generated help file (the help file is chm file in this embodiment), and writing a cascading style document (css style document); in this embodiment, the styles that can be defined in the cascading style document at least include html style, body style, title style, code style, and table style;
3) Traversing all the initial format documents to be converted under the current catalog, calling a format conversion file, generating a conversion format document with the same name as the document, and storing the conversion format document under the same catalog; in this embodiment, the original format document to be converted is a markdown document, and the converted format document is an html document, so as to convert the markdown online file to be read online into an offline file with the same name and html format under the same route.
4) Traversing all generated documents with conversion formats, and modifying end hyperlinks in the formats to be converted into end hyperlinks in the conversion formats; the end hyperlink of the format to be converted is selected as the end hyperlink of the md, and the end hyperlink of the format to be converted is selected as the end hyperlink of the html, so that the generated html document content is correspondingly modified according to the self-defined requirement, and the end hyperlink of the md format is converted into the end hyperlink of the corresponding html format; in addition, the modified content can also comprise a writing method with a picture format and other special formats of markdown, etc.
5) Checking whether the pattern is correct; the method specifically refers to checking whether the styles of the end hyperlinks of all the converted format documents meet the requirements, so that the success and the accuracy of documents required by the subsequently generated help files are ensured;
so far, all required html documents are generated.
6) Writing a required document for generating a help file; in this embodiment, according to the user-defined requirement, the required documents at least include a catalog document, an index document and an engineering document, and the required catalog document, the index document and the engineering document are written sequentially according to the sequence, and those skilled in the art know that other required documents can be added on the basis of the above according to different use requirements.
7) The help file production package is called to load the required document, the final offline help document chm is generated, and the chm document can meet the use requirements of different development environments (online and offline) and has more flexibility.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

Claims (9)

1. A method of converting an online document to an offline document, comprising: the method comprises the following steps:
1) Installing a format conversion file and a help file making package;
2) Defining the style of the generated help file, and writing a cascading style document;
3) Traversing all the initial format documents to be converted under the current catalog, calling a format conversion file, generating a conversion format document with the same name as the document, and storing the conversion format document under the same catalog;
4) Traversing all generated documents with conversion formats, and modifying end hyperlinks in the formats to be converted into end hyperlinks in the conversion formats;
5) Checking whether the pattern is correct;
6) Writing a required document for generating a help file;
7) Calling a help file making package to load a required document, and generating a final offline help document;
in the step 2), the styles defined in the cascading style document at least comprise html style, body style, title style, code style and form style.
2. A method of converting an online document to an offline document according to claim 1, wherein: in the step 1), the format conversion file and the help file making package are respectively installed according to the corresponding installation command.
3. A method of converting an online document to an offline document according to claim 1, wherein: in the step 1), the format conversion file is a pannoc file.
4. A method of converting an online document to an offline document according to claim 1, wherein: in the step 3), the original format document to be converted is a markdown document, and the converted format document is an html document.
5. A method of converting an online document to an offline document according to claim 1, wherein: in the step 4), the end hyperlink in the required conversion format is selected from the end hyperlink in the md, and the end hyperlink in the conversion format is selected from the end hyperlink in the html.
6. A method of converting an online document to an offline document according to claim 1, wherein: in said step 5), it is checked whether the styles of the end hyperlinks of all converted format documents are satisfactory.
7. A method of converting an online document to an offline document according to claim 1, wherein: in the step 6), the required documents at least comprise catalog documents, index documents and engineering documents.
8. A method of converting an online document to an offline document according to claim 7, wherein: in the step 6), the required catalog document, the index document and the engineering document are written in sequence.
9. A method of converting an online document to an offline document according to claim 1, wherein: in the step 7), the help file is selected from hhw.
CN202311798440.1A 2023-12-26 2023-12-26 Method for converting online document into offline document Active CN117454847B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311798440.1A CN117454847B (en) 2023-12-26 2023-12-26 Method for converting online document into offline document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311798440.1A CN117454847B (en) 2023-12-26 2023-12-26 Method for converting online document into offline document

Publications (2)

Publication Number Publication Date
CN117454847A CN117454847A (en) 2024-01-26
CN117454847B true CN117454847B (en) 2024-03-15

Family

ID=89593348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311798440.1A Active CN117454847B (en) 2023-12-26 2023-12-26 Method for converting online document into offline document

Country Status (1)

Country Link
CN (1) CN117454847B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108376127A (en) * 2018-03-15 2018-08-07 武汉斗鱼网络科技有限公司 A kind of method, apparatus and computer readable storage medium of document structure tree
CN112632425A (en) * 2020-12-10 2021-04-09 京东数字科技控股股份有限公司 Method, device, equipment and storage medium for generating offline resource file
CN113407229A (en) * 2020-03-17 2021-09-17 百度在线网络技术(北京)有限公司 Method and device for generating offline script
CN114661306A (en) * 2020-12-22 2022-06-24 苏州国双软件有限公司 Data processing method and device, electronic equipment and storage medium
CN115481288A (en) * 2022-10-13 2022-12-16 上海英方软件股份有限公司 Method and device for realizing conversion from online interface document to offline interface document
CN117075870A (en) * 2023-08-30 2023-11-17 郑州云海信息技术有限公司 Online document generation method, device, equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108376127A (en) * 2018-03-15 2018-08-07 武汉斗鱼网络科技有限公司 A kind of method, apparatus and computer readable storage medium of document structure tree
CN113407229A (en) * 2020-03-17 2021-09-17 百度在线网络技术(北京)有限公司 Method and device for generating offline script
CN112632425A (en) * 2020-12-10 2021-04-09 京东数字科技控股股份有限公司 Method, device, equipment and storage medium for generating offline resource file
CN114661306A (en) * 2020-12-22 2022-06-24 苏州国双软件有限公司 Data processing method and device, electronic equipment and storage medium
CN115481288A (en) * 2022-10-13 2022-12-16 上海英方软件股份有限公司 Method and device for realizing conversion from online interface document to offline interface document
CN117075870A (en) * 2023-08-30 2023-11-17 郑州云海信息技术有限公司 Online document generation method, device, equipment and medium

Also Published As

Publication number Publication date
CN117454847A (en) 2024-01-26

Similar Documents

Publication Publication Date Title
US6519626B1 (en) System and method for converting a file system path into a uniform resource locator
CN101778168B (en) Method and system for optimization display of wed pages on browser of mobile terminal
US7134073B1 (en) Apparatus and method for enabling composite style sheet application to multi-part electronic documents
JP4723793B2 (en) Customizing the content provided by the service
US6589291B1 (en) Dynamically determining the most appropriate location for style sheet application
JP2004501442A (en) Method and system for dynamic font subsetting
CN101727490A (en) Method for realizing page insertion in WEB application and WEB server
CN102163233A (en) Method and system for converting webpage markup language format
US20010018649A1 (en) Relay device, server device, terminal device, and translation server system utilizing these devices
US20050262049A1 (en) System, method, device, and computer code product for implementing an XML template
CN1493045A (en) System and method for delivering content to mobile devices
US20060035587A1 (en) Information equipment remote operating system, and information equipment
JPH09231022A (en) Document accumulator
JP2001209570A (en) Link effectiveness test device and method on a computer network
CN101272543A (en) Wireless data transmission method
CN117454847B (en) Method for converting online document into offline document
CN113705181A (en) Method for annotating files in browser
CN113297856B (en) Document translation method and device and electronic equipment
US7321439B2 (en) Information processing apparatus and method for processing externally transmitted data, and information processing program
US7688460B2 (en) Communication terminal for accessing and printing page data from links
JP2005182735A (en) Document data display device, cellular phone device, document data display method, document data display program, computer-readable recording medium with it recorded, document data printer, document data output device, document data output method, document data output program, and computer-readable recording medium with it recorded
US20040201591A1 (en) Data transfer method, data transfer program, storage medium and information terminal
KR20020041331A (en) Contents providing system
KR100453224B1 (en) Apparatus and method for editing a numerical formula by using wire/wireless internet
EP1384165A2 (en) Customization of output content based on device type

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