CN110008182A - A kind of method that static resource is saved and generated in document - Google Patents

A kind of method that static resource is saved and generated in document Download PDF

Info

Publication number
CN110008182A
CN110008182A CN201910299789.8A CN201910299789A CN110008182A CN 110008182 A CN110008182 A CN 110008182A CN 201910299789 A CN201910299789 A CN 201910299789A CN 110008182 A CN110008182 A CN 110008182A
Authority
CN
China
Prior art keywords
static resource
document
file
source document
path
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910299789.8A
Other languages
Chinese (zh)
Inventor
王振峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Inspur Cloud Information Technology Co Ltd
Original Assignee
Shandong Inspur Cloud 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 Shandong Inspur Cloud Information Technology Co Ltd filed Critical Shandong Inspur Cloud Information Technology Co Ltd
Priority to CN201910299789.8A priority Critical patent/CN110008182A/en
Publication of CN110008182A publication Critical patent/CN110008182A/en
Pending legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The present invention discloses a kind of method that static resource is saved and generated in document, is related to document resources administrative skill field;Cited static resource file and source document are stored under same file folder in source document, source document quotes static resource file using relative path, source document generates in the conversion process of final document, the relative path of source document reference static resource file is converted into the absolute path that static resource file is stored in static resource server using filter utility, static resource file is accessed by absolute path in the final document after conversion;Compared with prior art, avoid the absolute path file in the document based on text mark up language in direct reference document storage server, instantaneously browsing when not only facilitating editor's source document, but also will not influence the use of final document, and greatly facilitate the maintenance of static resource file.

Description

A kind of method that static resource is saved and generated in document
Technical field
The present invention discloses a kind of method that static resource is saved and generated in document, is related to document resources administrative skill neck Domain.
Background technique
The effect of software document is most important, has a variety of functions served as bridge, facilitates programmer and program, facilitate pipe Reason personnel's supervision and management software development facilitates user and understands the working method of software and operated use, helps to safeguard Personnel are effectively modified and are expanded.The mode of existing maintenance software document, usually using the binary systems such as Word or PDF text Shelves are safeguarded that such document facilitates editor and reading, but is not easy to version management and the multiple person cooperational editor of document, and uses The problem of text mark up language maintenance document can solve version management and multiple person cooperational editor.
Text mark up language is stored using plain text format, is more convenient version management, and can be converted to by tool The document of other more convenient previews, such as HTML, Word, epub.Currently in order to guaranteeing the static money in the document finally converted Source file can normal use and displaying, in the document source file based on text mark up language often with it is quiet in generated document State resource file path is consistent, and is unfavorable for source file editor and preview, and static resource is stored to unified file and is deposited Store up server, and the static resource in the source document based on text mark up language and final output document often save it is different It causes, causes to be unfavorable for later maintenance.
Static resource file refers generally to the file that picture, pattern file etc. will not change.
The present invention provides a kind of method that static resource is saved and generated in document, immediately clear when both facilitating editor's source document It lookes at, and will not influence the use of final document.It is able to solve quiet in the document final output document based on text mark up language The inconsistent problem of state resource conservation.
Summary of the invention
The present invention is directed to problem of the prior art, provides a kind of method that static resource is saved and generated in document, both side Instantaneously browsing when just editing source document, and will not influence the use of final document.It is able to solve the text based on text mark up language Static resource in shelves final output document saves inconsistent problem.
Concrete scheme proposed by the present invention is:
A kind of method that static resource is saved and generated in document, cited static resource file and source document in source document Shelves are stored under same file folder, and source document quotes static resource file using relative path,
Source document generates in the conversion process of final document, and source document is quoted static resource file using filter utility Relative path is converted to the absolute path that static resource file is stored in static resource server, and the final document after conversion is logical It crosses absolute path and static resource file is accessed.
The relative path of source document reference static resource file is converted using pandoc filter utility in the method The absolute path in static resource server is stored in for static resource file.
The lua filter supported in the method using pandoc filter utility, utilizes the filter of lua language definition Source code disposes static resource path, obtains the affiliated file of static resource, and the src of replacement img label is absolute path.
Specific steps in the method are as follows:
Step 1: source document carries out documents editing, and static resource file cited in source document is stored in source document In sub-folder under same file folder,
Step 2: source document generates in the conversion process of final document, uses the lua filter of pandoc filter utility, benefit With the filter source code of lua language definition, static resource path is disposed, obtains the affiliated file of static resource, replaces img label Src be static resource server in absolute path, static resource file is stored in static resource server,
Step 3: static resource file is accessed by absolute path in the final document after conversion.
The tool that static resource is saved and generated in a kind of document, including source document edit cell, converting unit and access Unit,
Static resource file and source document cited in source document are stored in same file folder by source document edit cell Under, source document quotes static resource file using relative path,
Source document is quoted static state in the conversion process that source document generates final document, using filter utility by converting unit The relative path of resource file is converted to the absolute path that static resource file is stored in static resource server, after conversion Static resource file is accessed by absolute path using access unit in final document.
Source document is quoted the opposite of static resource file using pandoc filter utility by converting unit in the tool Path integration is that static resource file is stored in the absolute path in static resource server.
The lua filter that converting unit is supported using pandoc filter utility in the tool, utilizes lua language definition Filter source code, dispose static resource path, obtain the affiliated file of static resource,
The src for replacing img label is absolute path.
The specific steps of the tool use process are as follows:
Step 1: source document edit cell carries out the documents editing of source document, by static resource text cited in source document Part and source document are stored in the sub-folder under same file folder,
Step 2: converting unit uses pandoc filter utility in the conversion process that source document generates final document Lua filter disposes static resource path using the filter source code of lua language definition, obtains the affiliated file of static resource Folder, the src of replacement img label are absolute path in static resource server, and static resource file is stored in static resource clothes It is engaged in device,
Step 3: static resource file is accessed by absolute path using access unit in the final document after conversion.
Usefulness of the present invention is:
The present invention provides a kind of method that static resource is saved and generated in document, cited static resource in source document File and source document are stored under same file folder, and source document quotes static resource file using relative path, and source document generates In the conversion process of final document, the relative path of source document reference static resource file is converted into static state using filter utility Resource file is stored in the absolute path in static resource server, and the final document after conversion is accessed quiet by absolute path State resource file;Compared with prior art, the direct reference document storage service in the document based on text mark up language is avoided Absolute path file in device, instantaneously browsing when not only facilitating editor's source document, but also will not influence the use of final document, and significantly Facilitate the maintenance of static resource file.
Detailed description of the invention
Fig. 1 is the folder structure schematic diagram of the embodiment of the present invention;
Static resource distribution schematic diagram in Fig. 2 the method for the present invention;
Fig. 3 the method for the present invention flow diagram.
Specific embodiment
The present invention provides a kind of method that static resource is saved and generated in document, cited static resource in source document File and source document are stored under same file folder, and source document quotes static resource file using relative path, and source document generates In the conversion process of final document, the relative path of source document reference static resource file is converted into static state using filter utility Resource file is stored in the absolute path in static resource server, and the final document after conversion is accessed quiet by absolute path State resource file.
The tool that static resource is saved and generated in a kind of document corresponded to the above method, including source document are provided simultaneously Shelves edit cell, converting unit and access unit,
Static resource file and source document cited in source document are stored in same file folder by source document edit cell Under, source document quotes static resource file using relative path,
Source document is quoted static state in the conversion process that source document generates final document, using filter utility by converting unit The relative path of resource file is converted to the absolute path that static resource file is stored in static resource server, after conversion Static resource file is accessed by absolute path using access unit in final document.
The present invention will be further explained below with reference to the attached drawings and specific examples, so that those skilled in the art can be with It more fully understands the present invention and can be practiced, but illustrated embodiment is not as a limitation of the invention.
Using the method for the present invention, by taking the preservation of document and static resource file in attached drawing 1 as an example, wherein help file It stores in source file usermanual, the img file of document and houses the picture file quoted in source file, usermanual Partial content it is as follows:
User opens browser, the address of common data open platform is inputted in address field, i.e., it can be seen that 1. θ institute of picture The platform homepage shown can check current platform open department's number, data set quantity, data in platform homepage carousel figure Total number, data file quantity, API quantity, amount of access and download.
![](img/shouye.png)
Above-mentioned source document usermanual carries out documents editing, and picture cited in source document is stored in source document In sub-folder under same file folder,
Source document usermanual is generated in the conversion process of final document, is filtered using the lua of pandoc filter utility Device utilizes the filter source code of lua language definition, main code are as follows:
After pandoc filter utility Convert File, content is as follows:
<p>user open browser, in address field, input Shandong Province's common data open platform address (http :/ data.sd.gov.cn/)
I.e. it can be seen that the platform homepage as shown in Fig. 1 θ can check that current platform is opened in platform homepage carousel figure Department's number, data cover field number, the data total number, number of applications, data set quantity put</p><p><a href= Http: // 127. θ θ .1/www/static/help/img/index.png " data-fancybox=" " data- Animation-effect="zoom-in-out"><img src="http://127.θ.θ.1/www/static/help/ img/index.png"/></a></p>;
Src=" http: // 127. θ θ .1/www/static/help/img/index.png " are static resource file guarantor There are the path in static resource server,
Run the order pandoc--from=markdown-N-toc--highlight-style=of pandoc Zenburn--lua-filter=filter.lua-o targetusermanual.md, the final document after conversion pass through exhausted Static resource file is accessed to path.
The preservation of static resource file is carried out using inventive article, with the guarantor of document and static resource file in attached drawing 1 Example is saved as, wherein houses in source file and quotes in source file usermanual, the img file of help file storage document Picture file, the partial content of usermanual is as follows:
User opens browser, the address of common data open platform is inputted in address field, i.e., it can be seen that 1. θ institute of picture The platform homepage shown can check current platform open department's number, data set quantity, data in platform homepage carousel figure Total number, data file quantity, API quantity, amount of access and download.
![](img/shouye.png)
Documents editing is carried out to above-mentioned source document usermanual using source document edit cell, it will be cited in source document Picture and source document be stored in same file folder under sub-folder in,
In the conversion process that source document usermanual generates final document, converting unit uses pandoc filter utility Lua filter, utilize the filter source code of lua language definition, main code are as follows:
After pandoc filter utility Convert File, content is as follows:
<p>user open browser, in address field, input Shandong Province's common data open platform address (http :/ data.sd.gov.cn/)
I.e. it can be seen that the platform homepage as shown in Fig. 1 θ can check that current platform is opened in platform homepage carousel figure Department's number, data cover field number, the data total number, number of applications, data set quantity put</p><p><a href= Http: // 127. θ θ .1/www/static/help/img/index.png " data-fancybox=" " data- Animation-effect="zoom-in-out"><img src="http://127.θ.θ.1/www/static/help/ img/index.png"/></a></p>;
Src=" http: // 127. θ θ .1/www/static/help/img/index.png " are static resource file guarantor There are the path in static resource server,
Run the order pandoc--from=markdown-N-toc--highlight-style=of pandoc Zenburn--lua-filter=filter.lua-o targetusermanual.md, the final document after conversion utilize visit Ask that static resource file is accessed by absolute path in unit.
Embodiment described above is only to absolutely prove preferred embodiment that is of the invention and being lifted, protection model of the invention It encloses without being limited thereto.Those skilled in the art's made equivalent substitute or transformation on the basis of the present invention, in the present invention Protection scope within.Protection scope of the present invention is subject to claims.

Claims (8)

1. a kind of method that static resource is saved and generated in document, it is characterized in that static resource file cited in source document It is stored under same file folder with source document, source document quotes static resource file using relative path, and source document generates final In the conversion process of document, the relative path of source document reference static resource file is converted into static resource using filter utility File is stored in the absolute path in static resource server, and static money is accessed by absolute path in the final document after conversion Source file.
2. according to the method described in claim 1, it is characterized in that source document is quoted static resource using pandoc filter utility The relative path of file is converted to the absolute path that static resource file is stored in static resource server.
3. according to the method described in claim 2, it is characterized in that the lua filter supported using pandoc filter utility, is utilized The filter source code of lua language definition disposes static resource path, obtains the affiliated file of static resource, replacement img label Src is absolute path.
4. according to the method described in claim 3, it is characterized in that specific steps are as follows:
Step 1: source document carries out documents editing, static resource file cited in source document is stored in source document same In sub-folder under file,
Step 2: source document generates in the conversion process of final document, using the lua filter of pandoc filter utility, utilizes The filter source code of lua language definition disposes static resource path, obtains the affiliated file of static resource, replacement img label Src is absolute path in static resource server, and static resource file is stored in static resource server,
Step 3: static resource file is accessed by absolute path in the final document after conversion.
5. the tool that static resource is saved and generated in a kind of document, it is characterized in that including source document edit cell, converting unit And access unit,
Static resource file and source document cited in source document are stored under same file folder by source document edit cell, source Document quotes static resource file using relative path,
Source document is quoted static resource in the conversion process that source document generates final document, using filter utility by converting unit The relative path of file is converted to the absolute path that static resource file is stored in static resource server, final after conversion Static resource file is accessed by absolute path using access unit in document.
6. tool according to claim 5, it is characterized in that converting unit is quoted source document using pandoc filter utility The relative path of static resource file is converted to the absolute path that static resource file is stored in static resource server.
7. tool according to claim 6, it is characterized in that converting unit is filtered using the lua that pandoc filter utility is supported Device disposes static resource path using the filter source code of lua language definition, obtains the affiliated file of static resource, replacement The src of img label is absolute path.
8. tool according to claim 7, it is characterized in that the specific steps of use process are as follows:
Step 1: source document edit cell carries out the documents editing of source document, by static resource file cited in source document with Source document is stored in the sub-folder under same file folder,
Step 2: converting unit uses the lua mistake of pandoc filter utility in the conversion process that source document generates final document Filter disposes static resource path using the filter source code of lua language definition, obtains the affiliated file of static resource, replacement The src of img label is absolute path in static resource server, and static resource file is stored in static resource server,
Step 3: static resource file is accessed by absolute path using access unit in the final document after conversion.
CN201910299789.8A 2019-04-15 2019-04-15 A kind of method that static resource is saved and generated in document Pending CN110008182A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910299789.8A CN110008182A (en) 2019-04-15 2019-04-15 A kind of method that static resource is saved and generated in document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910299789.8A CN110008182A (en) 2019-04-15 2019-04-15 A kind of method that static resource is saved and generated in document

Publications (1)

Publication Number Publication Date
CN110008182A true CN110008182A (en) 2019-07-12

Family

ID=67171843

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910299789.8A Pending CN110008182A (en) 2019-04-15 2019-04-15 A kind of method that static resource is saved and generated in document

Country Status (1)

Country Link
CN (1) CN110008182A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765068A (en) * 2019-09-20 2020-02-07 数字视觉云(北京)科技发展有限公司 Maya file processing method, device, terminal and storage medium
CN111124539A (en) * 2019-12-20 2020-05-08 腾讯科技(深圳)有限公司 Initial scene resource file searching method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978277A (en) * 2015-07-30 2015-10-14 北京百度网讯科技有限公司 Method for debugging page, terminal and server
CN106294493A (en) * 2015-06-08 2017-01-04 腾讯科技(深圳)有限公司 Realize the method and device of document format conversion
CN107704464A (en) * 2016-08-08 2018-02-16 北京国双科技有限公司 Parse the method and device in the path of static resource

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294493A (en) * 2015-06-08 2017-01-04 腾讯科技(深圳)有限公司 Realize the method and device of document format conversion
CN104978277A (en) * 2015-07-30 2015-10-14 北京百度网讯科技有限公司 Method for debugging page, terminal and server
CN107704464A (en) * 2016-08-08 2018-02-16 北京国双科技有限公司 Parse the method and device in the path of static resource

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
AD-SI: "Add flag to set root path", 《GITHUB》 *
SOMENXAVIER: "pandoc-filters:change relative paths to absolute paths", 《STACK OVERFLOW》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765068A (en) * 2019-09-20 2020-02-07 数字视觉云(北京)科技发展有限公司 Maya file processing method, device, terminal and storage medium
CN110765068B (en) * 2019-09-20 2022-10-11 数字视觉云(北京)科技发展有限公司 Maya file processing method, device, terminal and storage medium
CN111124539A (en) * 2019-12-20 2020-05-08 腾讯科技(深圳)有限公司 Initial scene resource file searching method, device, equipment and storage medium
CN111124539B (en) * 2019-12-20 2023-08-15 腾讯科技(深圳)有限公司 Initial scene resource file searching method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US9038022B2 (en) Universal and adaptive software development platform for data-driven applications
US6763343B1 (en) Preventing duplication of the data in reference resource for XML page generation
Sahuguet et al. Wysiwyg web wrapper factory (w4f)
CN100489774C (en) Structured code automatic configuration method and device
US20040015840A1 (en) Mechanism for converting between JAVA classes and XML
CN103778107A (en) Method and platform for quickly and dynamically generating form based on EXCEL
US20090112901A1 (en) Software, Systems and Methods for Modifying XML Data Structures
CN101968817A (en) Method for configuring webpage template
CN105786788B (en) A kind of method and apparatus using WORD Program Generating lists
CN110008182A (en) A kind of method that static resource is saved and generated in document
CN107766107A (en) The analytic method of xml document universal parser based on Xpath language
CN109445773A (en) A kind of language based on programming promotes the method and electronic equipment of browser performance
Feyer et al. Design of data-intensive web-based information services
Panić et al. Fuzzy XML and prioritized fuzzy XQuery with implementation
CN102420862B (en) A kind of Internet of things middleware message form conversion method
CN101894299A (en) Fast freight departure and entry intelligent declaration system capable of supporting RFID and HS coding and image processing
CN109190069A (en) A kind of web page element modality management method, apparatus and electronic equipment
CN104573053A (en) Configuration item template dynamic customizing method based on XML
US6684386B1 (en) Method for converting a UML rendering of an RSM-based metamodel to a UML rendering of MOF-based metamodel
Day et al. Introduction to the Darwin Information Typing Architecture
Ramalho et al. Metamorphosis–a topic maps based environment to handle heterogeneous information resources
KR102429530B1 (en) The realtime intelligent P&amp;ID searching method based on mobile for managing effecive plant operation
CN100416464C (en) Information processor, information processing method and medium
Rajugan et al. Semantic modeling of e-solutions using a view formalism with conceptual & logical extensions
CN100573516C (en) Dummy machine system and the method for utilizing this system to execute instruction

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190712