Document management method and device, electronic device, computer readable storage medium
By locking and sorting the titles and content of a Markdown document as an array of objects, the inconvenience of managing moving titles is solved, thus improving the convenience and efficiency of document editing.
Patent Information
- Application Number
- CN202211391914.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-08
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-11-08
AI Technical Summary
Markdown documents cannot move their headings when the document is moved, which makes document management inconvenient.
The title to be edited and its corresponding content are locked as an array of objects and managed according to the sorting method of the parent title's array of objects to ensure that the title and content move synchronously, and are set as the first-level title when there is no parent title.
It improves the convenience and efficiency of document management. Titles and content are adjusted synchronously with dragging and dropping. When the hierarchy changes, only the order of the parent titles needs to be adjusted, reducing the complexity of operations.
Smart Images

Figure CN116149630B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a document management method and device, electronic equipment and computer readable storage medium. BACKGROUND
[0002] Markdown language is a lightweight markup language, which allows a document to be written in a readable and writable pure text format, and a Markdown document can be obtained, and the Markdown document can be converted into a structured Hyper Text Markup Language (HTML) document. The HTML document is a help document or a guide document often carried by a software product, and it is difficult to directly write the HTML document, and complex writing skills need to be mastered. Relatively speaking, the Markdown document is easy to write, and therefore, the Markdown document is widely applied to the writing and maintenance of documents of various software products. SUMMARY
[0003] The present disclosure provides a document management method and device, electronic equipment and computer readable storage medium, which can improve the convenience and efficiency of document management.
[0004] In a first aspect, the present disclosure provides a document management method for managing a multi-level document, the method comprising:
[0005] obtaining a to-be-edited title and content corresponding to the to-be-edited title;
[0006] locking the to-be-edited title and the content corresponding to the to-be-edited title in the form of an object array, wherein each to-be-edited title corresponds to an object array;
[0007] in a case where the to-be-edited title has a parent title, sorting the object array of the to-be-edited title according to a sorting manner of the object array of the parent title;
[0008] in a case where the to-be-edited title does not have a parent title, setting the to-be-edited title as a first-level title.
[0009] In a second aspect, the present disclosure provides a document management device for managing a multi-level document, the device comprising:
[0010] an obtaining module configured to obtain a to-be-edited title and content corresponding to the to-be-edited title;
[0011] a locking module configured to lock the to-be-edited title and the content corresponding to the to-be-edited title in the form of an object array, wherein each to-be-edited title corresponds to an object array;
[0012] The sorting module is configured to sort the object array of the title to be edited according to a sorting manner of the object array of the parent title if the title to be edited has the parent title, and set the object array corresponding to the title to be edited as the first level title if the title to be edited does not have the parent title.
[0013] In a third aspect, the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the document management method described above.
[0014] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor / processing core, implements the document management method described above.
[0015] The document management method provided by the embodiments of the present disclosure locks the title to be edited and the content corresponding to the title to be edited in the form of an object array after obtaining the title to be edited and the content corresponding to the title to be edited, so that the content corresponding to the title to be edited moves with the title to be edited when the title to be edited is dragged, and the title to be edited and the content corresponding to the title to be edited are adjusted when the title to be edited is added or deleted, thereby improving the convenience and efficiency of document management; and after locking the title to be edited and the content corresponding to the title to be edited in the form of an object array, the object array of the title to be edited is sorted according to the sorting manner of the object array of the parent title, and the title to be edited is set as the first level title if the title to be edited does not have the parent title, so that when the level of the title to be edited changes, the sorting of the title to be edited can be modified according to the object array of the adjusted parent title, thereby improving the convenience and efficiency of document editing.
[0016] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS
[0017] The accompanying drawings are included to provide a further understanding of the present disclosure and constitute a part of the specification, which together with the embodiments of the present disclosure serve to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent from the detailed description of the specific example embodiments described below, with reference to the drawings in which:
[0018] Figure 1 An application scenario diagram of the document management method and the document management apparatus provided by the embodiments of the present disclosure is provided;
[0019] Figure 2 A flowchart of the document management method provided by the embodiments of the present disclosure is provided
[0020] Figure 3 An editing diagram provided by the embodiments of the present disclosure is provided
[0021] Figure 4 A block diagram of the document management apparatus provided by the embodiments of the present disclosure is provided
[0022] Figure 5 A block diagram of the electronic device provided by the embodiments of the present disclosure is provided. DETAILED DESCRIPTION
[0023] In order for those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to help understanding, and should be considered only as exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, for the sake of clarity and conciseness, the description below omits the description of well-known functions and structures.
[0024] In the case of no conflict, each embodiment of the present disclosure and each feature in the embodiments can be combined with each other.
[0025] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0026] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the terms "comprise" and / or "consist of, when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. The terms "connected" or "coupled" and / or similar terms are not limited to a physical or mechanical connection, but can include an electrical connection, whether direct or indirect.
[0027] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure and will not be interpreted in an overly literal or overly formal sense unless expressly so defined herein.
[0028] The Markdown document is a document edited and generated by using a Markdown language in a software development process. When the Markdown document is stored in a menu tree manner, the Markdown document cannot be moved with the title. For example, when a third-level title is dragged to a second level, the Markdown document corresponding to the title cannot be moved to the second level, which brings great inconvenience to document management.
[0029] Figure 1 An application scenario diagram of the document management method and the document management apparatus provided by the embodiments of the present disclosure is shown in FIG. 1. Figure 1 As shown in FIG. 1, the application scenario of the embodiments of the present disclosure includes a terminal device 101, a network 102 and a server 103. The network 102 is a medium for providing a communication link between the terminal device 101 and the server 103. The network 102 can include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0030] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0031] The terminal device 101 can be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers and desktop computers, etc.
[0032] The server 103 can be a server providing various services, such as a background management server supporting the website browsed by the user using the terminal device 101 (only as an example). The background management server can analyze and process the received user request data, etc., and feed back the processing result (such as a webpage, information or data, etc. obtained or generated according to the user request) to the terminal device.
[0033] It should be noted that the document management method provided by the embodiments of the present disclosure can be executed by the terminal device 101 or the server 103. Accordingly, the document management apparatus provided by the embodiments of the present disclosure can be arranged in the terminal device 101 or the server. It should be noted that the document management method provided by the embodiments of the present disclosure can be executed by the terminal device 101 or the server 103. Accordingly, the document management apparatus provided by the embodiments of the present disclosure can be arranged in the terminal device 101 or the server.
[0034] It should be understood that Figure 1 The number of terminal devices, networks and servers in the above-mentioned system is only illustrative. Any number of terminal devices, networks and servers can be provided according to implementation needs.
[0035] In a first aspect, the document management method provided by the embodiments of the present disclosure can improve the convenience of document editing.
[0036] Figure 2 A flowchart of a document management method provided by the embodiments of the present disclosure is shown in FIG. 2. Referring to FIG. 2, Figure 2 The method is used for managing a multi-level document, and the method comprises the following steps:
[0037] In step S201, a title to be edited and content corresponding to the title to be edited are obtained.
[0038] In the embodiments of the present disclosure, the document is a multi-level document, that is, the document comprises titles of multiple levels, and each level can have multiple titles.
[0039] As shown in FIG. 1, the document comprises a first-level title, a second-level title and a third-level title, wherein “database design” and “interface design” are the first-level titles, “interface specification”, “user interface” and “role interface” are the second-level titles, and belong to the second-level titles of “interface design”. “Request specification” and “response specification” belong to the third-level titles, and belong to the third-level titles of “interface specification”, “all user query interface”, “user modification interface” and “user deletion interface” belong to the third-level titles, and belong to the third-level titles under “user interface”; “all role query interface”, “role modification interface” and “role deletion interface” belong to the third-level titles, and belong to the third-level titles under “role interface”. Figure 3
[0040] The title to be edited contains corresponding content, which can be an explanation and description of the title to be edited, or attributes of the title to be edited, such as fields, types and descriptions. In some embodiments, the content of the title to be edited can be set in the document editing area on the right side for editing. Figure 3
[0041] In the embodiments of the present disclosure, the title to be edited and the content corresponding to the title to be edited can be set by the user himself / herself, and the name of the title to be edited and the specific content are not limited in the embodiments of the present disclosure.
[0042] In step S202, the title to be edited and the content corresponding to the title to be edited are locked in the form of an object array, and each title to be edited corresponds to an object array.
[0043] Locking the title to be edited and its corresponding content as an array of objects means that the title to be edited and its corresponding content are closely related, that is, when the title to be edited is moved, the content corresponding to the title to be edited moves accordingly.
[0044] Among them, the object array refers to the arraying of the title to be edited and the content corresponding to the title to be edited.
[0045] In some embodiments, the object array includes the title's name, content, and identifier, wherein the name represents the name of the title to be edited, the content represents the content corresponding to the title to be edited, and the identifier represents the unique identity of the title to be edited in the document.
[0046] When arraying the content corresponding to the title to be edited and the title to be edited, you can not only associate the title to be edited and the content corresponding to the title to be edited, but also assign an identifier to the title to be edited.
[0047] In some embodiments, the object array further includes an array representing the attributes of subheadings under the heading to be edited. The attributes of the subheadings include information such as the subheading's identifier and number.
[0048] For example, an array of objects can be represented in the following format:
[0049] {"title":"Directory Name","content":"Markdown Content","key":"n0","children":[]}
[0050] The Title field is the name of the title to be edited, the content field is the content of the title to be edited (e.g., Markdown document content), the key represents the identifier of the title to be edited (which is unique in the document), and children is an array whose values are the attributes of the subheadings under the title to be edited.
[0051] In some embodiments, the key can be randomly generated, and the format can be "N00.16-bit random number", such as "N00.8551635471055079". It should be noted that the number of bits in the key is not limited to 16 bits, and can also be other numbers.
[0052] In some embodiments, the key can be used to determine which level of heading the title to be edited belongs to. For example, the number of "16-digit random numbers" can be used to determine which level of heading the title to be edited belongs to.
[0053] For example, to create a second-level heading by adding a subheading under a first-level heading, the second-level heading would be represented as "N00.16-digit random number.16-digit random number", where two 16-digit random numbers are separated by a ".", such as "N00.8551635471055079.8441675491456079". Similarly, to create a third-level heading by adding a subheading under a second-level heading, the third-level heading would be represented as "N00.16-digit random number.16-digit random number.16-digit random number", such as "N00.8551635471055079.8441675491456079.8991675491456078", and so on. The "." in the key indicates the heading level to be edited.
[0054] In some embodiments, the depth of document hierarchy can be limited. For example, the hierarchy depth of a Markdown document can be limited to 6 levels. When the hierarchy depth of a heading in the document reaches level 6, no more subheadings can be added, and the heading can only be modified or deleted.
[0055] When you need to edit the content corresponding to any title in the document, simply select the title to be edited, and an editor will appear. For Markdown documents, a Markdown editor will appear. With the help of the Markdown editor, you can enter the content corresponding to the title to be edited and save it automatically.
[0056] Step S203: If the title to be edited has a parent title, sort the object array of the title to be edited according to the sorting method of the parent title's object array.
[0057] In this context, "parent title" refers to the title above the one being edited, and "subtitle" is the title below the one being edited. The terms "parent title" and "subtitle" are relative. For example... Figure 3 As shown, if the title to be edited is "Interface Specification", then the parent title of "Interface Specification" is "Interface Design"; "Interface Specification" is a subtitle of "Interface Design". If the title to be edited is "Request Specification", then the parent title of "Request Specification" is "Interface Specification", and "Request Specification" is a subtitle of "Interface Specification".
[0058] In this embodiment, each title to be edited corresponds to an object array; that is, regardless of the level of the title to be edited, it can be considered an object array. The object arrays corresponding to the titles to be edited are sorted according to the sorting method of the parent titles. When the position of a title to be edited changes, the sorting of the titles to be edited needs to be adjusted accordingly.
[0059] In some embodiments, the sorting of the object array corresponding to the to-be-edited title is sorted in a menu tree manner. Each first-level title has a sorting number in the first level, and each second-level title includes not only the sorting number of the previous level, but also the sorting number of the second level itself. The sorting of the second-level title is obtained by splicing the sorting number of the previous level and the sorting number of the second level. As shown in FIG. 6, the sorting numbers of the first-level titles "database design" and "interface design" are 01 and 02 respectively, and the sorting of the second-level titles "interface specification", "user interface" and "role interface" in the second level are 01, 02 and 03 respectively. Therefore, the sorting of "interface specification" is 0201, the sorting of "user interface" is 0202, and the sorting of "role interface" is 0203. For "user modification interface", it is in the third level, and the sorting number of "user modification interface" in the third level is 02. The sorting number of the parent title is 0202. Therefore, the sorting number of "user modification interface" is 020202. Figure 3
[0060] In step S204, if the to-be-edited title does not have a parent title, the to-be-edited title is set as a first-level title.
[0061] In the embodiments of the present disclosure, if the to-be-edited title does not have a parent title, the to-be-edited title is considered as a first-level title.
[0062] The document management method provided by the embodiments of the present disclosure locks the to-be-edited title and the content corresponding to the to-be-edited title in the form of an object array after obtaining the to-be-edited title and the content corresponding to the to-be-edited title. Therefore, when the to-be-edited title is dragged, the content corresponding to the to-be-edited title moves with the to-be-edited title. When the to-be-edited title is added or deleted, the to-be-edited title and the content corresponding to the to-be-edited title are adjusted together, thereby improving the convenience of document management. Moreover, after locking the to-be-edited title and the content corresponding to the to-be-edited title in the form of an object array, the object array of the to-be-edited title is sorted according to the sorting manner of the object array of the parent title. In the case that the to-be-edited title does not have a parent title, the to-be-edited title is set as a first-level title. Since the object array of the to-be-edited title is sorted according to the sorting manner of the object array of the parent title, when the level of the to-be-edited title changes, the sorting of the object array corresponding to the to-be-edited title can be modified according to the adjusted object array of the parent title, thereby improving the convenience of document editing.
[0063] In some embodiments, after locking the to-be-edited title and the content corresponding to the to-be-edited title in the form of an object array, the method further includes: converting the object array corresponding to the to-be-edited title into a string; and storing the string corresponding to the to-be-edited title.
[0064] The format of the string is not limited in the embodiments of the present disclosure, for example, the string can be a json string. When converted into a string, the object array corresponding to each title to be edited is a conversion object, that is, each object array is converted into a string and stored in the form of a string. Relative to the form of the menu tree, the string is beneficial to the storage of the document and can save storage space.
[0065] In the embodiments of the present disclosure, the string corresponding to the title to be edited can be stored in the terminal device or in the server.
[0066] In some embodiments, after storing the string corresponding to the title to be edited, the method further includes: converting the string corresponding to each title to be edited in the document into an object array in response to an instruction of editing the document; traversing each object array to obtain the name, content and identifier of the title to be edited corresponding to each object array; splicing the name of the title to be edited and the content of the title to be edited; determining the level of the title to be edited through the identifier of the title to be edited, and determining the number of identifiers based on the level of the title to be edited; adding the identifiers in front of the name of the title to be edited to obtain a document corresponding to the title to be edited.
[0067] When the document is edited, the string corresponding to each title to be edited in the document is first converted into an object array, then each object array is traversed to obtain the name, content and identifier of the title to be edited corresponding to each object array, the name of the title to be edited and the content of the title to be edited are spliced, and the number of identifiers can be determined through the identifier of the title to be edited, and the identifiers are added in front of the name of the title to be edited. The form of the identifier is not limited in the embodiments of the present disclosure. For example, the identifier can be “#”.
[0068] In some embodiments, the identifier of the title to be edited is used to determine the level of the title to be edited, and the number of “.” in the identifier of the title to be edited is the level of the title to be edited, and the number of “#” is the number of identifiers. For example, the first level title is represented by “#name”, the second level title is represented by “##name”, the third level title is represented by “###name”, and so on, and then the document is generated by recursive processing.
[0069] For example, if the identifier of the title to be edited is “N00.8551635471055079.8441675491456079.8991675491456078”, the name of the title to be edited is “request range”, and the identifier of the title to be edited contains three “.”, it is determined that the title to be edited is a third level title, and therefore, the document corresponding to the title to be edited is “###request range”.
[0070] The specific form of editing is not limited in the embodiments of the present disclosure. For example, the editing includes operations such as adding, deleting, and modifying.
[0071] In the embodiments of the present disclosure, the document is a Markdown document, and can also be another form of text document.
[0072] In some embodiments, after splicing the name and content corresponding to each object array and adding an identifier in front of the name to obtain the document corresponding to the object array, the method further includes: converting the Markdown document into a Hyper Text Markup Language document; and sending the Hyper Text Markup Language document to a display device, where the display device is configured to display the Hyper Text Markup Language document.
[0073] The Markdown document cannot be directly displayed in a webpage, and therefore, the Markdown document needs to be converted into a Hyper Text Markup Language document (html) that is convenient for display in a webpage.
[0074] In some embodiments, the Markdown document can be generated layer by layer through the hierarchy of the titles in the document. For example, the Markdown document corresponding to the first-level title is generated, and the Markdown document corresponding to the second-level title is generated. When a certain level includes multiple to-be-edited titles, the Markdown documents corresponding to the multiple to-be-edited titles can be generated in parallel.
[0075] After the Markdown document is converted into the Hyper Text Markup Language document, the Hyper Text Markup Language document is sent to a display device, and the display device is configured to display the Hyper Text Markup Language document. The present disclosure does not limit the position of the display device. For example, the display device can be a display device used by a user terminal, or can be independent of the display device used by the terminal.
[0076] The user views the Markdown document through the display device, and edits the Markdown document with the aid of the display device.
[0077] In some embodiments, before the to-be-edited title and the content corresponding to the to-be-edited title are obtained, the method further includes: creating a document template based on an initial object array, where the initial object array is an object array created according to the type of the document; and the document template is a template used for editing the document.
[0078] Before the document is created, a document template is created, the title and the content are edited in the document template, and finally the required document is generated. The document includes different types, such as a pure text document and a document with a table. Different types of documents use different document templates.
[0079] The step of creating the document template includes: creating an initial object array, which is created according to the type of the document. Then the document template is loaded on the page of the display device, and the document template is generated. The disclosure embodiments do not limit the creation manner of the initial object array. For example, the initial object array can be created by a javascript language to create an object array, and the object array is taken as the document template. For example, the document template can be according to the class name [] array name = new class name [array length], and the default value of the document template can be "null".
[0080] After the document template is generated, the user can edit the document in the document template. For example, when a to-be-edited title is added, the to-be-edited title is added in the document template, and then the to-be-edited title is converted into an object array. When the content of the to-be-edited title is added, the to-be-edited title can be selected first, the specific content is written, the to-be-edited title and the content corresponding to the to-be-edited title are locked in the form of an object array, and then the corresponding string is converted and saved.
[0081] In some embodiments, when the user completes the document editing, the name of the to-be-edited title, the level of the to-be-edited title and the content corresponding to the to-be-edited title are locked. After being locked, the name of the to-be-edited title and the level of the to-be-edited title are fixed and cannot be modified. When the document needs to be modified, the document needs to be unlocked to make the document enter the editable state again.
[0082] In some embodiments, the document further includes a verification rule of the content format of the document in addition to the name of the to-be-edited title, the level of the to-be-edited title and the content corresponding to the to-be-edited title. When the document is locked, the verification rule is also locked. The verification rule is used to verify the content format of the document. The disclosure embodiments do not limit the verification rule. For example, when the content under the to-be-edited title is a table, the verification rule is used to verify whether the document content conforms to the table form. If not, it indicates that the document format does not conform to the verification rule under the to-be-edited title, and the document cannot be saved. If yes, the document can be saved. For another example, the verification rule is that the content under the to-be-edited title cannot be empty, or the content of the to-be-edited title cannot be less than or more than a preset number of characters.
[0083] It should be noted that the to-be-processed title and the content corresponding to the to-be-processed title are different attributes of the same title object. The to-be-edited title, the content corresponding to the to-be-edited title and the verification rule have a corresponding relationship. The to-be-edited title can determine the content corresponding to the to-be-edited title and the verification rule. If the to-be-edited title has a sub-title, the sub-title under the to-be-edited title can also be determined.
[0084] The disclosure embodiments do not limit the creation manner of the initial document. For example, the initial document can be created in a Markdown editor, and only one level can be created.
[0085] In some embodiments, after locking the title to be edited and the content corresponding to the title to be edited in the form of an object array, the method includes: receiving a hierarchy adjustment instruction; wherein the hierarchy adjustment instruction includes the title to be edited and a target position; and reordering the object array corresponding to the title to be edited according to the object array of the parent title corresponding to the target position.
[0086] In this embodiment of the disclosure, when the level of the title to be edited changes, since the title to be edited and the content corresponding to the title to be edited are locked, the content corresponding to the title to be edited moves along with the title to be edited when the title to be edited is moved.
[0087] For example, such as Figure 3 As shown, when the second-level title "User Interface" is moved to the first-level title, the order of "User Interface" changes from 0202 to 03. When the second-level title "User Interface" is moved to the third-level title and becomes a subtitle of "Interface Specification", the order of "User Interface" changes from 0202 to 020103.
[0088] In some embodiments, when the level of the title to be edited changes, the identifier of the title to be edited also changes, that is, the identifier of the title to be edited matches the level of the changed title to be edited. The specific form of the identifier of the title to be edited is not limited in the embodiments of this disclosure. For example, a 16-bit random number (N00) can be used to represent the identifier of the title to be edited. Each level of the title to be edited is represented by a 16-bit random number; one 16-bit random number indicates that the title to be edited is at the first level, two 16-bit random numbers indicate that the title to be edited is at the second level, and three 16-bit random numbers indicate that the title to be edited is at the third level.
[0089] For example, when dragging the title to be edited from a third-level title to a second-level title, if the title's identifier at the third level is "N00.8551635471055079.8441675491456079.8991675491456078", after dragging it to the second-level title, it becomes "N00.8551635471055079.8441675491456079". For example, when the title to be edited is dragged from the first level to the third level, the identifier of the title to be edited at the second level changes from "N00.8551635471055079" to "N00.8551635471055079.8441675491456079.8991675491456078".
[0090] It can be understood that the above-mentioned various method embodiments mentioned in the disclosure can be combined with each other to form combined embodiments without deviating from the principle logic. Limited by the length of the disclosure, the disclosure will not be described again. Those skilled in the art can understand that in the above-mentioned method of the specific embodiment, the specific execution order of each step should be determined according to its function and possible internal logic.
[0091] In a second aspect, the disclosure provides a document management device for managing multi-level documents. The document management device can improve the convenience of document editing.
[0092] Figure 4 A block diagram of a document management device according to an embodiment of the disclosure is shown in FIG. 4. As shown in FIG. 4, the document management device 400 includes: Figure 4
[0093] The acquisition module 401 is configured to acquire a to-be-edited title and content corresponding to the to-be-edited title.
[0094] The locking module 402 is configured to lock the to-be-edited title and the content corresponding to the to-be-edited title in the form of an object array, wherein each to-be-edited title corresponds to an object array.
[0095] The sorting module 403 is configured to sort the object array corresponding to the to-be-edited title according to the sorting manner of the object array of the parent title if the to-be-edited title has a parent title, and set the object array corresponding to the to-be-edited title as a first-level title if the to-be-edited title does not have a parent title.
[0096] In some embodiments, the document management device further includes:
[0097] The receiving module is configured to receive a level adjustment instruction, wherein the level adjustment instruction includes a to-be-edited title and a target position.
[0098] The sorting module is further configured to re-sort the object array corresponding to the to-be-edited title according to the object array of the parent title corresponding to the target position.
[0099] In some embodiments, the document management device further includes:
[0100] The creating module is configured to create a document template based on an initial object array, wherein the initial object array is an object array created according to the type of the document, and the document template is a template used for editing the document.
[0101] In some embodiments, the document management device further includes:
[0102] The converting module is configured to convert the object array corresponding to the to-be-edited title into a string.
[0103] The storage module is configured to store a character string corresponding to the title to be edited.
[0104] In some embodiments, the document management apparatus further comprises:
[0105] The conversion module is further configured to convert the character string corresponding to each title to be edited in the document into an object array in response to an instruction to edit the document.
[0106] The acquisition module is configured to traverse each object array and acquire a name, content and identifier of the title to be edited corresponding to each object array.
[0107] The splicing module is configured to splice the name of the title to be edited and the content of the title to be edited.
[0108] The determination module is configured to determine a level of the title to be edited by using the identifier of the title to be edited, and determine a number of identifiers based on the level of the title to be edited.
[0109] The obtaining module is further configured to add the identifiers in front of the name of the title to be edited to obtain a document corresponding to the title to be edited.
[0110] In some embodiments, the document management apparatus further comprises:
[0111] The conversion module is further configured to convert the Markdown document into an Hyper Text Markup Language document.
[0112] The sending module is configured to send the Hyper Text Markup Language document to a display apparatus, and the display apparatus is configured to display the Hyper Text Markup Language document.
[0113] The document management apparatus provided by the embodiments of the present disclosure can lock the title to be edited and the content corresponding to the title to be edited in the form of an object array after the acquisition module acquires the title to be edited and the content corresponding to the title to be edited, so that the content corresponding to the title to be edited moves with the title to be edited when the title to be edited is dragged, and the title to be edited and the content corresponding to the title to be edited are adjusted when the title to be edited is added or deleted, thereby improving the convenience of document management. Moreover, after the title to be edited and the content corresponding to the title to be edited are locked in the form of an object array, the sorting module sorts the object array corresponding to the title to be edited according to the sorting mode of the object array of the parent title. In the case where the title to be edited does not have a parent title, the title to be edited is set as a first-level title. Since the sorting of the object array of the title to be edited is performed according to the sorting mode of the object array of the parent title, when the level of the title to be edited changes, the sorting of the object array corresponding to the title to be edited can be modified according to the adjusted object array of the parent title, thereby improving the convenience of document editing.
[0114] Figure 5A block diagram of an electronic device according to an embodiment of the present disclosure is provided.
[0115] With reference to Figure 5 According to an embodiment of the present disclosure, an electronic device is provided, which includes: at least one processor 501; at least one memory 502, and one or more I / O interfaces 503 connected between the processor 501 and the memory 502; wherein the memory 502 stores one or more computer programs executable by the at least one processor 501, and the one or more computer programs are executed by the at least one processor 501 to enable the at least one processor 501 to perform the above-mentioned document management method.
[0116] According to an embodiment of the present disclosure, a computer readable storage medium is provided, which stores a computer program, wherein the computer program, when executed by a processor / processing core, implements the above-mentioned document management method. The computer readable storage medium can be a volatile or non-volatile computer readable storage medium.
[0117] According to an embodiment of the present disclosure, a computer program product is provided, which includes computer readable code, or a non-volatile computer readable storage medium carrying computer readable code, and when the computer readable code is run in a processor of an electronic device, the processor in the electronic device performs the above-mentioned document management method.
[0118] Those skilled in the art can understand that all or some of the steps in the above disclosed method, the functions of the modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations. In the hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be performed by several physical components in cooperation. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer readable storage medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media).
[0119] As those skilled in the art will appreciate, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable program instructions, data structures, program modules or other data. Computer storage media include, but are not limited to, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Further, as those skilled in the art will appreciate, communication media typically embodies computer readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. As used herein, the term "exemplary" means serving as an example, instance, or illustration. Any implementation described herein as exemplary is not necessarily to be construed as preferred or advantageous over other implementations.
[0120] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.
[0121] Computer readable program instructions for carrying out operations of the present disclosure can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state setting data, or any combination of one or more of the above in any combination, written in any combination of one or more programming languages, including object oriented programming languages such as Smalltalk, C++ or the like, and conventional procedural programming languages such as "C" or the like. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.
[0122] The computer program product described herein can be embodied in a specific manner by hardware, software, or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium. In another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), and the like.
[0123] The various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer readable program instructions.
[0124] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include a non-transitory computer readable storage medium that can be a computer- readable storage medium having no data storage cycles that change state. The instructions can be executed by one or more processors of a computer, other programmable data processing apparatus, or other devices to produce a computer-implemented process such that the instructions which execute via the one or more processors of the computer or other programmable data processing devices create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0125] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0126] The flow and block diagrams in the drawings show architectural, functional, and operational aspects of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow and block diagrams can represent a module, a segment, or a portion of instructions which comprise one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may
[0127] Example embodiments have been disclosed and, although a specific terminology is employed, it is merely for the convenience of the reader and is not intended to be limiting. In some instances, specific details have been included for the purpose of providing a thorough understanding of the embodiments presented, but it will be apparent to those skilled in the art that embodiments of the application can be practiced without these specific details. In some instances, features, characteristics and / or elements described in connection with a particular embodiment can be used in conjunction with, or switched to, features, characteristics and / or elements described in connection with other embodiments, unless otherwise explicitly stated. Accordingly, it will be understood that various changes in form and details can be made without departing from the scope of the disclosure as set forth in the appended claims.
Claims
1. A document management method characterized by, A method for managing a multi-level document, the method comprising: obtaining a to-be-edited title and content corresponding to the to-be-edited title; locking the to-be-edited title and the content corresponding to the to-be-edited title in the form of an object array, wherein each to-be-edited title corresponds to an object array; in a case where the to-be-edited title has a parent title, sorting the object array of the to-be-edited title according to the sorting manner of the object array of the parent title; in a case where the to-be-edited title does not have a parent title, setting the to-be-edited title as a first-level title; converting the object array corresponding to the to-be-edited title into a string; storing the string corresponding to the to-be-edited title; in response to an instruction to edit the document, converting the string corresponding to the to-be-edited title in the document into an object array, and obtaining the document corresponding to the to-be-edited title based on the object array.
2. The method of claim 1, wherein, After the locking of the to-be-edited title and the content corresponding to the to-be-edited title in the form of an object array, the method further comprises: receiving a level adjustment instruction, wherein the level adjustment instruction comprises the to-be-edited title and a target position; re-sorting the object array of the to-be-edited title according to the object array of the parent title of the target position.
3. The method of claim 1, wherein, Before the obtaining of the to-be-edited title and the content corresponding to the to-be-edited title, the method further comprises: creating a document template based on an initial object array, wherein the initial object array is an object array created according to the type of the document, and the document template is a template used for editing the document.
4. The method according to any one of claims 1 to 3, characterized in that, The object array comprises a name of a title, content, and an identifier, wherein the name is used to represent the name of the to-be-edited title, the content is used to represent the content corresponding to the to-be-edited title, and the identifier represents the identity of the to-be-edited title in the document.
5. The method of claim 1, wherein, The obtaining of the document corresponding to the to-be-edited title based on the object array comprises: traversing each object array to obtain the name, content, and identifier of the to-be-edited title corresponding to the object array; splicing the name of the to-be-edited title and the content of the to-be-edited title; determining the level of the to-be-edited title through the identifier of the to-be-edited title, and determining the number of identifiers based on the level of the to-be-edited title; adding an identifier before the name of the to-be-edited title to obtain the document corresponding to the to-be-edited title.
6. The method of claim 5, wherein, The document is a Markdown document. After the adding of the identifier before the name of the to-be-edited title to obtain the document corresponding to the to-be-edited title, the method further comprises: converting the Markdown document into a HyperText Markup Language document; sending the HyperText Markup Language document to a display device, wherein the display device is used to display the HyperText Markup Language document.
7. A document management apparatus characterized by comprising: A method for managing a multi-level document, the method comprising: an obtaining module, configured to obtain a to-be-edited title and content corresponding to the to-be-edited title; a locking module, configured to lock the to-be-edited title and the content corresponding to the to-be-edited title in the form of an object array, wherein each to-be-edited title corresponds to an object array; The sorting module is configured to sort the object array of the title to be edited according to a sorting manner of the object array of the parent title if the title to be edited has the parent title; and set the object array corresponding to the title to be edited as a first level title if the title to be edited does not have the parent title. The converting module is configured to convert the object array corresponding to the title to be edited into a string. The storage module is configured to store the string corresponding to the title to be edited. The obtaining module is configured to convert the string corresponding to each title to be edited in the document into an object array in response to an instruction of editing the document, and obtain the document corresponding to the title to be edited based on the object array.
8. An electronic device, comprising: Comprise: At least one processor; And The memory is in communication connection with the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to execute the document management method in any one of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the document management method in any one of claims 1-6.
Citation Information
Patent Citations
Document editing method, document editing system and computer storage medium
CN112100989A