Document generation method, device, electronic device and storage medium
By adding template common components and configuring preset template codes in the code editing interface, the target document is generated, which solves the problems of high document creation threshold, poor coupling and inflexible update in the existing technology, and achieves efficient and flexible document generation and renew.
Patent Information
- Application Number
- CN202210434872.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-24
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2042-04-24
AI Technical Summary
The existing technology has problems such as high creation threshold, inability to effectively couple with the front-end framework, and can only be fully updated when creating documents.
By displaying the code editing interface, add template common components, configure the preset template code, generate the target template code, parse the code, and generate the target document.
It reduces the threshold for generating documents, realizes effective coupling with the front -end framework, and supports custom editors on demand, which improves the flexibility of document updates.
Smart Images

Figure CN115048919B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a document generation method, a document generation device, an electronic device and a computer-readable storage medium. Background Art
[0002] In modern office, it is often necessary to report, summarize, and display work through various types of presentation documents, including Word documents, Excel documents, and Powerpoint documents. For example, for Powerpoint, it can create presentations, and can also hold face-to-face meetings, remote meetings, or show presentations to audiences online. PPT can include text, pictures, charts, animations, sounds, videos, and other content. By editing a PPT that meets the corresponding demand scenario, the corresponding content can be effectively displayed. However, the document creation process is very cumbersome and complicated, and it has a certain threshold for non-professionals. In the relevant technology, documents can be created through Json arrays, but in this process, the staff is required to be particularly familiar with the structural format of the Json array, there is a certain processing threshold, and based on the Json array, it cannot be well coupled with the front-end framework, and a full update is required, which increases the workload of the staff. Summary of the invention
[0003] The embodiments of the present invention provide a document generation method, device, electronic device and computer-readable storage medium to solve or partially solve the problems in the related art of creating documents, such as the existence of a creation threshold, the inability to effectively couple with the front-end framework and the ability to only update in full.
[0004] The embodiment of the present invention discloses a method for generating a document, comprising:
[0005] In response to a file creation instruction, displaying a code editing interface corresponding to the file creation instruction;
[0006] In response to a template adding operation on the code editing interface, adding a template general component corresponding to the template adding operation in the code editing interface, the template general component including a plurality of preset template codes;
[0007] In response to a configuration operation on the preset template code, determining at least one template code to be configured and an attribute code for the template code to be configured, adding the attribute code to the template code to be configured, and generating a target template code corresponding to the template code to be configured;
[0008] Code parsing is performed on the preset template code that is not configured in the code editing interface and the configured target template code to generate a first target document corresponding to the file creation instruction.
[0009] Optionally, it also includes:
[0010] The preset template code and / or the target template code, and the first target document are displayed in the code editing interface.
[0011] Optionally, in response to the configuration operation on the preset template code, determining at least one template code to be configured and an attribute code for the template code to be configured, adding the attribute code to the template code to be configured, and generating a target template code corresponding to the template code to be configured, including:
[0012] In response to a document attribute configuration operation for the preset template code, determining at least one template code to be configured and a document attribute code for the template code to be configured, and adding the document attribute code to the template code to be configured, generating a first target template code corresponding to the template code to be configured;
[0013] The document attribute code includes at least one or more codes of document type, document name, document page number, and class name.
[0014] Optionally, in response to the configuration operation on the preset template code, determining at least one template code to be configured and an attribute code for the template code to be configured, adding the attribute code to the template code to be configured, and generating a target template code corresponding to the template code to be configured, further includes:
[0015] In response to a style attribute configuration operation on the first target template code, obtaining a style attribute code corresponding to the style attribute configuration operation, and adding the style attribute code to the first target template code to generate a second target template code corresponding to the first target template code;
[0016] The style attribute code includes at least one or more codes for representing width attribute, height attribute, display type, container attribute, font attribute, color attribute, and background attribute.
[0017] Optionally, in response to the configuration operation on the preset template code, determining at least one template code to be configured and an attribute code for the template code to be configured, adding the attribute code to the template code to be configured, and generating a target template code corresponding to the template code to be configured, including:
[0018] In response to the style attribute configuration operation for the preset template code and / or the target template code, at least one template code to be configured and a style attribute code for the template code to be configured are determined, and the style attribute code is added to the template code to be configured to generate a third target template code corresponding to the template code to be configured.
[0019] Optionally, parsing the preset template code that is not configured in the code editing interface and the configured target template code to generate a first target document corresponding to the file creation instruction includes:
[0020] Perform code mapping on the preset template code that is not configured in the code editing interface and the configured target template code to generate a Json array;
[0021] In response to the document generation instruction for the code editing interface, the Json array is used to generate a first target document corresponding to the file creation instruction.
[0022] Optionally, it also includes:
[0023] In response to a document editing instruction, acquiring a second target document corresponding to the document editing instruction and a document code in the second target document corresponding to the document editing instruction;
[0024] Displaying the document code in the code editing interface;
[0025] In response to an editing operation on the document code, the second target document is updated according to the editing operation.
[0026] Optionally, the second target document includes a plurality of document pages, and before responding to the editing operation on the document code and updating the second target document according to the editing operation, the method further includes:
[0027] Displaying the second target document in the code editing interface;
[0028] The step of responding to the editing operation on the document code and updating the second target document according to the editing operation includes:
[0029] In response to a content selection operation on the second target document, determining a target document page corresponding to the content selection operation, and locating a page code corresponding to the content selection operation in the target document page in the target code;
[0030] In response to an editing operation on the page code, the second target document is updated according to the editing operation.
[0031] Optionally, in response to the file creation instruction, displaying a code editing interface corresponding to the file creation instruction includes:
[0032] In response to the file creation instruction, an online editing page is started, wherein the online editing page includes a plurality of different environment compilers, each of which corresponds to a preset code editing environment;
[0033] In response to a selection operation on the environment compiler, a target environment compiler corresponding to the selection operation is determined, a target code editing environment corresponding to the target environment compiler is added to the online editing page, and a code editing interface corresponding to the target code editing environment is displayed.
[0034] The embodiment of the present invention also discloses a document generation device, comprising:
[0035] An editing interface display module, used to respond to a file creation instruction and display a code editing interface corresponding to the file creation instruction;
[0036] A general component adding module, configured to respond to a template adding operation on the code editing interface and add a template general component corresponding to the template adding operation in the code editing interface, wherein the template general component includes a plurality of preset template codes;
[0037] A template code configuration module, configured to determine, in response to a configuration operation on the preset template code, at least one template code to be configured and an attribute code for the template code to be configured, and add the attribute code to the template code to be configured, and generate a target template code corresponding to the template code to be configured;
[0038] The target document generation module is used to parse the preset template code that is not configured in the code editing interface and the configured target template code to generate a first target document corresponding to the file creation instruction.
[0039] Optionally, it also includes:
[0040] A content display module is used to display the preset template code and / or the target template code, and the first target document in the code editing interface.
[0041] Optionally, the template code configuration module includes:
[0042] A document attribute adding submodule, for determining at least one template code to be configured and a document attribute code for the template code to be configured in response to a document attribute configuration operation for the preset template code, and adding the document attribute code to the template code to be configured to generate a first target template code corresponding to the template code to be configured;
[0043] The document attribute code includes at least one or more codes of document type, document name, document page number, and class name.
[0044] Optionally, the template code configuration module further includes:
[0045] a style attribute adding submodule, configured to respond to a style attribute configuration operation on the first target template code, obtain a style attribute code corresponding to the style attribute configuration operation, and add the style attribute code to the first target template code to generate a second target template code corresponding to the first target template code;
[0046] The style attribute code includes at least one or more codes for representing width attribute, height attribute, display type, container attribute, font attribute, color attribute, and background attribute.
[0047] Optionally, the template code configuration module is specifically used to:
[0048] In response to the style attribute configuration operation for the preset template code and / or the target template code, at least one template code to be configured and a style attribute code for the template code to be configured are determined, and the style attribute code is added to the template code to be configured to generate a third target template code corresponding to the template code to be configured.
[0049] Optionally, the target document generation module includes:
[0050] A Json array generation submodule, used for performing code mapping between the unconfigured preset template code and the configured target template code in the code editing interface to generate a Json array;
[0051] The document generation submodule is used to respond to the document generation instruction for the code editing interface and use the Json array to generate a first target document corresponding to the file creation instruction.
[0052] Optionally, the device further comprises:
[0053] A document editing module, configured to, in response to a document editing instruction, obtain a second target document corresponding to the document editing instruction and a document code in the second target document corresponding to the document editing instruction;
[0054] A document code display module, used to display the document code in the code editing interface;
[0055] The document updating module is used to respond to the editing operation on the document code and update the second target document according to the editing operation.
[0056] Optionally, the second target document includes a plurality of document pages, and the device further includes:
[0057] A document display module, configured to display the second target document in the code editing interface before the document updating module responds to an editing operation on the document code and updates the second target document according to the editing operation;
[0058] The document update module is specifically used for:
[0059] In response to a content selection operation on the second target document, determining a target document page corresponding to the content selection operation, and locating a page code corresponding to the content selection operation in the target document page in the target code;
[0060] In response to an editing operation on the page code, the second target document is updated according to the editing operation.
[0061] Optionally, the editing interface display module is specifically used for:
[0062] In response to the file creation instruction, an online editing page is started, wherein the online editing page includes a plurality of different environment compilers, each of which corresponds to a preset code editing environment;
[0063] In response to a selection operation on the environment compiler, a target environment compiler corresponding to the selection operation is determined, a target code editing environment corresponding to the target environment compiler is added to the online editing page, and a code editing interface corresponding to the target code editing environment is displayed.
[0064] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0065] The memory is used to store computer programs;
[0066] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0067] The embodiment of the present invention further discloses one or more computer-readable storage media, on which instructions are stored, and when executed by one or more processors, the processors execute the method as described in the embodiment of the present invention.
[0068] The embodiments of the present invention include the following advantages:
[0069] In an embodiment of the present invention, when creating a related document, a terminal for creating a document can respond to a file creation instruction and display a code editing interface corresponding to the file creation instruction. Then, it can respond to a template adding operation for the code editing interface and add a template general component corresponding to the template adding operation in the code editing interface. The template general component may include several preset template codes. For the preset template code, a personalized configuration operation can be performed on it. The terminal determines the preset template code for personalized configuration and the attribute code for the preset template code for personalized configuration according to the developer's operation, and adds the attribute code to the corresponding preset template code to generate a personalized target template code. After the configuration is completed, the code can be parsed for the template code that has not been personalized configured and the template code that has been personalized configured in the code editing interface to generate the corresponding first target document. Therefore, by creating a document from the code level in the code editing interface, effective coupling with the front-end framework is achieved. At the same time, the document is edited and created from the code level, which effectively lowers the threshold for document generation. It also supports local or global custom editing of preset template components on demand, thereby improving the flexibility of document updates. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 is a flowchart of a method for generating a document provided in an embodiment of the present invention;
[0071] Figure 2 is a structural block diagram of a document generation device provided in an embodiment of the present invention;
[0072] Figure 3 It is a block diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0073] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0074] As an example, the document creation process is very cumbersome and complicated, requiring relevant personnel to master skills such as typesetting, editing, and content design, which has a certain threshold. In this regard, in the relevant technology, documents can be created through Json arrays, which can be suitable for code developers, but in this process, developers are required to be particularly familiar with the structure of Json arrays, and the document creation process based on Json arrays does not support dynamic generation of Json arrays at the code level, and cannot be well coupled with the front-end framework. When the document needs to be updated, it can only be fully updated by re-editing the Json array, which greatly increases the workload of relevant personnel.
[0075] In this regard, one of the core invention points of the embodiment of the present invention is to create and edit documents from the code level based on target code editing, and to display a code editing interface corresponding to the file creation instruction by responding to the file creation instruction input by the developer. In the code editing interface, the developer can perform code editing to achieve document creation, editing, etc. The terminal can respond to the template adding operation for the code editing interface, and add a template general component corresponding to the template adding operation in the code editing interface. The template general component may include several preset template codes, and the preset template code may be personalized configured. Then, the terminal determines the preset template code to be personalized configured according to the developer's operation. and the attribute code for the preset template code for personalized configuration, and add the attribute code to the corresponding preset template code to generate the target template code for personalized configuration. After the configuration is completed, the template code that has not been personalized configured and the template code that have been personalized configured in the code editing interface can be parsed to generate the corresponding first target document, thereby creating the document at the code level on the code editing interface based on the target code editing environment, thereby achieving effective coupling with the front-end framework, and editing and creating the document at the code level, effectively lowering the threshold for document generation, and supporting local or global custom editing of preset template components on demand, thereby improving the flexibility of document updates.
[0076] In order to enable those skilled in the art to better understand the technical solutions of the embodiments of the present invention, some technical terms involved in the embodiments of the present invention are explained and described below:
[0077] React is a JavaScript library for building developer interfaces. Developers can pass various types of parameters in React, such as declaring code, rendering developer interfaces, static HTML DOM elements, passing dynamic variables, and interactive application components.
[0078] Documents, which may include Word documents, Excel documents, and Powerpoint documents, etc.
[0079] Jsx, which can be a syntax extension of JavaScript, can well describe the essential form of interaction that should be presented by the developer interface from the code level.
[0080] Json, which can be JavaScript Object Notation, is a lightweight text data exchange format that can be used to store and exchange text information.
[0081] Optionally, in an embodiment of the present invention, it can be applied to a React environment (React code editing environment), by running a corresponding online compiler (such as Codesandbox, etc.) in a terminal, configuring the React environment, then writing Jsx code online in the React environment, and then converting the Jsx code into a corresponding Json array, and then creating a corresponding document based on the Json array, thereby achieving document creation at the code level. It should be noted that documents can also be generated by code editing in other development environments (code editing environments) outside the React environment, and the present invention does not limit this.
[0082] Specifically, refer to Figure 1 , shows a flowchart of a method for generating a document provided in an embodiment of the present invention, which may specifically include the following steps:
[0083] Step 101, in response to a file creation instruction, displaying a code editing interface corresponding to the file creation instruction;
[0084] The file creation instruction may be an instruction for configuring a development environment for generating documents. Specifically, the terminal may respond to the file creation instruction and start an online editing page, which includes several different environment compilers, each of which corresponds to a preset code editing environment. Then, in response to a selection operation for the environment compiler, the terminal may determine a target environment compiler corresponding to the selection operation, add a target code editing environment corresponding to the target environment compiler to the online editing page, and display a code editing interface corresponding to the target code editing environment, so that the developer can perform code editing in the code editing interface to generate the corresponding document.
[0085] Among them, for the online editing page, it can be an environment user interface for development, including the environment general interface and the interfaces of various environment compilers and tools that are uniformly controlled by it. Each environment compiler can correspond to a development environment, such as Next.js, Nuxt2, Node.Js, JavaScript, TypeScript, React, Vue, Static and other development environments (i.e., code editing environments). Developers can select the corresponding environment compiler in the online editing page according to actual development needs to configure the corresponding development environment in the page. Optionally, for the online editing page, it can be an editing page presented after the corresponding development software is installed locally and then running the development software locally, or it can be an editing page opened by a browser corresponding to the environment user interface (i.e., the interface corresponding to the online editing page). The former can realize local online or offline editing, and the latter can realize browser online editing. The present invention does not limit this.
[0086] In one example, the developer can run the corresponding online editing page in the terminal, and different environment compilers can be provided in the online editing page. For example, the developer can select Codesandbox to configure the React environment. After the configuration is completed, the terminal can display the corresponding code editing interface in the page so that the developer can write Jsx code in the React environment. In addition, when code editing is required in other development environments, other compilers can be selected in the page to configure another corresponding development environment, and the present invention is not limited to this.
[0087] Step 102, in response to a template adding operation on the code editing interface, adding a template general component corresponding to the template adding operation in the code editing interface, wherein the template general component includes a plurality of preset template codes;
[0088] In the embodiment of the present invention, for the creation of a document, the developer can design the document template by himself, or can perform personalized configuration through an existing document template. For the personalized configuration through an existing document template, the terminal can respond to the template adding operation for the code editing interface, and add the corresponding template general component in the code editing interface. Among them, the template general component can include a number of preset template codes, each of which can be a set of skin components, which can essentially be a set of CSS (Cascading Style Sheet) codes.
[0089] For the preset template code, developers can choose to directly apply it for document generation, or perform corresponding code configuration in the preset template code to achieve personalized configuration. Among them, for the template common component, the enumeration value of its component parameter type can be the value corresponding to different preset template codes, for example, template1, template2, and template3, etc. For a preset template code, it can be as follows:
[0090]
[0091] Among them, n can be used to represent the nth preset template code, so for the template common components, developers can perform personalized configuration as needed. At the same time, in the code editing interface, on the one hand, the code writing status in the React environment can be displayed, and on the other hand, the document display status corresponding to the preset template code can be displayed, so that developers can understand the document layout while writing code to ensure the quality of the document.
[0092] Step 103, in response to the configuration operation for the preset template code, determining at least one template code to be configured and an attribute code for the template code to be configured, and adding the attribute code to the template code to be configured to generate a target template code corresponding to the template code to be configured;
[0093] In a specific implementation, for the preset template code, developers can perform personalized attribute code configuration according to actual needs, and add the attribute code to the corresponding preset template code to realize personalized configuration of the document template. Among them, the personalized configuration of the preset template code can include personalized configuration of document attributes, personalized configuration of style attributes, etc. The personalized configuration of document attributes can include personalized configuration of one or more of document type, document name, document page number, class name, etc.; style attributes can include personalized configuration of one or more of width attribute, height attribute, display type, container attribute, font attribute, color attribute, background attribute, etc., so that developers can perform personalized editing of documents from the code level according to actual needs after determining the preset template code. Compared with directly creating documents through Json arrays, the editing threshold at the code level is lower, especially for non-professional document designers such as code developers. "Code writing" is a tool familiar to code developers. Code developers can create documents through this tool, which greatly reduces the threshold for document creation.
[0094] In an optional embodiment, the developer can only configure the document attributes of the preset template code, and the terminal can determine at least one template code to be configured and a document attribute code for the template code to be configured in response to the document attribute configuration operation for the preset template code, and add the document attribute code to the template code to be configured to generate a first target template code corresponding to the template code to be configured. The document attribute code includes at least one or more codes of the document type, document name, document page number, and class name.
[0095] Optionally, the document type may include the file type of the document, such as doc, docx, xls, xlsx, ppt, pptx, etc.; the document name may be the file name of the document created by the developer; the document page may be the page number of the preset template code in the document; the class name may be the data identifier of the referenced data, etc.
[0096] In another optional embodiment, after configuring the document attributes of the preset template code, the developer can also configure the style attributes, and the terminal can respond to the style attribute configuration operation for the first target template code, obtain the style attribute code corresponding to the style attribute configuration operation, and add the style attribute code to the first target template code to generate a second target template code corresponding to the first target template code. The style attribute code includes at least one or more codes for representing the width attribute, height attribute, display type, container attribute, font attribute, color attribute, and background attribute.
[0097] Optionally, the width attribute can be the width of the document display; the height attribute can be the height of the document display; the display type can be the document adaptive display type (adaptive adjustment according to width, height, width and height, etc.); the container attribute can define the alignment of the content on the main axis; the font attribute can define the font display size and dimensions of the text content in the document; the color attribute can define the display color of the content in the document; the background attribute can define the display background of the document, etc.
[0098] In another optional embodiment, the developer may use the content of the preset template code by default and only configure the display style of the preset template code, or after personalizing some of the preset template codes in the above manner to obtain the target template code, configure the display style for the unchanged preset template code and the modified target template code. The terminal may determine at least one template code to be configured and a style attribute code for the template code to be configured in response to the style attribute configuration operation for the preset template code and / or the target template code, and add the style attribute code to the template code to be configured to generate a third target template code corresponding to the template code to be configured.
[0099] Assuming that the template common component can include preset template codes template1, template2, and template3, etc., each preset template code is actually a set of CSS styles, corresponding to a set of document template types, then the developer can personalize it according to actual needs. Specifically, the developer can personalize the preset template code according to the React writing specification, including adding document attributes to a preset template code, and adding style attributes to one or some preset template codes. For example, you can add a unique attribute type to template1 and leave it alone for template2, including kind: distinguish file formats; name: distinguish page numbers; className: the name of the added class, etc., as follows:
[0100]
[0101]
[0102] For style attributes, a .CSS file can be added to modify the display style of the document. When the .CSS file is located in a preset template code, only the display style of the document corresponding to the template code is modified; when the .CSS file is located at the end or head of the template common component, the display style of the document corresponding to all template codes in the entire template common component can be modified, as follows:
[0103]
[0104]
[0105] Through the above process, developers can personalize the preset template codes provided according to actual needs, enabling developers to create and edit documents from the code level, effectively lowering the threshold for document processing, and supporting local customized editing of template codes, which improves the flexibility of document updates and avoids full updates of data.
[0106] Step 104 , performing code parsing on the unconfigured preset template code and the configured target template code in the code editing interface to generate a first target document corresponding to the file creation instruction.
[0107] After the developer completes the personalized configuration of the preset template code based on the React environment, the preset template code that is not configured in the code editing interface and the target template code that is personalized can be further mapped to generate a Json array, and then the Json array can be used to generate a first target document corresponding to the file creation instruction in response to the document generation instruction for the code editing interface. Among them, the data structure of the Json array may include the first document template and the first document content corresponding to the preset template code, the second document template and the second document content corresponding to the target template code, and the document attributes and document display style corresponding to the attribute code. Then, the first document content can be added to the first document template, the second document content can be added to the second document template, and the display style of the second document template and / or the second document content can be adjusted according to the document display style to generate a first target document corresponding to the document attributes.
[0108] Optionally, the document template can be a template for document display, and the document content can be content filled in the template. The document content can be content added by developers in the template according to their own needs, and can include text, pictures, tables, audio, video, links, etc.
[0109] Specifically, for the Jsx code in the code editing interface, it can be converted into a Json array by parsing the code hierarchy structure, which is essentially a mapping of the code structure, as follows:
[0110]
[0111]
[0112]
[0113] After obtaining the Json array, you can input the Json array into the corresponding document generator (such as think-cell, which can be used to generate ppt documents, etc.) to convert the Json array into the corresponding document. In this way, by creating documents at the code level in the code editing interface, effective coupling with the front-end framework is achieved. At the same time, documents can be edited and created at the code level, which effectively lowers the threshold for document processing. It also supports local or global custom editing of preset template components on demand, which improves the flexibility of document updates.
[0114] Optionally, after generating the first target document, the terminal may display the preset template code and / or the target template code, as well as the first target document, in the code editing interface, thereby allowing developers to intuitively understand the presentation effect of the document by synchronously displaying the code and the target document. At the same time, while presenting the document, it can be convenient for developers to return to the code level for dynamic adjustments based on the presentation effect of the document, thereby further improving the convenience of document processing.
[0115] In an optional embodiment, the editing of the document may include editing an existing document or optimizing a newly generated document. Specifically, the terminal may respond to the document editing instruction, obtain the second target document corresponding to the document editing instruction and the document code corresponding to the document editing instruction in the second target document, and display the document code in the code editing interface, and then respond to the editing operation on the document code and update the second target document according to the editing operation.
[0116] Among them, the second target document can be the above-mentioned newly generated document according to the developer's operation, or it can be a document already existing locally or on the cloud, and the document editing instruction can be an instruction for the developer to open a certain document and the document code corresponding to the document editing instruction in the development environment constructed in the above embodiment. For the document code, it can be the source code corresponding to the document in the relevant development environment (such as jxs code in the React environment, etc.). By establishing a mapping relationship between the document and the document code, the document code can be quickly located through the mapping relationship when the document needs to be re-edited, and the document code corresponding to the document editing instruction in the document to be edited is displayed in the code editing interface. After the document code is displayed in the code editing interface, the developer can edit the document code according to his own needs, including modifying the code, adding the code, deleting the code, etc. to globally edit the document, edit one or several document pages in the document, edit the local content of a certain page of the document, the document style, etc., so that the developer can customize the generated document locally or globally from the code level as needed, effectively avoiding the problem that the Json array needs to be fully updated, and greatly improving the flexibility and convenience of document processing.
[0117] In an optional embodiment, since the document to be edited may include at least one document page, and the document page may include corresponding content, during the document editing process, the terminal may respond to the document editing instruction, obtain the second target document corresponding to the document editing instruction and the document code corresponding to the document editing instruction in the second target document, and display the second target document and the document code in the code editing interface, and then respond to the content selection operation for the second target document, determine the target document page corresponding to the content selection operation, and locate the page code corresponding to the content selection operation in the target document page in the target code, and then respond to the editing operation for the page code, and update the second target document according to the editing operation. Among them, the target document page can be all document pages of the document, or a certain document page of the document; accordingly, the page code can be a code associated with all document pages, or a code corresponding to a certain document page, etc.
[0118] During the document generation process, developers can edit the preset template components in the development environment to generate the corresponding target document. For the target document, the content involved (including document pages, content in the pages, display styles, etc.) are all associated with the corresponding codes, that is, there is a corresponding mapping relationship between the document content and the code. Therefore, during the document editing process, the terminal can simultaneously display the second target document to be edited and the document code corresponding to the second target document in the code editing interface. Then the developer can select the content to be edited in the second target document. Then the terminal can locate the corresponding code in the document code according to the content selected by the developer in the document. Through the mapping relationship between the document and the code, the code to be edited can be quickly located, which effectively improves the convenience and efficiency of document editing.
[0119] For example, when displaying the document to be edited and the document code corresponding to the document, the developer can select the entire document, and the terminal can locate the code associated with the global modification in the document code; if a page of the document is selected or a portion of the content of a page is selected, the terminal can locate the code associated with the document page in the document code, or the code associated with the local content in the document page. In this way, the developer can quickly locate the code that needs to be edited according to their own needs through the mapping relationship between the document and the code, which effectively improves the convenience and efficiency of document editing. In addition, the document editing process supports on-demand local or global custom editing, which improves the flexibility of document updates.
[0120] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It is understandable that under the guidance of the ideas of the embodiments of the present invention, those skilled in the art can also make settings according to actual needs, and the present invention is not limited to this.
[0121] In an embodiment of the present invention, when creating a related document, a terminal for creating a document can respond to a file creation instruction and display a code editing interface corresponding to the file creation instruction. Then, it can respond to a template adding operation for the code editing interface and add a template general component corresponding to the template adding operation in the code editing interface. The template general component may include several preset template codes. For the preset template code, a personalized configuration operation can be performed on it. The terminal determines the preset template code for personalized configuration and the attribute code for the preset template code for personalized configuration according to the developer's operation, and adds the attribute code to the corresponding preset template code to generate a personalized target template code. After the configuration is completed, the code can be parsed for the template code that has not been personalized configured and the template code that has been personalized configured in the code editing interface to generate the corresponding first target document. Therefore, by creating a document from the code level in the code editing interface, effective coupling with the front-end framework is achieved. At the same time, the document is edited and created from the code level, which effectively lowers the threshold for document generation. It also supports local or global custom editing of preset template components on demand, thereby improving the flexibility of document updates.
[0122] In order to help those skilled in the art better understand the technical solution of the embodiment of the present invention, an example is given below for illustrative description.
[0123] Assuming that the developer wants to create a ppt document, the developer can run the corresponding online editing page in the terminal. Then the developer can embed the codesandbox online compiler in the page and configure the React environment so that the developer can edit the Jsx code online in the React environment to create the document.
[0124] Developers add corresponding template codes in the React environment, provide n sets of skin components, each set of skin components is essentially a set of CSS styles, and encapsulate multiple sets of skin components into common components and add them to the React environment. Among them, the enumeration value of the component parameter type of the common component can be different template types (one template type can correspond to one CSS), such as template1, template2, etc., and use as follows
[0125]
[0126] Then you can personalize the added template type according to the specifications of the React environment, including adding unique attribute types, such as kind: to distinguish file formats; name: to distinguish page numbers; className: the name of the added class, etc. At the same time, you can also add a .CSS file to modify the display style of the template type.
[0127] After completing code editing in the React environment (realizing personalized configuration), you can parse the code hierarchy and convert it into a Json array. The essence of this is to make a layer of mapping relationship, and then input the Json array into think-cell, and convert the data in the ppttc / ppttc-schema.json format into the corresponding ppt document. In this way, by creating a ppt document at the code level in the code editing interface, effective coupling with the front-end framework is achieved. At the same time, documents can be edited and created at the code level, which effectively lowers the threshold for document processing, supports local customized editing, and improves the flexibility of document updates.
[0128] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0129] Reference Figure 2 , shows a structural block diagram of a document generation device provided in an embodiment of the present invention, which may specifically include the following modules:
[0130] The editing interface display module 201 is used to display the code editing interface corresponding to the file creation instruction in response to the file creation instruction;
[0131] A general component adding module 202, configured to, in response to a template adding operation on the code editing interface, add a template general component corresponding to the template adding operation on the code editing interface, wherein the template general component includes a plurality of preset template codes;
[0132] The template code configuration module 203 is used to determine at least one template code to be configured and an attribute code for the template code to be configured in response to the configuration operation for the preset template code, and add the attribute code to the template code to be configured to generate a target template code corresponding to the template code to be configured;
[0133] The target document generation module 204 is used to parse the preset template code that is not configured in the code editing interface and the configured target template code to generate a first target document corresponding to the file creation instruction.
[0134] In an optional embodiment, it also includes:
[0135] A content display module is used to display the preset template code and / or the target template code, and the first target document in the code editing interface.
[0136] In an optional embodiment, the template code configuration module 203 includes:
[0137] A document attribute adding submodule, for determining at least one template code to be configured and a document attribute code for the template code to be configured in response to a document attribute configuration operation for the preset template code, and adding the document attribute code to the template code to be configured to generate a first target template code corresponding to the template code to be configured;
[0138] The document attribute code includes at least one or more codes of document type, document name, document page number, and class name.
[0139] In an optional embodiment, the template code configuration module 203 further includes:
[0140] a style attribute adding submodule, configured to respond to a style attribute configuration operation on the first target template code, obtain a style attribute code corresponding to the style attribute configuration operation, and add the style attribute code to the first target template code to generate a second target template code corresponding to the first target template code;
[0141] The style attribute code includes at least one or more codes for representing width attribute, height attribute, display type, container attribute, font attribute, color attribute, and background attribute.
[0142] In an optional embodiment, the template code configuration module 203 is specifically used to:
[0143] In response to the style attribute configuration operation for the preset template code and / or the target template code, at least one template code to be configured and a style attribute code for the template code to be configured are determined, and the style attribute code is added to the template code to be configured to generate a third target template code corresponding to the template code to be configured.
[0144] In an optional embodiment, the target document generation module 204 includes:
[0145] A Json array generation submodule, used for performing code mapping between the unconfigured preset template code and the configured target template code in the code editing interface to generate a Json array;
[0146] The document generation submodule is used to respond to the document generation instruction for the code editing interface and use the Json array to generate a first target document corresponding to the file creation instruction.
[0147] In an optional embodiment, the device further includes:
[0148] A document editing module, configured to, in response to a document editing instruction, obtain a second target document corresponding to the document editing instruction and a document code in the second target document corresponding to the document editing instruction;
[0149] A document code display module, used to display the document code in the code editing interface;
[0150] The document updating module is used to respond to the editing operation on the document code and update the second target document according to the editing operation.
[0151] In an optional embodiment, the second target document includes a plurality of document pages, and the device further includes:
[0152] A document display module, configured to display the second target document in the code editing interface before the document updating module responds to an editing operation on the document code and updates the second target document according to the editing operation;
[0153] The document update module is specifically used for:
[0154] In response to a content selection operation on the second target document, determining a target document page corresponding to the content selection operation, and locating a page code corresponding to the content selection operation in the target document page in the target code;
[0155] In response to an editing operation on the page code, the second target document is updated according to the editing operation.
[0156] In an optional embodiment, the editing interface display module 201 is specifically used for:
[0157] In response to the file creation instruction, an online editing page is started, wherein the online editing page includes a plurality of different environment compilers, each of which corresponds to a preset code editing environment;
[0158] In response to a selection operation on the environment compiler, a target environment compiler corresponding to the selection operation is determined, a target code editing environment corresponding to the target environment compiler is added to the online editing page, and a code editing interface corresponding to the target code editing environment is displayed.
[0159] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0160] In addition, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned document generation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0161] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned document generation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0162] Figure 3 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.
[0163] The electronic device 300 includes but is not limited to: a radio frequency unit 301, a network module 302, an audio output unit 303, an input unit 304, a sensor 305, a display unit 306, a user input unit 307, an interface unit 308, a memory 309, a processor 310, and a power supply 311. Those skilled in the art will appreciate that Figure 3 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.
[0164] It should be understood that in the embodiment of the present invention, the radio frequency unit 301 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 310 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 301 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 301 can also communicate with the network and other devices through a wireless communication system.
[0165] The electronic device provides users with wireless broadband Internet access through the network module 302, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0166] The audio output unit 303 can convert the audio data received by the RF unit 301 or the network module 302 or stored in the memory 309 into an audio signal and output it as sound. Moreover, the audio output unit 303 can also provide audio output related to a specific function performed by the electronic device 300 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 303 includes a speaker, a buzzer, a receiver, etc.
[0167] The input unit 304 is used to receive audio or video signals. The input unit 304 may include a graphics processor (GPU) 3041 and a microphone 3042, wherein the graphics processor 3041 processes image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame may be displayed on the display unit 306. The image frame processed by the graphics processor 3041 may be stored in the memory 309 (or other storage medium) or sent via the radio frequency unit 301 or the network module 302. The microphone 3042 may receive sound and may process such sound into audio data. The processed audio data may be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 301 in the case of a telephone call mode.
[0168] The electronic device 300 also includes at least one sensor 305, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 3061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 3061 and / or the backlight when the electronic device 300 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 305 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0169] The display unit 306 is used to display information input by the user or information provided to the user. The display unit 306 may include a display panel 3061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0170] The user input unit 307 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 307 includes a touch panel 3071 and other input devices 3072. The touch panel 3071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 3071 or near the touch panel 3071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 3071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, and converts it into the contact point coordinates, and then sends it to the processor 310, receives the command sent by the processor 310 and executes it. In addition, the touch panel 3071 can be implemented in various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 3071, the user input unit 307 may also include other input devices 3072. Specifically, other input devices 3072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.
[0171] Furthermore, the touch panel 3071 may be overlaid on the display panel 3061. When the touch panel 3071 detects a touch operation on or near it, it is transmitted to the processor 310 to determine the type of touch event. Then, the processor 310 provides corresponding visual output on the display panel 3061 according to the type of touch event. Figure 3 In the figure, the touch panel 3071 and the display panel 3061 are used as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 3071 and the display panel 3061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.
[0172] The interface unit 308 is an interface for connecting an external device to the electronic device 300. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 308 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 300 or may be used to transmit data between the electronic device 300 and an external device.
[0173] The memory 309 can be used to store software programs and various data. The memory 309 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 309 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0174] The processor 310 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 309, and calling data stored in the memory 309, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 310 may include one or more processing units; preferably, the processor 310 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 310.
[0175] The electronic device 300 may also include a power supply 311 (such as a battery) for supplying power to each component. Preferably, the power supply 311 may be logically connected to the processor 310 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0176] In addition, the electronic device 300 includes some functional modules not shown, which will not be described in detail here.
[0177] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0178] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0179] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
[0180] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0181] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0182] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0183] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0184] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0185] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0186] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for generating a document, characterized in that: include: In response to a file creation instruction, displaying a code editing interface corresponding to the file creation instruction; In response to a template adding operation on the code editing interface, adding a template general component corresponding to the template adding operation in the code editing interface, the template general component including a plurality of preset template codes; In response to a configuration operation for the preset template code, determining at least one template code to be configured and an attribute code for the template code to be configured configured by the configuration operation, and adding the attribute code to the template code to be configured, generating a target template code corresponding to the template code to be configured; Perform code mapping on the preset template code not configured in the code editing interface and the configured target template code to generate a Json array; the data structure of the Json array includes a first document template and a first document content corresponding to the preset template code, a second document template and a second document content corresponding to the target template code, and a document attribute and a document display style corresponding to the attribute code; In response to a document generation instruction for the code editing interface, the Json array is used to add the first document content to the first document template, the second document content to the second document template, and the display style of the second document template and / or the second document content is adjusted according to the document display style to generate a first target document corresponding to the file creation instruction.
2. The method according to claim 1, characterized in that Also includes: The preset template code and / or the target template code, and the first target document are displayed in the code editing interface.
3. The method according to claim 1, characterized in that The step of determining, in response to a configuration operation for the preset template code, at least one template code to be configured and an attribute code for the template code to be configured configured by the configuration operation, and adding the attribute code to the template code to be configured, and generating a target template code corresponding to the template code to be configured, includes: In response to a document attribute configuration operation for the preset template code, determining at least one template code to be configured and a document attribute code for the template code to be configured configured by the configuration operation, and adding the document attribute code to the template code to be configured, generating a first target template code corresponding to the template code to be configured; The document attribute code includes at least one or more codes of document type, document name, document page number, and class name.
4. The method according to claim 3, characterized in that The step of determining, in response to a configuration operation on the preset template code, at least one template code to be configured and an attribute code for the template code to be configured configured by the configuration operation, and adding the attribute code to the template code to be configured to generate a target template code corresponding to the template code to be configured, further includes: In response to a style attribute configuration operation on the first target template code, obtaining a style attribute code corresponding to the style attribute configuration operation, and adding the style attribute code to the first target template code to generate a second target template code corresponding to the first target template code; The style attribute code includes at least one or more codes for representing width attribute, height attribute, display type, container attribute, font attribute, color attribute, and background attribute.
5. The method according to any one of claims 1 to 4, characterized in that: The step of determining, in response to a configuration operation for the preset template code, at least one template code to be configured and an attribute code for the template code to be configured configured by the configuration operation, and adding the attribute code to the template code to be configured, and generating a target template code corresponding to the template code to be configured, includes: In response to a style attribute configuration operation for the preset template code and / or the target template code, at least one template code to be configured and a style attribute code for the template code to be configured configured by the configuration operation are determined, and the style attribute code is added to the template code to be configured to generate a third target template code corresponding to the template code to be configured.
6. The method according to claim 1, characterized in that Also includes: In response to a document editing instruction, acquiring a second target document corresponding to the document editing instruction and a document code in the second target document corresponding to the document editing instruction; Displaying the document code in the code editing interface; In response to an editing operation on the document code, the second target document is updated according to the editing operation.
7. The method according to claim 6, characterized in that The second target document includes a plurality of document pages, and before responding to the editing operation on the document code and updating the second target document according to the editing operation, the second target document further includes: Displaying the second target document in the code editing interface; The step of responding to the editing operation on the document code and updating the second target document according to the editing operation includes: In response to a content selection operation on the second target document, determining a target document page corresponding to the content selection operation, and locating a page code corresponding to the content selection operation in the target document page in the target code; In response to an editing operation on the page code, the second target document is updated according to the editing operation.
8. The method according to claim 1, characterized in that The step of displaying a code editing interface corresponding to the file creation instruction in response to the file creation instruction includes: In response to the file creation instruction, an online editing page is started, wherein the online editing page includes a plurality of different environment compilers, each of which corresponds to a preset code editing environment; In response to a selection operation on the environment compiler, a target environment compiler corresponding to the selection operation is determined, a target code editing environment corresponding to the target environment compiler is added to the online editing page, and a code editing interface corresponding to the target code editing environment is displayed.
9. A document generation device, characterized in that: include: An editing interface display module, used to display a code editing interface corresponding to the file creation instruction in response to the file creation instruction; A general component adding module, used for adding a template general component corresponding to the template adding operation on the code editing interface in response to the template adding operation on the code editing interface, wherein the template general component includes a plurality of preset template codes; A template code configuration module, configured to, in response to a configuration operation for the preset template code, determine at least one template code to be configured and an attribute code for the template code to be configured configured by the configuration operation, and add the attribute code to the template code to be configured, and generate a target template code corresponding to the template code to be configured; A target document generation module is used to perform code mapping between the preset template code not configured in the code editing interface and the configured target template code to generate a Json array; the data structure of the Json array includes a first document template and a first document content corresponding to the preset template code, a second document template and a second document content corresponding to the target template code, and a document attribute and a document display style corresponding to the attribute code; In response to a document generation instruction for the code editing interface, the Json array is used to add the first document content to the first document template, the second document content to the second document template, and the display style of the second document template and / or the second document content is adjusted according to the document display style to generate a first target document corresponding to the file creation instruction.
10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 8 when executing the program stored in the memory.
11. One or more computer-readable storage media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Interface document generation method and device, electronic equipment and storage medium
CN110806863A