Document processing method and device and storage medium
By providing component editing area and component preview area in the document editing interface, the problems of inefficient document editing and uncontrollable document quality in the prior art are solved, and more efficient document editing and better user experience are achieved.
Patent Information
- Application Number
- CN202311869523.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
In the prior art, the editing language of the document editor is complex and the experience is poor, resulting in low efficiency of developers, excessive labor costs, and uncontrollable document quality.
A document processing method is provided, in which the client loads the target component in the editing interface of the document page in response to the selection instruction of the target component in the preset component library, displays the component editing area and the component preview area, and updates the target component in the component preview area according to the editing instructions. Generate description data and dependency information of the document page, and generate web page files based on these data for display.
It improves the convenience and intuitiveness of document editing, improves document quality, reduces labor costs, and improves user experience.
Smart Images

Figure CN120234482A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the technical fields of computers and network communications, and in particular, to a document processing method, device, and storage medium. Background Art
[0002] As development technologies become more and more mature, various software or web-based business systems are continuously developed, providing more convenience for users' work and study. To help users better understand and utilize the functions of software or systems, online document pages such as help documents (such as user guides, user operation manuals) and technical documents are usually provided for users.
[0003] Developers can use some existing publishing platforms to provide editors for editing document pages such as help documents and technical documents. However, the editing languages of the editors of these publishing platforms are complex and the experience is poor. Developers usually write documents using document editing software and then migrate the document content to the publishing platform and then adjust the format, resulting in low efficiency, high labor costs, and uncontrollable document quality. Summary of the Invention
[0004] Embodiments of the present disclosure provide a document processing method, device, and storage medium to improve document editing efficiency, reduce labor costs, and enhance user experience.
[0005] In a first aspect, embodiments of the present disclosure provide a document processing method, which is applied to a client, and the method includes:
[0006] In response to a selection instruction for a target component in a preset component library, load the target component in an editing interface of a document page, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area; wherein the preset component library includes a plurality of preset components, and any preset component includes preset interface elements;
[0007] In response to an editing instruction for the target component in the component editing area and / or in the component preview area, update the target component displayed in the component preview area;
[0008] In response to a document page save instruction, generate description data of the document page and dependency information; wherein the description data is used to describe the configuration information of all components included in the document page, and the dependency information includes the storage paths of script language files of all components included in the document page;
[0009] In response to a document display instruction, obtain a web page file corresponding to the document page according to the description data and dependency information of the document page, and display the web page file corresponding to the document page.
[0010] According to one or more embodiments of the present disclosure, updating the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area includes:
[0011] In response to an editing instruction for the target component in the component editing area, modifying preset attributes of the target component displayed in the component editing area;
[0012] Updating the script language file in the component preview area with the modified preset attributes, and updating the target component displayed in the component preview area according to the updated script language file in the component preview area.
[0013] According to one or more embodiments of the present disclosure, updating the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area includes:
[0014] In response to an instruction to add an interface element to the target component in the component preview area, displaying the added interface element in the target component in the component preview area; and / or
[0015] In response to an instruction to move an interface element of the target component in the component preview area, moving the interface element in the target component in the component preview area.
[0016] According to one or more embodiments of the present disclosure, generating description data and dependency information for a document page includes:
[0017] Generating description data for the document page using a preset description language according to configuration information of each component included in the document page;
[0018] Generating dependency information for the document page according to routing information of the document page and storage paths of script language files of components included in the document page.
[0019] According to one or more embodiments of the present disclosure, obtaining a web page file corresponding to the document page according to the description data and dependency information of the document page includes:
[0020] Sending a rendering request to a server so that the server renders according to the description data and dependency information of the document page to generate a web page file corresponding to the document page;
[0021] Receiving the web page file corresponding to the document page returned by the server.
[0022] According to one or more embodiments of the present disclosure, displaying the web page file corresponding to the document page includes:
[0023] Performing a page jump according to the routing information corresponding to the document page;
[0024] Loading the dependency information of the document page according to the web page file corresponding to the document page, obtaining the description data of the document page, and rendering the document page.
[0025] According to one or more embodiments of the present disclosure, loading the dependency information of the document page according to the web page file corresponding to the document page includes:
[0026] Checking, according to the web page file corresponding to the document page, whether there is missing dependency information of the dependency information of the document page relative to the globally loaded dependency information of the affiliated site;
[0027] If it is determined that there is missing dependency information, then loading the missing dependency information.
[0028] According to one or more embodiments of the present disclosure, before loading the target component in the editing interface of the document page, it further includes:
[0029] Responding to an editing instruction for a preset component template, creating the target component on the basis of the preset component template, and generating a script language file for the component editing area corresponding to the target component, a script language file for the component preview area, and a script language file for component rendering on the server side;
[0030] Storing the target component in the preset component library.
[0031] According to one or more embodiments of the present disclosure, loading the target component in the editing interface of the document page so that the component editing area and the component preview area corresponding to the target component are displayed in the editing interface includes:
[0032] Obtaining the script language file for the component editing area and the script language file for the component preview area corresponding to the target component;
[0033] Rendering the script language file for the component editing area and the script language file for the component preview area respectively, so that the component editing area and the component preview area corresponding to the target component are displayed in the editing interface.
[0034] According to one or more embodiments of the present disclosure, the component editing area corresponding to the target component adopts a rich text editor.
[0035] Second aspect, an embodiment of the present disclosure provides a document processing method, which is applied to a server, and the method includes:
[0036] Obtain the description data and dependency information of the document page to be rendered, where the description data and dependency information of the document page are generated by the client after editing the target component based on the component editing area and / or component preview area corresponding to the target component in the editing interface of the document page;
[0037] Generate a web page file corresponding to the document page according to the description data and dependency information of the document page;
[0038] Send the web page file corresponding to the document page to the client, so that the client can display the web page file corresponding to the document page.
[0039] According to one or more embodiments of the present disclosure, the generating a web page file corresponding to the document page according to the description data and dependency information of the document page includes:
[0040] Determine the configuration information of the document page according to the description data of the document page;
[0041] Determine the global configuration information of the site to which the document page belongs and the storage path of the script language file of the component included in the document page according to the dependency information of the document page;
[0042] Write the configuration information of the document page, the global configuration information of the site to which the document page belongs, and the storage path of the script language file of the component included in the document page into the web page file to obtain the web page file corresponding to the document page.
[0043] Third aspect, an embodiment of the present disclosure provides a document processing device, including:
[0044] A component loading unit, configured to load the target component in the editing interface of the document page in response to a selection instruction for the target component in a preset component library, so that the component editing area and component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area; where the preset component library includes a plurality of preset components, and any one of the preset components includes preset interface elements;
[0045] A component editing unit, configured to update the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area;
[0046] A page saving unit, configured to generate the description data and dependency information of the document page in response to a document page saving instruction;
[0047] A document display unit, configured to, in response to a document display instruction, obtain a web page file corresponding to the document page according to the description data and dependency information of the document page, and display the web page file corresponding to the document page.
[0048] In a fourth aspect, an embodiment of the present disclosure provides a document processing device, including:
[0049] An acquisition unit, configured to acquire the description data and dependency information of a document page to be rendered, where the description data and dependency information of the document page are generated after a target component is edited in a component editing area and / or a component preview area corresponding to the target component in an editing interface of the document page by a client;
[0050] A generation unit, configured to generate a web page file corresponding to the document page according to the description data and dependency information of the document page;
[0051] A sending unit, configured to send the web page file corresponding to the document page to the client, so that the client displays the web page file corresponding to the document page.
[0052] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;
[0053] The memory stores computer-executable instructions;
[0054] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the document processing method as described in the first aspect and various possible designs of the first aspect above.
[0055] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the document processing method as described in the first aspect and various possible designs of the first aspect above is implemented.
[0056] In a seventh aspect, an embodiment of the present disclosure provides a computer program product, including computer-executable instructions, and when a processor executes the computer-executable instructions, the document processing method as described in the first aspect and various possible designs of the first aspect above is implemented.
[0057] The document processing method, device, and storage medium provided by the embodiments of the present disclosure load a target component in the editing interface of a document page in response to a selection instruction for the target component in a preset component library, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area, where the preset component library includes multiple preset components, and any preset component includes preset interface elements; in response to an editing instruction for the target component in the component editing area and / or in the component preview area, update the target component displayed in the component preview area; in response to a document page save instruction, generate description data of the document page and dependency information, where the description data is used to describe the configuration information of all components included in the document page, and the dependency information includes the storage paths of the script language files of all components included in the document page; in response to a document display instruction, obtain a web page file corresponding to the document page according to the description data and the dependency information of the document page, and display the web page file corresponding to the document page. By providing a component editing area and a component preview area in the editing interface of the document page, document editing can be more convenient and intuitive, and the final display effect of the document page can also be displayed, which is beneficial to improving the document quality, improving the document editing efficiency, reducing the labor cost, and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following briefly introduces the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0059] Figure 1 It is a schematic diagram of an application scenario example of the document processing method provided by an embodiment of the present disclosure;
[0060] Figure 2 It is a schematic flowchart of the document processing method provided by an embodiment of the present disclosure;
[0061] Figure 3 It is a schematic diagram of the editing interface of the document page provided by an embodiment of the present disclosure;
[0062] Figure 4 It is a schematic flowchart of the document processing method provided by another embodiment of the present disclosure;
[0063] Figure 5 It is a structural block diagram of the document processing device provided by an embodiment of the present disclosure;
[0064] Figure 6 It is a structural block diagram of the document processing device provided by another embodiment of the present disclosure;
[0065] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0066] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0067] In the prior art, developers can use some existing publishing platforms to provide editors (such as markdown editors) to edit document pages such as help documents and technical documents. However, the editing languages of the editors (such as markdown editors) of these publishing platforms are complex and the experience is poor. Developers usually write documents using document editing software and then migrate the document content to the publishing platform and then adjust the format, resulting in low efficiency, high labor costs, and uncontrollable document quality.
[0068] To solve the above technical problems, an embodiment of the present disclosure provides a document processing method. By responding to a selection instruction for a target component in a preset component library by a client, the target component is loaded in an editing interface of a document page, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area; in response to an editing instruction for the target component in the component editing area and / or in the component preview area, the target component displayed in the component preview area is updated; in response to a document page save instruction, description data and dependency information of the document page are generated; in response to a document display instruction, a web page file corresponding to the document page is obtained according to the description data and the dependency information of the document page, and the web page file corresponding to the document page is displayed. By providing a component editing area and a component preview area in the editing interface of the document page, document editing can be more convenient and intuitive, and the final display effect of the document page can also be displayed, which is beneficial to improving the document quality, improving the document editing efficiency, reducing the labor cost, and enhancing the user experience.
[0069] The document processing method provided by the embodiment of the present disclosure can be applicable to, for example Figure 1The system shown includes a client and a server. A user can select a target component from a preset component library on the client. The client can load the target component in the editing interface of the document page, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area. The preset component library includes multiple preset components, and any preset component includes preset interface elements. Further, the user can edit the target component in the component editing area and / or in the component preview area, and the client can update the target component displayed in the component preview area. When the user saves the document page, the client can generate description data of the document page and dependency information. The description data is used to describe the configuration information of all components included in the document page, and the dependency information includes the storage paths of the script language files of all components included in the document page. When the user needs to display the document, the client can send a rendering request to the server. The server renders according to the description data and dependency information of the document page to generate a web page file corresponding to the document page (i.e., server-side rendering). Then the server returns the web page file corresponding to the document page to the client, and the client can display the web page file corresponding to the document page.
[0070] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0071] The document processing method of the present disclosure will be introduced in detail below with reference to specific embodiments.
[0072] Reference Figure 2 , Figure 2 is a schematic flowchart of a document processing method provided by an embodiment of the present disclosure. The method of this embodiment can be applied to a client. The document processing method includes:
[0073] S201. In response to a selection instruction for a target component in a preset component library, load the target component in the editing interface of the document page, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area.
[0074] In this embodiment, the document page to be edited may include but is not limited to online document pages such as help documents (such as user guides, user operation manuals), technical documents, etc.
[0075] In this embodiment, a preset component library can be provided. The preset component library includes some pre-designed components (or component templates) for users to select. The preset component library includes multiple preset components, and any one of the preset components includes preset interface elements. The preset interface elements include, but are not limited to, text, pictures, buttons, input boxes, videos, files, web pages, labels, etc. The specific content in the preset interface elements can be any content, and the user can edit and modify it later.
[0076] In addition, tools for developing components can also be provided. Users can use the tools for developing components to develop components. The development process can include template engineering, development testing, release plans, etc. Specifically, users can edit the preset component template. In response to the user's editing instruction for the preset component template, attribute modification can be performed on the basis of the preset component template, so as to create the required custom component. The final product of component development is the NPM (Node Package Manager, a NodeJS package management and distribution tool) package of the component, which specifically includes three parts: the script language file of the component editing area corresponding to the component, the script language file of the component preview area, and the script language file for server-side component rendering. The script language file of the component editing area is used to display the component editing area and edit the preset attributes of the component. The script language file of the component editing area can specifically be the Editor.js file. Optionally, a rich text editor can be used in the component editing area; the script language file of the component preview area is used to render the component in the preview area for the user to preview during the component editing process to achieve what you see is what you get. Optionally, the script language file of the component preview area adopts the index.js file; the script language file for server-side component rendering is used during server-side rendering (Server-Side Render, SSR). Optionally, the script language file for server-side component rendering adopts the min.js file.
[0077] Among them, the index.js file adopted by the script language file of the component preview area is mostly the same as the min.js file, but in some what-you-see-is-what-you-get scenarios, such as a rich text editor, the index.js file will contain the code for the editing part, and the min.js file only contains the code for the rendering part.
[0078] After the user completes the component creation, the created component can be stored in a preset component library. Specifically, the NPM package of the created component is pushed to the NPM package management and distribution tool for storage and management. Optionally, a material library management system can also be provided. The material library management system can call the NPM package management and distribution tool and provide, as an OpenAPI, the display and invocation of the components stored and managed by the NPM package management and distribution tool for the user. After the user completes the component creation, the created component can be pushed to the NPM package management and distribution tool for storage, and unpkg (unpkg is a static resource CDN service based on the npm registry that can quickly obtain and use any js package without installing any software or package) is triggered. Further, the information of the created component is pushed to the material library management system for the user to select the required target component in the material library management system.
[0079] In this embodiment, during the process of the user editing the document page, in response to the user's selection instruction for a target component in the preset component library, the information of the target component (such as the package address, component-related elements, etc.) can be obtained. Then, based on the information of the target component, the relevant code of the target component is pulled from the preset component library to load the target component in the editing interface of the document page, so that the component editing area and the component preview area corresponding to the target component are displayed in the editing interface of the document page, and the target component is displayed in the component preview area.
[0080] Among them, the script language file (Editor.js file) of the component editing area corresponding to the target component and the script language file (index.js file) of the component preview area can be obtained; the script language file of the component editing area and the script language file of the component preview area are respectively rendered so that the component editing area and the component preview area corresponding to the target component are displayed in the editing interface of the document page. The component editing area may include input boxes corresponding to preset attributes in the target component for editing the preset attributes, while the component preview area shows the current appearance of the target component after rendering.
[0081] In specific implementation, a loader can be used to dynamically pull the script language file (Editor.js file) of the component editing area and the script language file (index.js file) of the component preview area of the target component to the local, store the class reference of the component, then insert the information corresponding to the target component into the DSL (Domain-Specific Language) description data of the document page, and then control the page renderer to perform page rendering based on the DSL description data, thereby displaying the component editing area and the component preview area corresponding to the target component, as Figure 3 shown.
[0082] S202. In response to an editing instruction for the target component in the component editing area and / or in the component preview area, update the target component displayed in the component preview area.
[0083] In this embodiment, the component editing area can provide an editing function for the target component. In addition, the component preview area can also provide a component editing function, that is, the user can choose to edit the target component in the component editing area and / or in the component preview area. In response to the user's editing instruction for the target component, the target component displayed in the component preview area can be updated, so as to facilitate the user to preview the edited target component.
[0084] Optionally, when the user selects to edit the target component in the component editing area, in response to modifying the preset attributes of the target component displayed in the component editing area for the target component in the component editing area. For example, if the preset text content in the target component is "AAA", the preset text content "AAA" and the corresponding input box can be displayed in the component editing area (or the preset text content "AAA" is within the input box, and of course other arbitrary methods can also be used). The user can enter "BBB" in the input box to change the preset text content in the target component from "AAA" to "BBB". Further, update the script language file in the component preview area according to the modified preset attributes (or directly inject it into the page attributes of the text page), and update the target component displayed in the component preview area according to the updated script language file in the component preview area, so as to display the edited target component in the component preview area.
[0085] Optionally, when the user selects to edit the target component in the component preview area, some interface elements can be added and moved (such as dragging). The interface elements include but are not limited to text, pictures, videos, Markdown editors, buttons, files, web pages, labels, etc. Specifically, in response to an instruction to add an interface element to the target component in the component preview area, display the added interface element in the target component in the component preview area, that is, when the user adds a certain interface element in the component preview area, the added interface element can be directly displayed in the component preview area; and / or, in response to an instruction to move an interface element of the target component in the component preview area, move the interface element in the target component in the component preview area, that is, the user can move the interface element added in the component preview area, and of course other operations such as adjusting the size can also be performed. In this embodiment, the addition of interface elements to the target component and the movement of the interface elements in the component preview area can be realized based on the Dragable Model (dragging mode).
[0086] S203. In response to a document page save instruction, generate description data and dependency information of the document page.
[0087] In this embodiment, when the user finishes editing and saves the document page, description data and dependency information of the document page can be generated. The description data of the document page, that is, the DSL description data (page dsl) of the document page, can be used for the subsequent page renderer to perform the rendering process based on the description data of the document page (when all component packages on which the document page depends have been loaded). Optionally, the description data of the document page can be stored in the page library; while the dependency information is mainly the component package information on which the description data of the document page depends, and is delivered to the rendering side (server-side rendering) for use, that is, the storage path of the script language file of the components included in the document page (that is, the relative path of the min.js for rendering the components on the server side). The dependency information can ultimately be stored as the global information of the site (Site) in the site library of the site, and is used to dynamically reference the component package information required for server-side rendering and front-end route switching. In addition, the dependency information also includes the routing information of the document page, and the routing information of the document page is associated with the storage path of the script language file of the components included in the document page. Specifically, the dependency information can also be a json file, where the routing information field records the storage path of the script language file of the components included in the document page corresponding to the routing information, and is used to incrementally load the min.js packages that have not been loaded during route matching.
[0088] In other words, the description data of the document page actually describes which components are included in the current document page, while the dependency information is the storage path information of the min.js packages of each component included in the current document page.
[0089] In specific implementation, the description data (DSL description data) of the document page can be generated according to the configuration information of each component included in the document page using a preset description language (such as DSL language), where; the dependency information of the document page is generated according to the routing information of the document page and the storage path of the script language file of the components included in the document page.
[0090] S204. In response to the document display instruction, obtain the web page file corresponding to the document page according to the description data and dependency information of the document page, and display the web page file corresponding to the document page.
[0091] In this embodiment, after the user saves the document page, the document page can also be displayed in web page form. Specifically, in response to the user's document display instruction, the web page file (html file) corresponding to the document page can be obtained according to the description data and dependency information of the document page, and then the web page file (html file) can be displayed based on it.
[0092] Optionally, the client can send a rendering request to the server, so that the server can perform rendering based on the description data and dependency information of the document page to generate a web page file corresponding to the document page; then the server returns the web page file corresponding to the document page to the client.
[0093] Specifically, the rendering request can carry the routing information of the document page (which may include the domain name information of the affiliated site). The server can receive rendering requests sent by different clients, that is, the server actually undertakes the responsibility of a soft load. For the rendering request sent by the current client, the server can match the information of the site to which the current document page belongs from the site library (including site global information, and the global information includes the dependency information of the document page, that is, the storage path of the script language file of the components included in the document page), then match the corresponding document page in the site according to the routing information of the document page, and can also read the description data of the document page from the page library, and then generate a web page file (html file) corresponding to the document page based on the description data and dependency data of the document page. The process of generating the web page file corresponding to the document page can adopt any known server-side rendering technology (SSR). Server-side rendering mainly refers to dynamically splicing the html part according to the site information and page information. Whether to render the spa (single-page application) part is optional.
[0094] Optionally, the runtime bundle (such as the storage path of the min.js files of the navigation bar component and the search bar component), the bundle on which the document page depends (the storage path of the min.js files of the components included in the document page), the configuration information of the site, and the configuration information of the document page can be written into the html. Among them, the bundle is directly written as a link tag or a script tag according to the type, and the configuration information is written as json.
[0095] In addition, the server can also provide some API interfaces for the client side to call. For example, the API interface for reading the description data of the document page can be used to dynamically load the page when the client route switches; another example is the API interface of the CMS (Content Management System), which is used for some front-end components (such as document-related functions) to read dynamic data; another example is the API interface related to permissions and login, which is used to provide permission management (such as managing reading permissions and editing permissions), user login, etc.
[0096] Of course, the client can also obtain the web page file corresponding to the document page through other channels, such as browser-side rendering, etc., which will not be limited here.
[0097] After obtaining the web page file corresponding to the document page on the client side, the web page file corresponding to the document page can be displayed.
[0098] Optionally, when displaying the web page file corresponding to the document page, route jumping can be initiated, that is, page jumping is performed according to the route information corresponding to the document page, the dependency information of the document page is loaded according to the web page file corresponding to the document page, the description data of the document page is obtained, and the document page is rendered.
[0099] In this embodiment, the above display of the web page file is actually the runtime part. When initiating route jumping, a route is matched from the global information of the site that has been SSR-injected, and then the data dependencies of the document page are prepared, including loading the bundle on which the page depends and reading the description data (page dsl) of the document page from the page library. In addition, some loading effects (such as a loading progress bar) can be displayed at the same time, and then page rendering is performed to render the document page.
[0100] Optionally, in order to improve processing efficiency and reduce the time consumption, the incremental loading method can be used when loading the dependency information of the document page, that is, according to the web page file corresponding to the document page, it is checked whether there is missing dependency information in the dependency information of the document page relative to the globally loaded dependency information of the site to which it belongs. If it is determined that there is missing dependency information, the missing dependency information is loaded.
[0101] In this embodiment, when some global dependency information has been loaded for the site to which the document page belongs, for example, other pages of the site have been rendered and the dependency information of other pages has been loaded, and the current document page may have the same components as other pages, such as a navigation bar component, a search box component, etc., there is no need to load them again. It is only necessary to check which components in the current document page have not been loaded, and the missing dependency information can be determined. Then, only the missing dependency information needs to be loaded.
[0102] Based on the above embodiment, when checking whether there is missing dependency information, if it is determined that there is missing dependency information, the process of loading the missing dependency information can be executed in parallel with the process of obtaining the description data (page dsl) of the document page.
[0103] It should be noted that if the dependency information of the document page cannot be finally stored as the global information of the site, the process of loading the dependency information of the document page and the process of obtaining the description data of the document page need to be executed serially.
[0104] The document processing method provided by each of the above embodiments loads a target component in the editing interface of a document page in response to a selection instruction for the target component in a preset component library, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area; in response to an editing instruction for the target component in the component editing area and / or in the component preview area, updates the target component displayed in the component preview area; in response to a document page save instruction, generates description data and dependency information of the document page; in response to a document display instruction, obtains a web page file corresponding to the document page according to the description data and dependency information of the document page, and displays the web page file corresponding to the document page. By providing a component editing area and a component preview area in the editing interface of the document page, document editing can be more convenient and intuitive, and the final display effect of the document page can also be displayed, which is beneficial to improving the document quality, improving the document editing efficiency, reducing the labor cost, and enhancing the user experience.
[0105] Based on any of the above embodiments, the document processing method may further provide functions including but not limited to auditing, translation, reuse, versioning, etc. of the document page, and achieve an efficient full link from production, translation, collaboration to distribution for multi-terminal, multi-type, and multi-language documents, and finally produce an integrated document solution to achieve cost reduction and efficiency improvement in each process. The specific process can be implemented by any known method and will not be elaborated here.
[0106] Reference Figure 4 , Figure 4 is a schematic flowchart of the document processing method provided by an embodiment of the present disclosure. The method of this embodiment can be applied to a server. The document processing method includes:
[0107] S401. Obtain the description data and dependency information of the document page to be rendered, where the description data and dependency information of the document page are generated by the client based on the component editing area and / or the component preview area corresponding to the target component in the editing interface of the document page after editing the target component;
[0108] S402. Generate a web page file corresponding to the document page according to the description data and dependency information of the document page;
[0109] S403. Send the web page file corresponding to the document page to the client, so that the client displays the web page file corresponding to the document page.
[0110] The document processing method on the server side in this embodiment is mainly used for the process of obtaining the web page file corresponding to the document page in the above embodiment, that is, server-side rendering. The specific process can be referred to the above embodiment and will not be elaborated here.
[0111] Further, generating the web page file corresponding to the document page according to the description data and dependency information of the document page includes:
[0112] Determining the configuration information of the document page according to the description data of the document page;
[0113] Determining the global configuration information of the site to which the document page belongs and the storage path of the script language file of the components included in the document page according to the dependency information of the document page;
[0114] Writing the configuration information of the document page, the global configuration information of the site to which the document page belongs, and the storage path of the script language file of the components included in the document page into the web page file to obtain the web page file corresponding to the document page.
[0115] In addition, the server side can also provide some API interfaces for the client side to call. For example, the API interface for reading the description data of the document page can be used to dynamically load the page when the client route is switched; another example is the API interface of the CMS (Content Management System), which is used for some front-end components (such as document-related functions) to read dynamic data; another example is the API interface related to permissions and login, which is used to provide permission management (such as managing reading permissions and editing permissions), user login, etc.
[0116] In addition, the server side can also support functions such as auditing, translation, reuse, and versioning of document pages. For documents of multiple terminals, multiple types, and multiple languages, it can achieve an efficient full link from production, translation, collaboration to distribution, and finally produce an integrated document solution to achieve cost reduction and efficiency improvement in each process. The specific process can be implemented by any known method and will not be elaborated here.
[0117] Corresponding to the document processing method on the client side in the above embodiment, Figure 5 This is the structural block diagram of the document processing device provided by the embodiments of the present disclosure. For the sake of illustration, only the parts related to the embodiments of the present disclosure are shown. Referring to Figure 5 The document processing device 500 includes: a component loading unit 501, a component editing unit 502, a page saving unit 503, and a document display unit 504.
[0118] Among them, the component loading unit 501 is configured to, in response to a selection instruction for a target component in a preset component library, load the target component in the editing interface of the document page, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area; where the preset component library includes multiple preset components, and any preset component includes preset interface elements;
[0119] A component editing unit 502, configured to update the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area;
[0120] A page saving unit 503, configured to generate description data and dependency information of a document page in response to a document page saving instruction; wherein the description data is used to describe the configuration information of all components included in the document page, and the dependency information includes the storage paths of the script language files of all components included in the document page;
[0121] A document display unit 504, configured to obtain a web page file corresponding to the document page according to the description data and dependency information of the document page in response to a document display instruction, and display the web page file corresponding to the document page.
[0122] In one or more embodiments of the present disclosure, when the component editing unit 502 updates the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area, it is configured to:
[0123] In response to an editing instruction for the target component in the component editing area, modify preset attributes of the target component displayed in the component editing area;
[0124] Update the script language file of the component preview area with the modified preset attributes, and update the target component displayed in the component preview area according to the updated script language file of the component preview area.
[0125] In one or more embodiments of the present disclosure, when the component editing unit 502 updates the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area, it is configured to:
[0126] In response to an instruction to add an interface element to the target component in the component preview area, display the added interface element in the target component in the component preview area; and / or
[0127] In response to an instruction to move an interface element of the target component in the component preview area, move the interface element in the target component in the component preview area.
[0128] In one or more embodiments of the present disclosure, when the page saving unit 503 generates description data and dependency information of a document page, it is configured to:
[0129] Generate the description data of the document page by using a preset description language according to the configuration information of each component included in the document page;
[0130] Generate the dependency information of the document page according to the routing information of the document page and the storage path of the script language file of the component included in the document page.
[0131] In one or more embodiments of the present disclosure, when obtaining the web page file corresponding to the document page according to the description data and dependency information of the document page, the document display unit 504 is configured to:
[0132] Send a rendering request to the server, so that the server renders according to the description data and dependency information of the document page to generate the web page file corresponding to the document page;
[0133] Receive the web page file corresponding to the document page returned by the server.
[0134] In one or more embodiments of the present disclosure, when displaying the web page file corresponding to the document page, the document display unit 504 is configured to:
[0135] Perform page jumping according to the routing information corresponding to the document page;
[0136] Load the dependency information of the document page according to the web page file corresponding to the document page, obtain the description data of the document page, and render the document page.
[0137] In one or more embodiments of the present disclosure, when loading the dependency information of the document page according to the web page file corresponding to the document page, the document display unit 504 is configured to:
[0138] According to the web page file corresponding to the document page, check whether there is missing dependency information in the dependency information of the document page relative to the globally loaded dependency information of the affiliated site;
[0139] If it is determined that there is missing dependency information, load the missing dependency information.
[0140] In one or more embodiments of the present disclosure, the device further includes a material development unit 505, which is configured to:
[0141] In response to an editing instruction for a preset component template, create the target component on the basis of the preset component template, and generate a script language file for the component editing area, a script language file for the component preview area, and a script language file for server-side component rendering corresponding to the target component;
[0142] Store the target component into the preset component library.
[0143] In one or more embodiments of the present disclosure, when the component loading unit 501 loads the target component in the editing interface of the document page so that the component editing area and the component preview area corresponding to the target component are displayed in the editing interface, it is used for:
[0144] Obtain the script language file of the component editing area corresponding to the target component and the script language file of the component preview area;
[0145] Render the script language file of the component editing area and the script language file of the component preview area respectively, so that the component editing area and the component preview area corresponding to the target component are displayed in the editing interface.
[0146] In one or more embodiments of the present disclosure, a rich text editor is adopted for the component editing area corresponding to the target component.
[0147] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiments. The implementation principles and technical effects are similar, and will not be elaborated here.
[0148] Corresponding to the document processing method on the server side in the above embodiment, Figure 6 This is a structural block diagram of the document processing device provided in the embodiments of the present disclosure. For the sake of convenience of description, only the parts related to the embodiments of the present disclosure are shown. Referring to Figure 6 , the document processing device 600 includes: an obtaining unit 601, a generating unit 602, and a sending unit 603.
[0149] Among them, the obtaining unit 601 is used to obtain the description data and dependency information of the document page to be rendered, where the description data and dependency information of the document page are generated by the client after editing the target component based on the component editing area and / or the component preview area corresponding to the target component in the editing interface of the document page;
[0150] The generating unit 602 is used to generate a web page file corresponding to the document page according to the description data and dependency information of the document page;
[0151] The sending unit 603 is used to send the web page file corresponding to the document page to the client, so that the client can display the web page file corresponding to the document page.
[0152] In one or more embodiments of the present disclosure, when the generating unit 602 generates a web page file corresponding to the document page according to the description data and dependency information of the document page, it is used for:
[0153] Determine the configuration information of the document page according to the description data of the document page;
[0154] Determine the global configuration information of the site to which the document page belongs and the storage path of the script language file of the component included in the document page according to the dependency information of the document page;
[0155] Write the configuration information of the document page, the global configuration information of the site to which the document page belongs, and the storage path of the script language file of the component included in the document page into a web page file to obtain the web page file corresponding to the document page.
[0156] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here in this embodiment.
[0157] Refer to Figure 7 , which shows a schematic structural diagram of an electronic device 700 suitable for implementing the embodiments of the present disclosure. The electronic device 700 can be a terminal device or a server. Among them, the terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, abbreviated as PDA), tablet computers (Portable Android Device, abbreviated as PAD), portable multimedia players (Portable MediaPlayer, abbreviated as PMP), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitations to the functions and usage scopes of the embodiments of the present disclosure.
[0158] As Figure 7 shown, the electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (Read Only Memory, abbreviated as ROM) 702 or the program loaded from the storage device 708 into the random access memory (Random Access Memory, abbreviated as RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The input / output (I / O) interface 705 is also connected to the bus 704.
[0159] Typically, the following devices can be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 can allow the electronic device 700 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 7 the electronic device 700 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices can be alternatively implemented or had.
[0160] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above functions defined in the method of the embodiment of the present disclosure are executed.
[0161] It should be noted that the computer-readable medium described above in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. And in the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0162] The above computer-readable medium can be included in the above electronic device; or it can exist separately without being assembled into the electronic device.
[0163] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to execute the method shown in the above embodiments.
[0164] Computer program code for performing the operations of this disclosure may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0165] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0166] The units involved in the embodiments described in this disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases. For example, the first acquisition unit may also be described as "the unit for acquiring at least two Internet protocol addresses".
[0167] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and so on.
[0168] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0169] In a first aspect, according to one or more embodiments of the present disclosure, there is provided a document processing method, including:
[0170] In response to a selection instruction for a target component in a preset component library, load the target component in an editing interface of a document page, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area; wherein the preset component library includes a plurality of preset components, and any one of the preset components includes preset interface elements;
[0171] In response to an editing instruction for the target component in the component editing area and / or in the component preview area, update the target component displayed in the component preview area;
[0172] In response to a document page save instruction, generate description data of the document page and dependency information; wherein the description data is used to describe the configuration information of all components included in the document page, and the dependency information includes the storage paths of the script language files of all components included in the document page;
[0173] In response to a document display instruction, obtain a web page file corresponding to the document page according to the description data and dependency information of the document page, and display the web page file corresponding to the document page.
[0174] According to one or more embodiments of the present disclosure, the step of, in response to an editing instruction for the target component in the component editing area and / or in the component preview area, updating the target component displayed in the component preview area includes:
[0175] In response to an editing instruction for the target component in the component editing area, modify preset attributes of the target component displayed in the component editing area;
[0176] Update the script language file of the component preview area with the modified preset attributes, and update the target component displayed in the component preview area according to the updated script language file of the component preview area.
[0177] According to one or more embodiments of the present disclosure, updating the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area includes:
[0178] In response to an instruction to add an interface element to the target component in the component preview area, display the added interface element in the target component in the component preview area; and / or
[0179] In response to an instruction to move an interface element of the target component in the component preview area, move the interface element in the target component in the component preview area.
[0180] According to one or more embodiments of the present disclosure, generating the description data and dependency information of the document page includes:
[0181] Generate the description data of the document page using a preset description language according to the configuration information of each component included in the document page;
[0182] Generate the dependency information of the document page according to the routing information of the document page and the storage path of the script language file of the components included in the document page.
[0183] According to one or more embodiments of the present disclosure, obtaining the web page file corresponding to the document page according to the description data and dependency information of the document page includes:
[0184] Send a rendering request to the server so that the server renders according to the description data and dependency information of the document page to generate the web page file corresponding to the document page;
[0185] Receive the web page file corresponding to the document page returned by the server.
[0186] According to one or more embodiments of the present disclosure, displaying the web page file corresponding to the document page includes:
[0187] Perform a page jump according to the routing information corresponding to the document page;
[0188] Load the dependency information of the document page according to the web page file corresponding to the document page, obtain the description data of the document page, and render the document page.
[0189] According to one or more embodiments of the present disclosure, the web page file corresponding to the document page loads the dependency information of the document page, including:
[0190] Based on the web page file corresponding to the document page, check whether there is missing dependency information for the dependency information of the document page relative to the globally loaded dependency information of the affiliated site;
[0191] If it is determined that there is missing dependency information, load the missing dependency information.
[0192] According to one or more embodiments of the present disclosure, before loading the target component in the editing interface of the document page, it further includes:
[0193] In response to an editing instruction for a preset component template, create the target component based on the preset component template, and generate a script language file for the component editing area corresponding to the target component, a script language file for the component preview area, and a script language file for component rendering on the server side;
[0194] Store the target component in the preset component library.
[0195] According to one or more embodiments of the present disclosure, loading the target component in the editing interface of the document page so that the component editing area and the component preview area corresponding to the target component are displayed in the editing interface includes:
[0196] Obtain the script language file for the component editing area and the script language file for the component preview area corresponding to the target component;
[0197] Render the script language file for the component editing area and the script language file for the component preview area respectively, so that the component editing area and the component preview area corresponding to the target component are displayed in the editing interface.
[0198] According to one or more embodiments of the present disclosure, the component editing area corresponding to the target component uses a rich text editor.
[0199] In a second aspect, according to one or more embodiments of the present disclosure, a document processing method is provided, which is applied to a server side, and the method includes:
[0200] Obtain the description data and dependency information of the document page to be rendered, where the description data and dependency information of the document page are generated by the client based on the component editing area and / or the component preview area corresponding to the target component after editing the target component in the editing interface of the document page;
[0201] Generate a web page file corresponding to the document page according to the description data and dependency information of the document page;
[0202] Send the web page file corresponding to the document page to the client so that the client can display the web page file corresponding to the document page.
[0203] According to one or more embodiments of the present disclosure, the generating a web page file corresponding to the document page according to the description data and dependency information of the document page includes:
[0204] Determine the configuration information of the document page according to the description data of the document page;
[0205] Determine the global configuration information of the site to which the document page belongs and the storage path of the script language file of the components included in the document page according to the dependency information of the document page;
[0206] Write the configuration information of the document page, the global configuration information of the site to which the document page belongs, and the storage path of the script language file of the components included in the document page into the web page file to obtain the web page file corresponding to the document page.
[0207] In a third aspect, according to one or more embodiments of the present disclosure, a document processing device is provided, including:
[0208] A component loading unit, configured to load a target component in an editing interface of a document page in response to a selection instruction for the target component in a preset component library, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area; wherein the preset component library includes a plurality of preset components, and any preset component includes preset interface elements;
[0209] A component editing unit, configured to update the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area;
[0210] A page saving unit, configured to generate description data and dependency information of a document page in response to a document page saving instruction; wherein the description data is used to describe the configuration information of all components included in the document page, and the dependency information includes the storage paths of the script language files of all components included in the document page;
[0211] A document display unit, configured to obtain a web page file corresponding to the document page according to the description data and dependency information of the document page in response to a document display instruction, and display the web page file corresponding to the document page.
[0212] According to one or more embodiments of the present disclosure, when the component editing unit updates the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area, it is configured to:
[0213] In response to an editing instruction for the target component in the component editing area, modify the preset attributes of the target component displayed in the component editing area;
[0214] Update the script language file of the component preview area with the modified preset attributes, and update the target component displayed in the component preview area according to the updated script language file of the component preview area.
[0215] According to one or more embodiments of the present disclosure, when the component editing unit updates the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area, it is configured to:
[0216] In response to an instruction to add an interface element to the target component in the component preview area, display the added interface element in the target component in the component preview area; and / or
[0217] In response to an instruction to move an interface element of the target component in the component preview area, move the interface element in the target component in the component preview area.
[0218] According to one or more embodiments of the present disclosure, when the page saving unit generates the description data and dependency information of the document page, it is configured to:
[0219] Generate the description data of the document page by using a preset description language according to the configuration information of each component included in the document page;
[0220] Generate the dependency information of the document page according to the routing information of the document page and the storage path of the script language file of the components included in the document page.
[0221] According to one or more embodiments of the present disclosure, when the document display unit obtains the web page file corresponding to the document page according to the description data and dependency information of the document page, it is configured to:
[0222] Send a rendering request to the server so that the server renders according to the description data and dependency information of the document page to generate the web page file corresponding to the document page;
[0223] Receive the web page file corresponding to the document page returned by the server.
[0224] According to one or more embodiments of the present disclosure, when the document display unit displays the web page file corresponding to the document page, it is configured to:
[0225] Perform page jumping according to the routing information corresponding to the document page;
[0226] Load the dependency information of the document page according to the web page file corresponding to the document page, obtain the description data of the document page, and render the document page.
[0227] According to one or more embodiments of the present disclosure, when the document display unit loads the dependency information of the document page according to the web page file corresponding to the document page, it is configured to:
[0228] Check whether there is missing dependency information in the dependency information of the document page relative to the globally loaded dependency information of the affiliated site according to the web page file corresponding to the document page;
[0229] If it is determined that there is missing dependency information, load the missing dependency information.
[0230] According to one or more embodiments of the present disclosure, the device further includes a material development unit, which is configured to:
[0231] In response to an editing instruction for a preset component template, create the target component on the basis of the preset component template, and generate a script language file for the component editing area corresponding to the target component, a script language file for the component preview area, and a script language file for component rendering on the server side;
[0232] Store the target component in the preset component library.
[0233] According to one or more embodiments of the present disclosure, when the component loading unit loads the target component in the editing interface of the document page so that the component editing area and the component preview area corresponding to the target component are displayed in the editing interface, it is configured to:
[0234] Obtain the script language file for the component editing area and the script language file for the component preview area corresponding to the target component;
[0235] Render the script language file for the component editing area and the script language file for the component preview area respectively, so that the component editing area and the component preview area corresponding to the target component are displayed in the editing interface.
[0236] According to one or more embodiments of the present disclosure, the component editing area corresponding to the target component adopts a rich text editor.
[0237] Fourth aspect, according to one or more embodiments of the present disclosure, there is provided a document processing device, including:
[0238] An acquisition unit, configured to acquire description data and dependency information of a document page to be rendered, where the description data and dependency information of the document page are generated by a client after editing a target component based on a component editing area and / or a component preview area corresponding to the target component in an editing interface of the document page;
[0239] A generation unit, configured to generate a web page file corresponding to the document page according to the description data and dependency information of the document page;
[0240] A sending unit, configured to send the web page file corresponding to the document page to the client, so that the client displays the web page file corresponding to the document page.
[0241] According to one or more embodiments of the present disclosure, when generating the web page file corresponding to the document page according to the description data and dependency information of the document page, the generation unit is configured to:
[0242] Determine configuration information of the document page according to the description data of the document page;
[0243] Determine global configuration information of a site to which the document page belongs and a storage path of a script language file of a component included in the document page according to the dependency information of the document page;
[0244] Write the configuration information of the document page, the global configuration information of the site to which the document page belongs, and the storage path of the script language file of the component included in the document page into the web page file to obtain the web page file corresponding to the document page.
[0245] Fifth aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, including: at least one processor and a memory;
[0246] The memory stores computer-executable instructions;
[0247] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the document processing method described in the first aspect and various possible designs of the first aspect, or the document processing method described in the second aspect and various possible designs of the second aspect.
[0248] Sixth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the document processing method described in the first aspect above and all possible designs of the first aspect, or the document processing method described in the second aspect above and all possible designs of the second aspect.
[0249] Seventh aspect, according to one or more embodiments of the present disclosure, there is provided a computer program product including computer-executable instructions, which, when executed by a processor, implement the document processing method described in the first aspect above and all possible designs of the first aspect, or the document processing method described in the second aspect above and all possible designs of the second aspect.
[0250] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0251] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although a number of specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0252] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms for implementing the claims.
Claims
1. A document processing method, characterized in that, The method includes: In response to a selection instruction for a target component in a preset component library, loading the target component in an editing interface of a document page, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area; wherein the preset component library includes a plurality of preset components, and any one of the preset components includes preset interface elements; In response to an editing instruction for the target component in the component editing area and / or in the component preview area, updating the target component displayed in the component preview area; In response to a document page save instruction, generating description data of the document page and dependency information; wherein the description data is used to describe the configuration information of all components included in the document page, and the dependency information includes the storage paths of the script language files of all components included in the document page; In response to a document display instruction, obtaining a web page file corresponding to the document page according to the description data and dependency information of the document page, and displaying the web page file corresponding to the document page.
2. The method according to claim 1, wherein The updating the target component displayed in the component preview area in response to an editing instruction for the target component in the component editing area and / or in the component preview area includes: In response to an editing instruction for the target component in the component editing area, modifying preset attributes of the target component displayed in the component editing area; updating the script language file of the component preview area with the modified preset attributes, and updating the target component displayed in the component preview area according to the updated script language file of the component preview area; and / or In response to an instruction for adding an interface element to the target component in the component preview area, displaying the added interface element in the target component in the component preview area; and / or In response to an instruction for moving an interface element of the target component in the component preview area, moving the interface element in the target component in the component preview area.
3. The method according to claim 1, characterized in that, The obtaining the web page file corresponding to the document page according to the description data and dependency information of the document page includes: Sending a rendering request to a server, so that the server renders according to the description data and dependency information of the document page to generate a web page file corresponding to the document page; Receiving the web page file corresponding to the document page returned by the server.
4. The method according to claim 1, wherein The displaying the web page file corresponding to the document page includes: Performing a page jump according to the routing information corresponding to the document page; Loading the dependency information of the document page according to the web page file corresponding to the document page, obtaining the description data of the document page, and rendering the document page.
5. A document processing method, characterized in that, The method includes: Obtaining description data and dependency information of a document page to be rendered, wherein the description data and dependency information of the document page are generated by a client based on a component editing area and / or a component preview area corresponding to a target component during editing of the target component in an editing interface of the document page; Generate a web page file corresponding to the document page according to the description data and dependency information of the document page; Send the web page file corresponding to the document page to the client so that the client can display the web page file corresponding to the document page.
6. A document processing device, characterized in that, Including: A component loading unit, configured to, in response to a selection instruction for a target component in a preset component library, load the target component in an editing interface of a document page, so that a component editing area and a component preview area corresponding to the target component are displayed in the editing interface, and the target component is displayed in the component preview area; Wherein the preset component library includes a plurality of preset components, and any one of the preset components includes preset interface elements; A component editing unit, configured to, in response to an editing instruction for the target component in the component editing area and / or in the component preview area, update the target component displayed in the component preview area; A page saving unit, configured to, in response to a document page saving instruction, generate description data and dependency information of the document page; wherein the description data is used to describe configuration information of all components included in the document page, and the dependency information includes storage paths of script language files of all components included in the document page; A document display unit, configured to, in response to a document display instruction, obtain a web page file corresponding to the document page according to the description data and dependency information of the document page, and display the web page file corresponding to the document page.
7. A document processing device, characterized in that, Including: An obtaining unit, configured to obtain description data and dependency information of a document page to be rendered, wherein the description data and dependency information of the document page are generated after a client edits a target component based on a component editing area and / or a component preview area corresponding to the target component in an editing interface of the document page; A generating unit, configured to generate a web page file corresponding to the document page according to the description data and dependency information of the document page; A sending unit, configured to send the web page file corresponding to the document page to the client so that the client can display the web page file corresponding to the document page.
8. An electronic device, characterized in that, Including: At least one processor and a memory; The memory stores computer execution instructions; The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the method according to any one of claims 1-5.
9. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the processor executes the computer execution instructions, the method according to any one of claims 1-5 is implemented.
10. A computer program product, characterized in that, Including computer execution instructions, and when the processor executes the computer execution instructions, the method according to any one of claims 1-5 is implemented.
Citation Information
Cited By
Page display method and device
CN121636841A
Method and device for generating law related information, computer readable medium and electronic equipment
CN122263809A