CN115048919A - Document generation method and device, electronic equipment and storage medium - Google Patents

Document generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115048919A
CN115048919A CN202210434872.3A CN202210434872A CN115048919A CN 115048919 A CN115048919 A CN 115048919A CN 202210434872 A CN202210434872 A CN 202210434872A CN 115048919 A CN115048919 A CN 115048919A
Authority
CN
China
Prior art keywords
code
template
document
target
editing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210434872.3A
Other languages
Chinese (zh)
Inventor
柴关鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chengshi Wanglin Information Technology Co Ltd
Original Assignee
Beijing Chengshi Wanglin Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Chengshi Wanglin Information Technology Co Ltd filed Critical Beijing Chengshi Wanglin Information Technology Co Ltd
Priority to CN202210434872.3A priority Critical patent/CN115048919A/en
Publication of CN115048919A publication Critical patent/CN115048919A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

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

Abstract

The embodiment of the invention provides a document generation method, a document generation device, electronic equipment and a storage medium, wherein the method comprises the following steps: responding to the file creating instruction, and displaying a code editing interface corresponding to the file creating instruction; responding to template adding operation aiming at the code editing interface, and adding a template general component corresponding to the template adding operation in the code editing interface, wherein the template general component comprises a plurality of preset template codes; responding to configuration operation aiming at a preset template code, determining at least one template code to be configured and an attribute code aiming at the template code to be configured, adding the attribute code into the template code to be configured, and generating a target template code corresponding to the template code to be configured; and carrying out code analysis on the unconfigured preset template codes and the configured target template codes in the code editing interface to generate a first target document corresponding to the file creating instruction.

Description

Document generation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for generating a document, an electronic device, and a computer-readable storage medium.
Background
In modern offices, work reports, summaries, presentations, and the like, often need to be made through various types of presentation documents, including Word documents, Excel documents, Powerpoint documents, and the like. For example, with Powerpoint, it may create a presentation, and may also hold a face-to-face meeting over the internet, a teleconference, or present a presentation to an audience over the internet, among other things. The ppt can contain text, pictures, diagrams, animations, sounds, films and other contents, and the corresponding contents can be effectively displayed by editing the ppt meeting the corresponding required scenes. However, the document creation process is cumbersome and complex, and it has certain thresholds for non-professionals. In the related art, documents can be created through the Json array, but in the process, a worker is required to be familiar with the structural format of the Json array, a certain processing threshold exists, the Json array-based document cannot be well coupled with a front-end framework, and the workload of the worker is increased due to the fact that the Json array-based document needs to be updated in a full amount.
Disclosure of Invention
The embodiment of the invention provides a document generation method, a document generation device, electronic equipment and a computer-readable storage medium, and aims to solve or partially solve the problems that a creation threshold, no effective coupling with a front-end framework and only full-scale updating are available when a document is created in the related art.
The embodiment of the invention discloses a document generation method, which comprises the following steps:
responding to a file creating instruction, and displaying a code editing interface corresponding to the file creating instruction;
responding to a template adding operation aiming at the code editing interface, and adding a template general assembly corresponding to the template adding operation in the code editing interface, wherein the template general assembly comprises a plurality of preset template codes;
responding to the configuration operation aiming at the preset template code, determining at least one template code to be configured and an attribute code aiming at the template code to be configured, adding the attribute code into the template code to be configured, and generating a target template code corresponding to the template code to be configured;
and performing code analysis on the unconfigured preset template codes and the configured target template codes in the code editing interface to generate a first target document corresponding to the file creating instruction.
Optionally, the method further comprises:
and displaying the preset template code and/or the target template code and the first target document in the code editing interface.
Optionally, the determining, in response to the 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, 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 includes:
responding to a document attribute configuration operation aiming at the preset template code, determining at least one template code to be configured and a document attribute code aiming at the template code to be configured, adding the document attribute code to the template code to be configured, and generating a first target template code corresponding to the template code to be configured;
wherein the document attribute codes at least comprise one or more codes of document type, document name, document page number and class name.
Optionally, the determining, in response to the 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, 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:
responding to a style attribute configuration operation aiming at the first target template code, acquiring a style attribute code corresponding to the style attribute configuration operation, adding the style attribute code to the first target template code, and generating a second target template code corresponding to the first target template code;
wherein the style attribute code includes at least one or more of a code characterizing a width attribute, a height attribute, a display type, a container attribute, a font attribute, a color attribute, and a background attribute.
Optionally, the determining, in response to the 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, 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 includes:
responding to a style attribute configuration operation aiming at the preset template code and/or the target template code, determining at least one template code to be configured and a style attribute code aiming at the template code to be configured, adding the style attribute code to the template code to be configured, and generating a third target template code corresponding to the template code to be configured.
Optionally, the code analyzing the preconfigured template codes and the configured target template codes in the code editing interface to generate a first target document corresponding to the document creating instruction includes:
performing code mapping on the unconfigured preset template codes and the configured target template codes in the code editing interface to generate a Json array;
and responding to a document generation instruction aiming at the code editing interface, and generating a first target document corresponding to the file creation instruction by adopting the Json array.
Optionally, the method further comprises:
responding to a document editing instruction, and acquiring a second target document corresponding to the document editing instruction and a document code corresponding to the document editing instruction in the second target document;
displaying the document code in the code editing interface;
and responding to the editing operation aiming at the document code, and updating the second target document according to the editing operation.
Optionally, the second target document includes several pages of document pages, and before the response to the editing operation on the document code and the update of the second target document according to the editing operation, the method further includes:
displaying the second target document in the code editing interface;
the updating the second target document according to the editing operation in response to the editing operation on the document code comprises:
in response to a content selection operation for the second target document, determining a target document page corresponding to the content selection operation, and positioning a page code corresponding to the content selection operation in the target document page in the target code;
and responding to the editing operation aiming at the page code, and updating the second target document according to the editing operation.
Optionally, the displaying, in response to the file creation instruction, a code editing interface corresponding to the file creation instruction includes:
responding to a file creating instruction, and starting an online editing page, wherein the online editing page comprises a plurality of different environment compilers, and each environment compiler corresponds to a preset code editing environment;
responding to the selection operation aiming at the environment compiler, determining a target environment compiler corresponding to the selection operation, adding a target code editing environment corresponding to the target environment compiler in the online editing page, and displaying a code editing interface corresponding to the target code editing environment.
The embodiment of the invention also discloses a document generating device, which comprises:
the editing interface display module is used for responding to a file creating instruction and displaying a code editing interface corresponding to the file creating instruction;
the general component adding module is used for responding to template adding operation aiming at the code editing interface and adding a template general component corresponding to the template adding operation in the code editing interface, and the template general component comprises a plurality of preset template codes;
the template code configuration module is used for responding to configuration operation aiming at the preset template code, determining at least one template code to be configured and an attribute code aiming at the template code to be configured, adding the attribute code into the template code to be configured and generating a target template code corresponding to the template code to be configured;
and the target document generation module is used for performing code analysis on the unconfigured preset template codes and the configured target template codes in the code editing interface to generate a first target document corresponding to the file creation instruction.
Optionally, the method further comprises:
and the content display module is used for displaying the preset template code and/or the target template code and the first target document in the code editing interface.
Optionally, the template code configuration module includes:
the document attribute adding submodule is used for responding to a document attribute configuration operation aiming at the preset template code, determining at least one template code to be configured and a document attribute code aiming at the template code to be configured, adding the document attribute code into the template code to be configured, and generating a first target template code corresponding to the template code to be configured;
wherein the document attribute codes at least comprise one or more codes of document type, document name, document page number and class name.
Optionally, the template code configuration module further includes:
the style attribute adding sub-module is used for responding to a style attribute configuration operation aiming at the first target template code, acquiring a style attribute code corresponding to the style attribute configuration operation, adding the style attribute code to the first target template code and generating a second target template code corresponding to the first target template code;
wherein the style attribute code includes at least one or more codes for characterizing a width attribute, a height attribute, a display type, a container attribute, a font attribute, a color attribute, and a background attribute.
Optionally, the template code configuration module is specifically configured to:
responding to a style attribute configuration operation aiming at the preset template code and/or the target template code, determining at least one template code to be configured and a style attribute code aiming at the template code to be configured, adding the style attribute code to the template code to be configured, and generating a third target template code corresponding to the template code to be configured.
Optionally, the target document generation module includes:
the Json array generation submodule is used for performing code mapping on the preconfigured template codes and the configured target template codes in the code editing interface to generate a Json array;
and the document generation submodule is used for responding to a document generation instruction aiming at the code editing interface and generating a first target document corresponding to the file creation instruction by adopting the Json array.
Optionally, the apparatus further comprises:
the document editing module is used for responding to a document editing instruction, and acquiring a second target document corresponding to the document editing instruction and a document code corresponding to the document editing instruction in the second target document;
the document code display module is used for displaying the document code in the code editing interface;
and the document updating module is used for responding to the editing operation aiming at the document code and updating the second target document according to the editing operation.
Optionally, the second target document includes several pages of document pages, and the apparatus further includes:
the document display module is used for displaying the second target document in the code editing interface before the document updating module responds to the editing operation aiming at the document code and updates the second target document according to the editing operation;
the document update module is specifically configured to:
in response to a content selection operation for the second target document, determining a target document page corresponding to the content selection operation, and positioning a page code corresponding to the content selection operation in the target document page in the target code;
and responding to the editing operation aiming at the page code, and updating the second target document according to the editing operation.
Optionally, the editing interface display module is specifically configured to:
responding to a file creating instruction, and starting an online editing page, wherein the online editing page comprises a plurality of different environment compilers, and each environment compiler corresponds to a preset code editing environment;
responding to the selection operation aiming at the environment compiler, determining a target environment compiler corresponding to the selection operation, adding a target code editing environment corresponding to the target environment compiler in the online editing page, and displaying a code editing interface corresponding to the target code editing environment.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory finish mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Embodiments of the invention also disclose one or more computer-readable storage media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform a method as described in embodiments of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, when a relevant document is created, a terminal for creating the document can respond to a document creating instruction, display a code editing interface corresponding to the document creating instruction, then respond to a template adding operation aiming at the code editing interface, add a template general component corresponding to the template adding operation in the code editing interface, wherein the template general component can comprise a plurality of preset template codes, and can perform personalized configuration operation on the preset template codes, so that the terminal determines the preset template codes for personalized configuration and the attribute codes aiming at the preset template codes for personalized configuration according to the operation of developers, adds the attribute codes to the corresponding preset template codes, generates target template codes for personalized configuration, and can perform code allocation on the template codes which are not subjected to personalized configuration and are subjected to personalized configuration in the code editing interface after the configuration is completed And analyzing and generating a corresponding first target document, so that the document is created in a code layer mode on a code editing interface, the effective coupling between the document and a front-end frame is realized, meanwhile, the document is edited and created from the code layer, the document generation threshold is effectively reduced, local or global self-defined editing on a preset template component is supported as required, and the document updating flexibility is improved.
Drawings
FIG. 1 is a flowchart illustrating steps of a document generation method provided in an embodiment of the present invention;
FIG. 2 is a block diagram showing a structure of a document generating apparatus according to an embodiment of the present invention;
fig. 3 is a block diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
As an example, the process of creating a document is very complicated and requires a related person to be skilled in skills of typesetting, editing, content design, and the like, and the process has a certain threshold. Therefore, in the related art, the document can be created through the Json array, the method is applicable to code developers, but in the process, the developers are required to be familiar with the structure of the Json array, in addition, in the document creation process based on the Json array, the Json array cannot be well coupled with the front-end framework due to the fact that the Json array cannot be generated through the code level, when the document needs to be updated, the Json array can only be edited again for full updating, and the workload of the related personnel is greatly increased.
In view of the above, one of the core invention points of the embodiment of the present invention is to perform document creation and editing from a code layer based on object code editing, display a code editing interface corresponding to a document creation instruction by responding to a file creation instruction input by a developer, where the developer can perform code editing to implement document creation, editing, and the like, and a terminal can respond to a template addition operation for the code editing interface, and add a template general component corresponding to the template addition operation in the code editing interface, where the template general component may include a plurality of preset template codes, and for a preset template code, a personalized configuration operation can be performed thereon, and then the terminal determines the preset template code to be personalized and an attribute code for the preset template code to be personalized according to the developer operation, and adding the attribute codes into corresponding preset template codes to generate target template codes of personalized configuration, after the configuration is finished, performing code analysis on the template codes which are not subjected to the personalized configuration and are subjected to the personalized configuration in a code editing interface to generate corresponding first target documents, so that the documents are created on the code editing interface in a code layer mode based on a target code editing environment, the effective coupling between the documents and a front-end frame is realized, meanwhile, the documents are edited and created from the code layer, the document generation threshold is effectively reduced, the preset template components are subjected to local or global self-defined editing according to requirements, and the document updating flexibility is improved.
In order to make those skilled in the art better understand the technical solutions of the embodiments of the present invention, some technical terms related to the embodiments of the present invention are explained and explained below:
the fact, which may be a JavaScript library used for constructing a developer interface, may transfer various types of parameters in the fact, such as a declaration code, a rendering developer interface, a static html dom element, a transfer dynamic variable, and an interactive application component.
Documents, which may include Word documents, Excel documents, Powerpoint documents, and the like.
Jsx, which can be a syntactic extension of JavaScript, can describe well from the code level the essential form in which developer interface presentations should appear to be interactive.
Json, which may be a JavaScript Object Notation (JavaScript Object Notification), is a lightweight format for exchanging text data, which can be used to store and exchange text information.
Optionally, in the embodiment of the present invention, the method may be applied to an act environment (act code editing environment), where the act environment is configured by running a corresponding online compiler (e.g., Codesandbox, etc.) in a terminal, then online compiling Jsx codes in the act environment, then converting Jsx codes into corresponding Json arrays, and then creating corresponding documents according to the Json arrays, thereby implementing document creation at a code level. It should be noted that the document may also be generated by code editing in another development environment (code editing environment) other than the act environment, and the present invention is not limited to this.
Specifically, referring to fig. 1, a flowchart illustrating steps of a document generating method provided in an embodiment of the present invention is shown, which may specifically include the following steps:
step 101, responding to a file creating instruction, and displaying a code editing interface corresponding to the file creating instruction;
the file creation instructions may be instructions to configure a development environment that generates the document. Specifically, the terminal may start an online editing page in response to the file creation instruction, where the online editing page includes a plurality of different environment compilers, each environment compiler corresponds to a preset code editing environment, and then may determine, in response to a selection operation for the environment compilers, a target environment compiler corresponding to the selection operation, add a target code editing environment corresponding to the target environment compiler in the online editing page, and display a code editing interface corresponding to the target code editing environment, so that a developer edits a code in the code editing interface to generate a corresponding document.
For the online editing page, the online editing page may be an environment user interface used for development, and includes an environment general interface and interfaces of environment compilers and tools that are uniformly controlled by the environment general interface, each environment compiler may correspond to a development environment (i.e., a code editing environment), for example, next. Optionally, for the online editing page, the corresponding development software may be installed locally, and then the editing page is presented after the development software is run locally, or the corresponding environment user interface (i.e. the interface corresponding to the online editing page) is opened through a browser, the former may implement local online or offline editing, and the latter may implement browser online editing, which is not limited in the present invention.
In an example, a developer may run a corresponding online editing page in the terminal, and different environment compilers may be provided in the online editing page, for example, the developer may select a codeandbox to configure the fact environment, and after the configuration is completed, the terminal may display a corresponding code editing interface in the page, so that the developer writes Jsx codes in the fact environment. In addition, when code editing is required in other development environments, other compilers may be selected in the page to configure another corresponding development environment, which is not limited by the present invention.
Step 102, responding to a template adding operation aiming at the code editing interface, and adding a template general assembly corresponding to the template adding operation in the code editing interface, wherein the template general assembly comprises a plurality of preset template codes;
in the embodiment of the invention, for the creation of the document, a developer can design a template of the document by himself or can carry out personalized configuration through an existing document template. For the personalized configuration of the existing document template, the terminal can respond to the template adding operation aiming at the code editing interface and add the corresponding template general component in the code editing interface. Wherein, the template common component may include a plurality of preset template codes, each preset template code may be a set of skin components, which may be codes of a set of CSS (cascading style sheets) in nature.
For the preset template code, a developer can select to directly apply the preset template code to generate a document, and can also perform corresponding code configuration in the preset template code to realize personalized configuration. For a template general component, the enumerated values of the component parameter types may be values corresponding to different preset template codes, for example, template1, template2, template3, and the like, and for a certain preset template code, the enumerated values may be as follows:
Figure BDA0003612176740000101
and n can be used for representing the nth preset template code, and for the template general component, developers can perform personalized configuration as required. Meanwhile, in a code editing interface, on one hand, the code writing condition under the React environment can be displayed, and on the other hand, the document display condition corresponding to the preset template code can be displayed, so that developers can write the code and know the typesetting condition of the document at the same time, and the quality of the document is ensured.
103, responding to configuration operation aiming at the preset template code, determining at least one template code to be configured and an attribute code aiming at the template code to be configured, adding the attribute code into the template code to be configured, and generating a target template code corresponding to the template code to be configured;
in specific implementation, for a preset template code, a developer can perform personalized attribute code configuration according to actual requirements, and add the attribute code to the corresponding preset template code to implement personalized configuration of a document template. The personalized configuration of the preset template code can comprise personalized configuration of document attributes, personalized configuration of style attributes and the like, and the personalized configuration of the document attributes can comprise one or more personalized configurations of document types, document names, document page numbers, class names and the like; the style attributes can include one or more personalized configurations of width attributes, height attributes, display types, container attributes, font attributes, color attributes, background attributes and the like, so that developers can perform personalized editing of documents from a code level according to actual requirements after determining preset template codes.
In an optional embodiment, a developer may only perform document attribute configuration on a preset template code, and then the terminal may determine 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, add the document attribute code to the template code to be configured, and generate a first target template code corresponding to the template code to be configured. The document attribute codes at least comprise one or more codes of document types, document names, document page numbers and class names.
Alternatively, 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 a file name of a document created by a developer; the document page can be the page number of a preset template code in the document; the class name may be a data identification of the reference data, and so on.
In another optional embodiment, after the developer performs document attribute configuration on the preset template code, the developer may also perform style attribute configuration, and the terminal may respond to a style attribute configuration operation for the first target template code, acquire a style attribute code corresponding to the style attribute configuration operation, add the style attribute code to the first target template code, and generate a second target template code corresponding to the first target template code. Wherein the style attribute code at least comprises one or more codes for characterizing a width attribute, a height attribute, a display type, a container attribute, a font attribute, a color attribute, and a background attribute.
Alternatively, the width attribute may be the width of the document display; the height attribute may be a height at which the document is displayed; the display type can be a document self-adaptive display type (self-adaptive adjustment according to width, height, width, height and the like); the container property may define the alignment of the content on the principal axis; font attributes may define the font display size, dimensions, etc. of textual content in a document; the color attribute may define a display color of content in the document, etc.; the background attribute may define a display background of the document, etc.
In another optional embodiment, a developer may default to use the content of the preset template codes, and only configure the display style of the preset template codes, or perform personalized configuration on some of the preset template codes in the above manner to obtain target template codes, and then perform display style configuration on the unmodified preset template codes and the modified target template codes, so that 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 a style attribute configuration operation for the preset template codes and/or the target template codes, add the style attribute code to the template code to be configured, and generate a third target template code corresponding to the template code to be configured.
Assuming that the template general components may include preset template codes template1, template2, template3, etc., each preset template code is substantially a set of CSS styles, corresponding to a set of document template types, the developer may perform personalization according to actual requirements. Specifically, the developer can perform personalized configuration on the preset template code according to the writing specification of the read, including adding a document attribute for a certain preset template code and adding a sample type attribute for a certain preset template code or certain preset template codes, for example, adding a specific attribute type for template1, and not processing template2, including kind distinguishing a file format; name, distinguishing the number of pages; className-name of added class, etc., as follows:
Figure BDA0003612176740000121
Figure BDA0003612176740000131
the CSS file is positioned in a certain preset template code, and only the display style of the document corresponding to the template code is modified; when the CSS file is located at the tail or the head of the template general component, the display styles of the documents corresponding to all the template codes in the entire template general component may be modified as follows:
Figure BDA0003612176740000132
Figure BDA0003612176740000141
through the process, developers can perform personalized configuration on the provided preset template codes according to actual requirements, the fact that the developers create and edit the documents from the code layer is achieved, the threshold of document processing is effectively reduced, local self-defined editing of the template codes is supported, the flexibility of document updating is improved, and full updating of data is avoided.
And 104, performing code analysis on the unconfigured preset template codes and the configured target template codes in the code editing interface to generate a first target document corresponding to the file creating instruction.
After the developer completes the personalized configuration of the preset template codes based on the React environment, the preset template codes which are not configured in the code editing interface and the target template codes which are configured in a personalized manner can be further subjected to code mapping to generate a Json array, and then a first target document corresponding to a file creating instruction can be generated by adopting the Json array in response to a document generating instruction aiming at the code editing interface. The data structure of the Json array may include a first document template and first document content corresponding to a preset template code, a second document template and second document content corresponding to a target template code, and a document attribute and a document display style corresponding to an attribute code, and then the first document content may be added to the first document template, the second document content may be added to the second document template, and the display style of the second document template and/or the second document content may be adjusted according to the document display style, so as to generate a first target document corresponding to the document attribute.
Alternatively, the document template may be a template displayed by the document, and the document content may be content filled in the template, where the document content may be content added in the template by the developer according to the needs of the developer, and may include text, pictures, tables, audio, video, links, and the like.
Specifically, Jsx codes in the code editing interface can be converted into a Json array by analyzing a code hierarchy, which is essentially a mapping through a code structure, specifically as follows:
Figure BDA0003612176740000142
Figure BDA0003612176740000151
Figure BDA0003612176740000161
after the Json array is obtained, the Json array can be input into a corresponding document generator (such as a thin-cell which can be used for generating a ppt document and the like), the Json array is converted into a corresponding document, and the document is created in a code layer mode on a code editing interface, so that effective coupling between the Json array and a front-end frame is achieved, meanwhile, the document is edited and created from the code layer, the threshold of document processing is effectively reduced, local or global self-defined editing on a preset template component is supported as required, and the flexibility of document updating is improved.
Optionally, after the first target document is generated, the terminal may display the preset template code and/or the target template code and the first target document in the code editing interface, so that by synchronously displaying the code and the target document, a developer may intuitively know the presentation effect of the document, and at the same time, while presenting the document, the developer may conveniently return to the code level for dynamic adjustment according to the presentation effect of the document, thereby further improving the convenience of document processing.
In an alternative embodiment, the editing of the document may include editing of an existing document, or may be an optimized editing of the just-generated document. Specifically, the terminal may respond to the document editing instruction, acquire 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, display the document code in the code editing interface, and then may respond to the editing operation for the document code and update the second target document according to the editing operation.
The second target document may be the document newly generated according to the operation of the developer, or may be an existing document in the local or cloud, and the document editing instruction may be an instruction for opening a document and a document code corresponding to the document editing instruction in the document by the developer in the development environment established in the embodiment. For the document code, it may be a source code (e.g., jxs code in act environment) corresponding to the document in the relevant development environment, and by establishing a mapping relationship between the document and the document code, the document code may be quickly located through the mapping relationship when the document editing needs to be performed again, 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 codes are displayed in the code editing interface, developers can edit the document codes according to self requirements, including global editing of the document in modes of code modification, code addition, code deletion and the like, and editing of one or more document pages in the document, local content of one page of the document, document styles and the like, so that the developers can perform local or global self-defined re-editing on the generated document from a code level according to requirements, the problem that a Json array needs to be updated in a full amount is effectively avoided, and the flexibility and the convenience of document processing are greatly improved.
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, in the process of editing the document, the terminal may respond to the document editing instruction, obtain the second target document corresponding to the document editing instruction and a 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 may respond to the content selection operation for the second target document, determine a target document page corresponding to the content selection operation, locate a page code corresponding to the content selection operation in the target document page, and then respond to the editing operation for the page code, and update the second target document according to the editing operation. The target document page may be all document pages of the document or a certain document page of the document; accordingly, the page code may be a code associated with all document pages, or a code corresponding to a certain document page, or the like.
In the process of generating the document, a developer can edit a preset template component under a development environment to generate a corresponding target document, and for the target document, related contents (including document pages, contents in the pages, display styles and the like) of the target document are all associated with corresponding codes, namely, a corresponding mapping relation exists between the document contents and the codes, so that in the process of editing the document, a terminal can simultaneously display a second target document to be edited and document codes corresponding to the second target document in a code editing interface, then the developer can select the contents to be edited in the second target document, then the terminal can position the corresponding codes in the document codes according to the contents selected in the document by the developer, and the codes to be edited are quickly positioned through the mapping relation between the document and the codes, the convenience and the efficiency of document editing are effectively improved.
For example, when a document to be edited and a document code corresponding to the document are displayed, a developer may select the document in full, and the terminal may locate a code associated with global modification in the document code; if a certain page of the document or a part of content of a certain page is selected, the terminal can position codes associated with the document page in the document codes or codes associated with local content in the document page, so that developers can quickly position the codes needing to be edited according to self requirements through the mapping relation between the document and the codes, the convenience and the efficiency of document editing are effectively improved, the editing process of the document supports local or global self-defined editing as required, and the flexibility of document updating is improved.
It should be noted that, the embodiment of the present invention includes but is not limited to the above examples, and it is understood that, under the guidance of the idea of the embodiment of the present invention, a person skilled in the art may also set the method according to practical needs, and the present invention is not limited to this.
In the embodiment of the invention, when a relevant document is created, a terminal for creating the document can respond to a document creating instruction, display a code editing interface corresponding to the document creating instruction, then respond to a template adding operation aiming at the code editing interface, add a template general component corresponding to the template adding operation in the code editing interface, wherein the template general component can comprise a plurality of preset template codes, and can perform personalized configuration operation on the preset template codes, so that the terminal determines the preset template codes for personalized configuration and the attribute codes aiming at the preset template codes for personalized configuration according to the operation of developers, adds the attribute codes to the corresponding preset template codes, generates target template codes for personalized configuration, and can perform code allocation on the template codes which are not subjected to personalized configuration and are subjected to personalized configuration in the code editing interface after the configuration is completed And analyzing and generating a corresponding first target document, so that the document is created in a code layer mode on a code editing interface, the effective coupling between the document and a front-end frame is realized, meanwhile, the document is edited and created from the code layer, the document generation threshold is effectively reduced, local or global self-defined editing on a preset template component is supported as required, and the document updating flexibility is improved.
In order to make the technical solutions of the embodiments of the present invention better understood by those skilled in the art, the following is an exemplary description.
Assuming that a developer wants to create a ppt document, a corresponding online editing page can be run in the terminal, and then the developer can embed a codesendbox online compiler in the page to configure an React environment, so that the developer edits Jsx codes online in the React environment to achieve document creation.
A developer adds corresponding template codes in the React environment, each set of skin components is essentially in the style of one set of css by providing n sets of skin components, and a plurality of sets of skin components are packaged into a universal component and added into the React environment. Where enumerated values of component parameter types of common components may be different template types (one template type may correspond to one CSS), such as template1, template2, etc., as follows
Figure BDA0003612176740000191
Then, the added template type can be configured in a personalized way according to the specification conforming to the read environment, including adding a special attribute type, for example, kind, distinguishing file formats; name, distinguishing the number of pages; className-name of class (class) added, etc. At the same time, a CSS file may be added for modifying the display style of the template type.
After code editing is completed (personalized configuration is realized) in a React environment, a code hierarchical structure can be analyzed and converted into a Json array, the essence of the Json array is that a one-layer mapping relation is made, then the Json array is input into a think-cell, and data in a ppttc/ppttc-schema is converted into a corresponding ppt document, so that the ppt document is created in a code level mode on a code editing interface, effective coupling between the ppt document and a front-end frame is realized, meanwhile, the document is edited and created from the code level, the threshold of document processing is effectively reduced, local custom editing is supported, and the flexibility of document updating is improved.
It is noted that, for simplicity of explanation, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will appreciate that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 2, a block diagram of a structure of a document generating apparatus provided in an embodiment of the present invention is shown, and specifically may include the following modules:
an editing interface display module 201, configured to respond to a file creation instruction, and display a code editing interface corresponding to the file creation instruction;
a general component adding module 202, configured to add, in response to a template adding operation for the code editing interface, a general template component corresponding to the template adding operation in the code editing interface, where the general template component includes a plurality of preset template codes;
the template code configuration module 203 is configured to determine at least one template code to be configured and an attribute code for the template code to be configured in response to a configuration operation for the preset template code, 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;
and the target document generation module 204 is configured to perform code analysis on the preconfigured template codes and the configured target template codes in the code editing interface, and generate a first target document corresponding to the file creation instruction.
In an alternative embodiment, further comprising:
and the content display module is used for displaying the preset template code and/or the target template code and the first target document in the code editing interface.
In an alternative embodiment, the template code configuration module 203 comprises:
the document attribute adding submodule is used for responding to a document attribute configuration operation aiming at the preset template code, determining at least one template code to be configured and a document attribute code aiming at the template code to be configured, adding the document attribute code into the template code to be configured, and generating a first target template code corresponding to the template code to be configured;
wherein the document attribute codes at least comprise one or more codes of document type, document name, document page number and class name.
In an optional embodiment, the template code configuration module 203 further comprises:
the style attribute adding submodule is used for responding to a style attribute configuration operation aiming at the first target template code, acquiring a style attribute code corresponding to the style attribute configuration operation, adding the style attribute code to the first target template code and generating a second target template code corresponding to the first target template code;
wherein the style attribute code includes at least one or more codes for characterizing a width attribute, a height attribute, a display type, a container attribute, a font attribute, a color attribute, and a background attribute.
In an optional embodiment, the template code configuring module 203 is specifically configured to:
responding to a style attribute configuration operation aiming at the preset template code and/or the target template code, determining at least one template code to be configured and a style attribute code aiming at the template code to be configured, adding the style attribute code to the template code to be configured, and generating a third target template code corresponding to the template code to be configured.
In an alternative embodiment, the target document generation module 204 includes:
a Json array generation submodule, configured to perform code mapping on the preconfigured template codes in the code editing interface and the configured target template codes to generate a Json array;
and the document generation submodule is used for responding to a document generation instruction aiming at the code editing interface and generating a first target document corresponding to the file creation instruction by adopting the Json array.
In an alternative embodiment, the apparatus further comprises:
the document editing module is used for responding to a document editing instruction, and acquiring a second target document corresponding to the document editing instruction and a document code corresponding to the document editing instruction in the second target document;
the document code display module is used for displaying the document code in the code editing interface;
and the document updating module is used for responding to the editing operation aiming at the document code and updating the second target document according to the editing operation.
In an alternative embodiment, the second target document includes a number of pages of the document, the apparatus further comprising:
the document display module is used for displaying the second target document in the code editing interface before the document updating module responds to the editing operation aiming at the document code and updates the second target document according to the editing operation;
the document update module is specifically configured to:
in response to a content selection operation for the second target document, determining a target document page corresponding to the content selection operation, and positioning a page code corresponding to the content selection operation in the target document page in the target code;
and responding to the editing operation aiming at the page code, and updating the second target document according to the editing operation.
In an optional embodiment, the editing interface display module 201 is specifically configured to:
responding to a file creating instruction, and starting an online editing page, wherein the online editing page comprises a plurality of different environment compilers, and each environment compiler corresponds to a preset code editing environment;
responding to the selection operation aiming at the environment compiler, determining a target environment compiler corresponding to the selection operation, adding a target code editing environment corresponding to the target environment compiler in the online editing page, and displaying a code editing interface corresponding to the target code editing environment.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
In addition, an embodiment of the present invention further provides an electronic device, including: the processor, the memory, and the computer program stored in the memory and capable of running on the processor, when executed by the processor, implement each process of the above-mentioned document generation method embodiment, and can achieve the same technical effect, and are not described herein again to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements each process of the above-mentioned document generation method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Fig. 3 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention.
The electronic device 300 includes, but is not limited to: radio frequency unit 301, network module 302, audio output unit 303, input unit 304, sensor 305, display unit 306, user input unit 307, interface unit 308, memory 309, processor 310, and power supply 311. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 3 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 301 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 310; in addition, the uplink data is transmitted to the base station. Typically, 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, and the like. In addition, the radio frequency unit 301 can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user through the network module 302, such as assisting the user in sending and receiving e-mails, browsing web pages, accessing streaming media, and the like.
The audio output unit 303 may convert audio data received by the radio frequency unit 301 or the network module 302 or stored in the memory 309 into an audio signal and output as sound. Also, the audio output unit 303 may also provide audio output related to a specific function performed by the electronic device 300 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 303 includes a speaker, a buzzer, a receiver, and the like.
The input unit 304 is used to receive audio or video signals. The input Unit 304 may include a Graphics Processing Unit (GPU) 3041 and a microphone 3042, and the Graphics processor 3041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 306. The image frames processed by the graphic processor 3041 may be stored in the memory 309 (or other storage medium) or transmitted via the radio frequency unit 301 or the network module 302. The microphone 3042 may receive sounds and may be capable of processing such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 301 in case of the phone call mode.
The electronic device 300 also includes at least one sensor 305, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 3061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 3061 and/or the backlight when the electronic device 300 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 305 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
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, and the Display panel 3061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 307 may be used to receive input numeric or character information and generate key signal inputs 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 referred to as a touch screen, may collect touch operations by a user on or near the touch panel 3071 (e.g., operations by a user on or near the touch panel 3071 using a finger, a stylus, or any suitable object or attachment). The touch panel 3071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 310, and receives and executes commands sent by the processor 310. In addition, the touch panel 3071 may be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 307 may include other input devices 3072 in addition to the touch panel 3071. Specifically, the 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 herein.
Further, the touch panel 3071 may be overlaid on the display panel 3061, and when the touch panel 3071 detects a touch operation on or near the touch panel, the touch operation is transmitted to the processor 310 to determine the type of the touch event, and then the processor 310 provides a corresponding visual output on the display panel 3061 according to the type of the touch event. Although the touch panel 3071 and the display panel 3061 are shown in fig. 3 as two separate components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 3071 and the display panel 3061 may be integrated to implement the input and output functions of the electronic device, which is not limited herein.
The interface unit 308 is an interface for connecting an external device to the electronic apparatus 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 having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. 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 apparatus 300 or may be used to transmit data between the electronic apparatus 300 and the external device.
The memory 309 may be used to store software programs as well as various data. The memory 309 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 309 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 310 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 309 and calling data stored in the memory 309, thereby integrally monitoring the electronic device. Processor 310 may include one or more processing units; preferably, the processor 310 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 310.
The electronic device 300 may further include a power supply 311 (such as a battery) for supplying power to various components, and preferably, the power supply 311 may be logically connected to the processor 310 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the electronic device 300 includes some functional modules that are not shown, and are not described in detail herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that many more modifications and variations can be made without departing from the spirit of the invention and the scope of the appended claims.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present invention, and shall cover the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A method for generating a document, comprising:
responding to a file creating instruction, and displaying a code editing interface corresponding to the file creating instruction;
responding to a template adding operation aiming at the code editing interface, and adding a template general assembly corresponding to the template adding operation in the code editing interface, wherein the template general assembly comprises a plurality of preset template codes;
responding to configuration operation aiming at the preset template code, determining at least one template code to be configured and an attribute code aiming at the template code to be configured, adding the attribute code into the template code to be configured, and generating a target template code corresponding to the template code to be configured;
and performing code analysis on the unconfigured preset template codes and the configured target template codes in the code editing interface to generate a first target document corresponding to the file creating instruction.
2. The method of claim 1, further comprising:
and displaying the preset template code and/or the target template code and the first target document in the code editing interface.
3. The method according to claim 1, wherein the determining 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 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 comprises:
responding to a document attribute configuration operation aiming at the preset template code, determining at least one template code to be configured and a document attribute code aiming at the template code to be configured, adding the document attribute code to the template code to be configured, and generating a first target template code corresponding to the template code to be configured;
wherein the document attribute codes at least comprise one or more codes of document type, document name, document page number and class name.
4. The method according to claim 3, wherein the determining 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 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 comprises:
responding to a style attribute configuration operation aiming at the first target template code, acquiring a style attribute code corresponding to the style attribute configuration operation, adding the style attribute code to the first target template code, and generating a second target template code corresponding to the first target template code;
wherein the style attribute code includes at least one or more codes for characterizing a width attribute, a height attribute, a display type, a container attribute, a font attribute, a color attribute, and a background attribute.
5. The method according to any one of claims 1 to 4, wherein the determining 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 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 comprises:
responding to the style attribute configuration operation aiming at the preset template code and/or the target template code, determining at least one template code to be configured and a style attribute code aiming at the template code to be configured, adding the style attribute code to the template code to be configured, and generating a third target template code corresponding to the template code to be configured.
6. The method according to claim 1, wherein the code parsing the preconfigured template codes and the configured target template codes in the code editing interface to generate a first target document corresponding to the file creation instruction includes:
performing code mapping on the unconfigured preset template codes and the configured target template codes in the code editing interface to generate a Json array;
and responding to a document generation instruction aiming at the code editing interface, and generating a first target document corresponding to the file creation instruction by adopting the Json array.
7. The method of claim 1, further comprising:
responding to a document editing instruction, and acquiring a second target document corresponding to the document editing instruction and a document code corresponding to the document editing instruction in the second target document;
displaying the document code in the code editing interface;
and responding to the editing operation aiming at the document code, and updating the second target document according to the editing operation.
8. The method according to claim 7, wherein the second target document comprises a plurality of pages of the document, and before the responding to the editing operation on the document code and updating the second target document according to the editing operation, the method further comprises:
displaying the second target document in the code editing interface;
the updating the second target document according to the editing operation in response to the editing operation on the document code comprises:
responding to a content selection operation aiming at the second target document, determining a target document page corresponding to the content selection operation, and positioning a page code corresponding to the content selection operation in the target document page in the target code;
and responding to the editing operation aiming at the page code, and updating the second target document according to the editing operation.
9. The method of claim 1, wherein said exposing, in response to a file creation instruction, a code editing interface corresponding to the file creation instruction comprises:
responding to a file creating instruction, starting an online editing page, wherein the online editing page comprises a plurality of different environment compilers, and each environment compiler corresponds to a preset code editing environment;
responding to the selection operation of the environment compiler, determining a target environment compiler corresponding to the selection operation, adding a target code editing environment corresponding to the target environment compiler in the online editing page, and displaying a code editing interface corresponding to the target code editing environment.
10. An apparatus for generating a document, comprising:
the editing interface display module is used for responding to a file creating instruction and displaying a code editing interface corresponding to the file creating instruction;
the general component adding module is used for responding to template adding operation aiming at the code editing interface and adding a template general component corresponding to the template adding operation in the code editing interface, and the template general component comprises a plurality of preset template codes;
the template code configuration module is used for responding to configuration operation aiming at the preset template code, determining at least one template code to be configured and an attribute code aiming at the template code to be configured, adding the attribute code into the template code to be configured and generating a target template code corresponding to the template code to be configured;
and the target document generation module is used for performing code analysis on the unconfigured preset template codes and the configured target template codes in the code editing interface to generate a first target document corresponding to the file creation instruction.
11. 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;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the method of any of claims 1-9.
12. One or more computer-readable storage media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method of any of claims 1-9.
CN202210434872.3A 2022-04-24 2022-04-24 Document generation method and device, electronic equipment and storage medium Pending CN115048919A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210434872.3A CN115048919A (en) 2022-04-24 2022-04-24 Document generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210434872.3A CN115048919A (en) 2022-04-24 2022-04-24 Document generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115048919A true CN115048919A (en) 2022-09-13

Family

ID=83157815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210434872.3A Pending CN115048919A (en) 2022-04-24 2022-04-24 Document generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115048919A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622215A (en) * 2011-01-27 2012-08-01 腾讯科技(深圳)有限公司 Method for editing image-text units based on script
CN110806863A (en) * 2019-11-05 2020-02-18 泰康保险集团股份有限公司 Interface document generation method and device, electronic equipment and storage medium
CN110889270A (en) * 2018-08-16 2020-03-17 阿里巴巴集团控股有限公司 Form page document generation method and form page rendering method and device
CN111767026A (en) * 2020-06-22 2020-10-13 北京百度网讯科技有限公司 Method, device, equipment and medium for generating business object template
CN112558967A (en) * 2020-12-15 2021-03-26 中国建设银行股份有限公司 Page automatic generation method and device, electronic equipment and storage medium
CN113238752A (en) * 2021-05-17 2021-08-10 北京达佳互联信息技术有限公司 Code generation method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622215A (en) * 2011-01-27 2012-08-01 腾讯科技(深圳)有限公司 Method for editing image-text units based on script
CN110889270A (en) * 2018-08-16 2020-03-17 阿里巴巴集团控股有限公司 Form page document generation method and form page rendering method and device
CN110806863A (en) * 2019-11-05 2020-02-18 泰康保险集团股份有限公司 Interface document generation method and device, electronic equipment and storage medium
CN111767026A (en) * 2020-06-22 2020-10-13 北京百度网讯科技有限公司 Method, device, equipment and medium for generating business object template
CN112558967A (en) * 2020-12-15 2021-03-26 中国建设银行股份有限公司 Page automatic generation method and device, electronic equipment and storage medium
CN113238752A (en) * 2021-05-17 2021-08-10 北京达佳互联信息技术有限公司 Code generation method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107943390B (en) Character copying method and mobile terminal
CN110865758B (en) Display method and electronic equipment
CN109451141B (en) Operation control method and related terminal
CN109739402B (en) Fast application processing method and terminal equipment
WO2020199988A1 (en) Content copying method and terminal
CN110995919B (en) Message processing method and electronic equipment
CN111445927B (en) Audio processing method and electronic equipment
CN112116690B (en) Video special effect generation method, device and terminal
WO2020220893A1 (en) Screenshot method and mobile terminal
CN109815462B (en) Text generation method and terminal equipment
US20230015943A1 (en) Scratchpad creation method and electronic device
CN111597772B (en) Data integration method, data integration device and electronic equipment
CN113923515A (en) Video production method and device, electronic equipment and storage medium
CN107885512A (en) A kind of application program installation method, mobile terminal
CN110913261A (en) Multimedia file generation method and electronic equipment
CN111090529B (en) Information sharing method and electronic equipment
CN111124709A (en) Text processing method and electronic equipment
CN109063079B (en) Webpage labeling method and electronic equipment
CN110909180B (en) Media file processing method and electronic equipment
CN106230919B (en) File uploading method and device
US11768998B2 (en) Input box information processing method and electronic device
CN111273827A (en) Text processing method and electronic equipment
CN115904367A (en) Front-end scaffold processing method and device, electronic equipment and storage medium
CN115048919A (en) Document generation method and device, electronic equipment and storage medium
CN112486567B (en) Method and device for sending merging request of codes, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination