CN112527738A - Project description file optimization method, system and storage medium - Google Patents

Project description file optimization method, system and storage medium Download PDF

Info

Publication number
CN112527738A
CN112527738A CN202011561981.9A CN202011561981A CN112527738A CN 112527738 A CN112527738 A CN 112527738A CN 202011561981 A CN202011561981 A CN 202011561981A CN 112527738 A CN112527738 A CN 112527738A
Authority
CN
China
Prior art keywords
directory
project
file
markdown
description file
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
CN202011561981.9A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011561981.9A priority Critical patent/CN112527738A/en
Publication of CN112527738A publication Critical patent/CN112527738A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to big data processing technology, and discloses a project description file optimization method, which comprises the steps of obtaining and analyzing a Markdown description file in a project database through a script file; generating a directory structure according to the project directory structure information of the Markdown description file; reading file directory information of the project database according to a project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure; and inserting the obtained directory tree structure into the Markdown description file according to the corresponding relation between the directory structure and the project directory structure information of the Markdown description file. The invention also relates to a block chain technology, and the data is stored in the block chain.

Description

Project description file optimization method, system and storage medium
Technical Field
The invention relates to a big data processing technology, in particular to a project description file optimization method, a project description file optimization system and a storage medium.
Background
Project description files are often viewed in project databases as declarative documents by participating developers. The item description file stores information such as a file directory of the item. In the process of project development, information such as a file directory in an original project description file needs to be optimized. The directory information change of the existing project description file is completed by manual input. The drawbacks of manual input are as follows:
1. firstly, manually compiling a tree-shaped directory text, then manually copying, and then adding a directory information description;
2. when the item catalog is changed, the item catalog needs to be manually updated;
3. if the item is not updated timely, a call error is easily caused.
Therefore, a directory optimization method for project description files with high automation degree and good flexibility is needed.
Disclosure of Invention
The invention provides a project description file optimization method, a project description file optimization system and a computer readable storage medium, which mainly solve the problem of low project description file updating efficiency.
In order to achieve the above object, the present invention provides a method for optimizing a project description file, which is applied to an electronic device, and the method includes:
acquiring and analyzing a Markdown description file in a project database through a preset script file; the Markdown description file comprises project directory structure information;
generating a directory structure according to the project directory structure information of the Markdown description file;
reading file directory information of the project database according to a project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure;
and inserting the obtained directory tree structure into the Markdown description file according to the corresponding relation between the directory structure and the project directory structure information of the Markdown description file.
Further, preferably, the preset script file is a shell script read.
Further, preferably, before the step of acquiring and analyzing the Markdown description file in the project database by using the preset script file, the method further comprises a step of judging whether the project database has the Markdown description file;
when the Markdown description file does not exist in the project database, the script file generates a standard directory structure according to a standard template;
reading file directory information of the project database according to a project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure;
and forming a Markdown description file by using the standard directory structure and the obtained directory tree structure.
Further, preferably, the method for reading the file directory information of the project database according to the project root directory of the project database includes:
dividing files of the project database into directory files and non-directory files through find commands;
traversing folders of the directory files and files under the folders according to an item root directory of the item database;
acquiring the file type and the top annotation information of the file;
and carrying out one-to-one correspondence on the folders, the files, the file types and the top annotation information to obtain the file directory information of the project database.
Further, preferably, the item directory structure information of the Markdown description file includes an item directory and item directory description information; wherein the project catalog specification information corresponds to top annotation information for files of the project database; the top annotation information is obtained by means of a exact-docgen extraction.
Further, preferably, before the step of acquiring and analyzing the Markdown description file in the project database by using the preset script file, the trigger call to the script file is realized by using a VS code hook.
In order to achieve the above object, the present invention provides a project description file optimization system, which includes a description file obtaining unit, a directory structure generating unit, a directory tree structure generating unit, and a description file optimization unit; wherein the content of the first and second substances,
the description file acquisition unit is used for acquiring and analyzing a Markdown description file in the project database through a preset script file; the Markdown description file comprises project directory structure information;
the directory structure generation unit is used for generating a directory structure according to the project directory structure information of the Markdown description file;
the directory tree structure generating unit is used for reading file directory information of the project database according to a project root directory of the project database and obtaining a directory tree structure according to the file directory information and the directory structure;
and the description file optimization unit is used for inserting the obtained directory tree structure into the Markdown description file according to the corresponding relation between the directory structure and the project directory structure information of the Markdown description file.
Further, it is preferable that the system further includes a description file determination unit, where the description file determination unit is configured to determine whether a Markdown description file exists in the project database;
when the Markdown description file does not exist in the project database, the script file generates a standard directory structure according to a standard template;
reading file directory information of the project database according to a project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure;
and forming a Markdown description file by using the standard directory structure and the obtained directory tree structure.
To achieve the above object, the present invention also provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores a program executable by the at least one processor, the program being executable by the at least one processor to enable the at least one processor to perform the project description file optimization method as described above.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium storing a computer program, which when executed by a processor, implements the steps of the above project description file optimization method.
According to the project description file optimization method, the project description file optimization system, the electronic device and the computer readable storage medium, the Markdown description file is automatically read to obtain the directory structure of the project through the script file preset in the project database, all files of the project are read, and the directory tree structure is constructed; and finally, inserting the formed directory tree structure into the Markdown description file, and further completing the optimization of the project description file of the project. The beneficial effects are as follows:
1) according to the project description file optimization method, the tree structure directory is automatically stored in the Markdown description file through the script file, the stored directory does not need to be manually or manually selected, the data uploading efficiency is greatly improved, and the development time is saved;
2) aiming at projects without Markdown description files, a universal project description document can be automatically generated according to an initialization template in a script file, and the complicated process of manually adding project descriptions is avoided;
3) after the catalog of the project is changed, the script file can update the corresponding catalog item in the Markdown description file by acquiring the catalog information of the file in the project, so that the problem that the catalog of the existing project description file needs to be manually updated is solved;
4) the project information can be known more quickly and accurately, and the technical effects of improving the readability and maintainability of the project are achieved.
Drawings
FIG. 1 is a flow chart of an embodiment of a project description file optimization method of the present invention;
FIG. 2 is a schematic diagram of the logical structure of the project description file optimization system of the present invention;
FIG. 3 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In order to improve the development efficiency of users, the invention provides a project description file optimization method. FIG. 1 shows a flow of an embodiment of the project description file optimization method of the present invention. Referring to fig. 1, the method may be performed by an apparatus, which may be implemented by software and/or hardware.
The method comprises the steps of automatically reading a Markdown description file to obtain a directory structure of a project through a script file preset in a project database, reading all files of the project and constructing a directory tree structure; and finally, inserting the formed directory tree structure into the Markdown description file, and further completing the optimization of the project description file of the project.
The project description file optimization method comprises the following steps: step S110-step S140.
S110, acquiring and analyzing a Markdown description file in a project database through a preset script file; the Markdown description file comprises project directory structure information type information.
Markdown is a markup language that can be written using a plain text editor, which enables plain text content to be formatted by a simple markup grammar. In a specific implementation, the Markdown profile is the readem. In a typical project database, there is a READEM.md file that is viewed by participating developers as an explanatory document. The README file suffix name is md. md is an abbreviation for markdown.
Specifically, the Markdown description file includes item directory structure information and item description class information; wherein the item directory structure information includes an item directory and item directory description information; and the project description information comprises project architecture information and project operation and construction information.
In a specific embodiment, the preset script file is a shell script read.
Specifically, the script file is a shell script, and a shell file readme. The Shell language is an alternative for technical implementation, and the function can also be implemented by technologies such as JAVA, NodeJS and the like.
The script file specifically refers to the JS code. The JS code is Javascript, which is a script language (file) developed by LiveScript of Netscape, and is mainly used for solving the problem of server terminal language. More specifically, the created script file is specifically: js, which can be recognized by an arbitrary web page, or, can open the script file through an arbitrary web page. In step S1, the script file is specifically a shell script file including a synchronization command, and the suffix name of the shell script file is "sh". More specifically, the script file is a shell script readme.sh containing an READMEM.md file analysis command.
And acquiring and analyzing a Markdown description file in the project database through the shell script, and acquiring the Markdown file through the mark in the actual script file execution process. Besides the acquisition and analysis actions, some integration processing is also carried out on the contents of the Markdown file, such as adding line feed, removing special characters and the like.
Taking the code warehouse directory of a certain item A as an example: readem. md (Markdown description file) added by the code warehouse root directory as an explanatory document for viewing by participating developers. The treelike directory and directory descriptions are generated in a READEM.md file using a base Shell description. In this embodiment, the project database is a code repository; and the script file is the shell file readme. The Markdown description file is an README.md file; and acquiring the READMEM.md file through the shell file readme.sh, and acquiring the item directory structure information in the READMEM.md file.
And S120, generating a directory structure according to the project directory structure information of the Markdown description file.
And regenerating a mirrored item directory structure according to the item directory structure information of the Markdown description file READMEM.md acquired by the script file.
Specifically, a script file readme.sh is operated firstly, and project directory structure information of a Markdown description file is obtained through the script file; and then obtaining an item directory structure according to the item directory structure information of the acquired Markdown description file, and then filling the corresponding file directory information by taking the item directory structure as a frame.
The item directory structure information of the Markdown description file comprises an item directory structure and item directory description information. In the step 120, only the item directory structure in the item directory structure information of the Markdown description file is extracted, and then the script file generates a mirrored item directory structure as the directory structure according to the item directory structure. The generated directory structure is stored in JSON.
The specific mode for generating the directory structure is a Tree command or a find under mac to simulate the Tree command. Exemplary, the following:
$find.-print|sed-e's;[^/]*/;|____;g;s;____|;|;g'
s130, reading file directory information of the project database according to the project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure.
The file directory information comprises a file name, a file type and a file top annotation, and the file top annotation of the project database corresponds to the project directory description information in the Markdown description file.
In a specific embodiment, the method for reading the file directory information of the project database according to the project root directory of the project database includes:
s131, dividing the files of the project database into directory files and non-directory files through find commands;
s132, traversing folders of the directory files and files under the folders according to the project root directory of the project database;
s133, acquiring the file type and the top annotation information of the file;
and S134, carrying out one-to-one correspondence on the folders, the files, the file types and the top annotation information to obtain the file directory information of the project database.
Specifically, files under each layer of directory are divided into directory files and non-directory files; performing recursive processing by searching the directory file by using a find command; then processing the final traversal result; by directly distinguishing directory files from non-directory files, the processing of the non-directory files can be unified, correct information can be obtained, and efficiency can be improved.
In the specific implementation process, the method is realized by the following related commands: 1) a find command; the find command is a relatively common search command, and only the search directory function in the find command is utilized in the method. Such as: find directory-maxdepth 1-type d | sed '1 d'; the meaning of the statement find segment is to search all directory files under the current-layer directory, and sed '1d' is to process the first invalid information of the search result. 2) An ls command; the ls command is a conventional display file information command, and its rich search attributes provide a basis for this. Such as: ls-al directory | sed-r "1 d; /[ lambda ] d/d; /[ lambda ] l/d; "; the meaning of the statement ls segment is to acquire information, sed-r' 1d, for all files in the current-layer directory; /[ lambda ] d/d; /[ lambda ] l/d; "is to mask the first invalid information in the result, and the directory file and the link file. 3) Executing commands in parallel by the background; (scandir $ 1; echo 1> > lflag. txt) &) in which the directories under the first layer directory are recursively queried and run in the background, the sub-directories are executed in parallel, rather than serial processing that must be completed before and then executed after.
Each file name, file type, and file top note are read from the project root directory, wherein each file top note corresponds to "project directory specification information", that is, "project directory specification information" is generated by reading the "file top note". The method for obtaining the top annotation of the file comprises the steps of extracting the annotation through the act-docgen, judging the initial position of the annotation content through the annotation symbol keyword, and intercepting content characters in the initial position to obtain the annotation content.
The method comprises the following steps of splicing all top annotation contents of folders, files under the folders and files which correspond one to one according to a certain character output format (if a symbol is used for representing a hierarchical relationship and is used for describing the hierarchical relationship of the contents in the folders and the folders, and the read file names and the top annotation contents of the files are spliced to form a laminated content description so as to achieve the purpose of describing information), and forming tree-structure characters; and filling the tree structure character into the directory structure obtained in the step S120 to finally obtain the directory tree structure.
And S140, inserting the obtained directory tree structure into the Markdown description file according to the corresponding relation between the directory structure and the project directory structure information of the Markdown description file.
That is, the directory structure information of the acquired Markdown description file is associated with the previously generated directory structure.
Md files are initialized with annotation syntax for the start and end locations of the "project directory structure" module (which is displayed when the annotation syntax is no longer previewed and can be used to mark the start and end locations of the module). The Shell command matches the start and end positions of the module for insertion and updating.
For example:
based on the comment grammar in MarkDown being <! -annotating content- - >. Mde files automatically hide the annotation part when actually viewed. Shell can recognize the comment section in the source file, but the comment section will be automatically hidden when viewed. Thus, the aim of identifying the item directory structure is achieved, and the display cannot be interfered. The contents of the annotated part of the program are usually not compiled by the computer. MarkDown also fits this feature, and the content in the source code inside the comment block is not displayed for preview.
And then, inserting the constructed directory tree structure into the corresponding position of the Markdown description file according to the matching result of the directory structure and the directory structure information.
Specifically, by matching the generated directory structure with the directory structure information of the Markdown description file; that is to say that the matching positions have already been matched to one another; then, the character content of the directory tree structure constructed by the directory structure generated in step S130 is inserted into the pre-matched position. That is, through the shell script file, the automatic update of the catalog of the Markdown description file in the project database can be realized, and the optimization process of the project description file is further completed. Therefore, when the item directory is changed, if the item is not updated timely, a calling error easily caused is avoided.
In a specific embodiment, before the step of obtaining and parsing the Markdown description file in the project database through the preset script file, the method further includes a step S100 of determining whether the Markdown description file exists in the project database. S101, when the Markdown description file does not exist in the project database; s102, the script file generates a standard directory structure according to a standard template; s103, reading file directory information of the project database according to a project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure; and S104, forming a Markdown description file by the standard directory structure and the obtained directory tree structure.
That is, in a specific implementation, it is first determined whether README.md is already present; creating README.md in the root directory if the root directory does not exist; the "item directory structure" portion of the READEADME. md file is updated if it exists.
And initializing the content in the READMEM.md according to the configuration when the new READMEM.md is created. The configuration file can be written directly in the readme.sh according to different configurations required by the project, and can also be newly added and read by the readme.sh for analysis. At least one set of preset directory template is contained in the script file, whether READMEM.md exists or not is judged, and whether the existing file of the component module is referred or not is determined; in the case where there is an existing file referencing the component module, the contents referencing the associated directory path and name are automatically updated.
An exemplary implementation of determining whether readem. md is already present is as follows:
shell command judges whether the file exists or not, and if the file does not exist, the file is created
if[!-d"/README.md"];then
mkdir-p/README.md
fi
Still take the code warehouse directory of a certain item A as an example, initialize the code warehouse directory into "environment information" and "item directory structure" to introduce two major modules. Sub-modules can be subdivided under the environment information, such as project building information, operation information and construction information.
Md is already existed, only the procedure continues to execute steps S120-S140, and the "item directory structure" module therein is updated.
In the actual execution process, a variable can also be transmitted into the shell script file readme. And judging whether the shell script file is a new READMEM.md file or only updating a 'project directory structure' module in the READMEM.md according to the input variable. That is to say, the shell script file readme.sh can automatically determine whether the imported Markdown description file is newly created or only update the "item directory structure" module in the original Markdown description file read.
In a specific embodiment, before the step of acquiring and analyzing the Markdown description file in the project database through the preset script file, the trigger call to the script file is realized through a VS code hook.
The specific method for realizing the triggering call of the script through the VS code hook comprises the following steps: the user can select a text file containing a command line of the script file in the preset directory and open the text file through the VS Code, namely, input an open instruction.
When an opening instruction is detected, displaying text content in a target file opened by a user through VS Code. The method mainly comprises the step of opening the text file through VS Code, and the opened text file can be used as a target text file. And the text content in the target text file is the readme.sh script under the item root directory of the running script file.
According to the project description file optimization method, the tree structure directory is automatically stored in the Markdown description file through the script file, the stored directory does not need to be manually or manually selected, the data uploading efficiency is greatly improved, and the development time is saved; aiming at projects without Markdown description files, a universal project description document can be automatically generated according to an initialization template in a script file, and the technical effect of avoiding the complicated process of manually adding project descriptions is achieved.
FIG. 2 is a schematic diagram of the logical structure of the project description file optimization system of the present invention; as shown with reference to fig. 2.
In order to achieve the above object, the present invention provides a project description file optimization system 200, which includes a description file obtaining unit 210, a directory structure generating unit 220, a directory tree structure generating unit 230, and a description file optimization unit 240; wherein the content of the first and second substances,
the description file obtaining unit 210 is configured to obtain and analyze a Markdown description file in the project database through a preset script file; the Markdown description file comprises project directory structure information;
the directory structure generating unit 220 is configured to generate a directory structure according to the item directory structure information of the Markdown description file;
the directory tree structure generating unit 230 is configured to read file directory information of the project database according to the project root directory of the project database, and obtain a directory tree structure according to the file directory information and the directory structure;
the description file optimizing unit 240 is configured to insert the obtained directory tree structure into the Markdown description file according to a corresponding relationship between the directory structure and the item directory structure information of the Markdown description file.
Further, it is preferable that the system further includes a description file determination unit, where the description file determination unit is configured to determine whether a Markdown description file exists in the project database;
when the Markdown description file does not exist in the project database, the script file generates a standard directory structure according to a standard template;
reading file directory information of the project database according to a project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure;
and forming a Markdown description file by using the standard directory structure and the obtained directory tree structure.
The project description file optimization system can automatically acquire the directory information of the files in the project through the script file by presetting the script file, and update the corresponding directory items in the Markdown description file, thereby solving the problem that the directory of the existing project description file needs to be manually updated; the project information can be known more quickly and accurately, and the technical effects of improving the readability and maintainability of the project are achieved.
The invention provides a project description file optimization method which is applied to an electronic device 3.
FIG. 3 shows an application environment of a preferred embodiment of the project description file optimization method according to the present invention.
Referring to fig. 3, in the present embodiment, the electronic device 3 may be a terminal device having an arithmetic function, such as a server, a smart phone, a tablet computer, a portable computer, or a desktop computer.
The electronic device 3 includes: a processor 32, a memory 31, a communication bus 33, and a network interface 35.
The memory 31 includes at least one type of readable storage medium. The readable storage medium may be non-volatile or volatile. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory 31, and the like. In some embodiments, the readable storage medium may be an internal storage unit of the electronic apparatus 3, such as a hard disk of the electronic apparatus 3. In other embodiments, the readable storage medium may also be an external memory 31 of the electronic device 3, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the electronic device 3.
In the present embodiment, the readable storage medium of the memory 31 is generally used for storing the project description file optimization program 30 and the like installed in the electronic device 3. The memory 31 may also be used to temporarily store data that has been output or is to be output.
The processor 32 may be, in some embodiments, a Central Processing Unit (CPU), microprocessor or other data Processing chip for executing program codes stored in the memory 31 or Processing data, such as executing the project description file optimization program 30.
A communication bus 33 is used to enable connection communication between these components.
The network interface 34 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and is typically used to establish a communication link between the electronic apparatus 3 and other electronic devices.
Fig. 3 only shows the electronic device 3 with components 31-34, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may alternatively be implemented.
Optionally, the electronic device 3 may further include a user interface, which may include an input unit such as a Keyboard (Keyboard), a voice input device such as a microphone (microphone) or other equipment with voice recognition function, a voice output device such as a sound box, a headset, etc., and optionally may also include a standard wired interface, a wireless interface.
Optionally, the electronic device 3 may further comprise a display, which may also be referred to as a display screen or a display unit. In some embodiments, the display device may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an Organic Light-Emitting Diode (OLED) touch device, or the like. The display is used for displaying information processed in the electronic apparatus 3 and for displaying a visualized user interface.
Optionally, the electronic device 3 may further include a Radio Frequency (RF) circuit, a sensor, an audio circuit, and the like, which are not described herein again.
In the apparatus embodiment shown in FIG. 3, the memory 31, which is a kind of computer storage medium, may include therein an operating system, and a project description file optimization program 30; the processor 32, when executing the project description file optimization program 30 stored in the memory 31, implements the following steps: acquiring and analyzing a Markdown description file in a project database through a preset script file; the Markdown description file comprises project directory structure information; generating a directory structure according to the project directory structure information of the Markdown description file; reading file directory information of the project database according to a project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure; and inserting the obtained directory tree structure into the Markdown description file according to the corresponding relation between the directory structure and the project directory structure information of the Markdown description file.
In other embodiments, the project description file optimizer 30 may be divided into one or more modules, and the one or more modules are stored in the memory 31 and executed by the processor 32 to implement the present invention. The modules referred to herein are a series of computer program segments that perform particular functions. The project-description-file optimizing program 30 may be divided into a description-file obtaining unit 210, a directory-structure generating unit 220, a directory tree-structure generating unit 230, and a description-file optimizing unit 240.
In addition, the present invention also provides a computer-readable storage medium, which mainly includes a storage data area and a storage program area, wherein the storage data area may store data created according to the use of the blockchain node, and the storage program area may store an operating system and an application program required by at least one function, the computer-readable storage medium includes a project description file optimization program, and the project description file optimization program, when executed by a processor, implements the operation of the project description file optimization method.
The embodiments of the computer-readable storage medium of the present invention are substantially the same as the embodiments of the method, the system, and the electronic device for optimizing a project description file, and are not repeated herein.
In summary, the project description file optimization method, system, electronic device and computer readable storage medium of the present invention automatically read the Markdown description file to obtain the directory structure of the project, read all the files of the project and construct the directory tree structure through the script file preset in the project database; and finally, inserting the formed directory tree structure into the Markdown description file, and further completing the optimization of the project description file of the project. The directory information of the files in the project can be automatically acquired through the script files, and the corresponding directory items in the Markdown description files are updated, so that the problem that the directory of the existing project description files needs to be manually updated is solved; the project information can be known more quickly and accurately, and the technical effects of improving the readability and maintainability of the project are achieved.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
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, apparatus, article, or method 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, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. 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 implementation manner. 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 (e.g., ROM/RAM, magnetic disk, optical disk) as described above, and includes several programs for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A project description file optimization method is applied to an electronic device, and is characterized by comprising the following steps:
acquiring and analyzing a Markdown description file in a project database through a preset script file; the Markdown description file comprises project directory structure information;
generating a directory structure according to the project directory structure information of the Markdown description file;
reading file directory information of the project database according to a project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure;
and inserting the obtained directory tree structure into the Markdown description file according to the corresponding relation between the directory structure and the project directory structure information of the Markdown description file.
2. The method for optimizing a project description file according to claim 1, wherein the preset script file is a shell script readme.sh containing a Markdown description file parsing command.
3. The project description file optimization method according to claim 1, further comprising, before the step of obtaining and parsing a Markdown description file in a project database through a preset script file, a process of determining whether the Markdown description file exists in the project database; wherein the content of the first and second substances,
when the Markdown description file does not exist in the project database, the script file generates a standard directory structure according to a standard template;
reading file directory information of the project database according to a project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure;
and forming a Markdown description file by using the standard directory structure and the obtained directory tree structure.
4. The method for optimizing project description files according to claim 1, wherein the method for reading the file directory information of the project database according to the project root directory of the project database comprises:
dividing files of the project database into directory files and non-directory files through find commands;
traversing folders of the directory files and files under the folders according to an item root directory of the item database;
acquiring the file type and the top annotation information of the file;
and carrying out one-to-one correspondence on the folders, the files, the file types and the top annotation information to obtain the file directory information of the project database.
5. The project-description-file optimizing method according to claim 1, wherein the project-directory structure information of the Markdown description file includes a project directory and project-directory specifying information; wherein the project catalog specification information corresponds to top annotation information for files of the project database; the top annotation information is obtained by means of a exact-docgen extraction.
6. The project description file optimization method according to claim 1, wherein before the step of obtaining and parsing the Markdown description file in the project database through a preset script file, the trigger call to the script file is implemented through a VS code hook.
7. A project description file optimization system is characterized by comprising a description file acquisition unit, a directory structure generation unit, a directory tree structure generation unit and a description file optimization unit; wherein the content of the first and second substances,
the description file acquisition unit is used for acquiring and analyzing a Markdown description file in the project database through a preset script file; the Markdown description file comprises project directory structure information;
the directory structure generating unit is used for generating a directory structure according to the project directory structure information of the Markdown description file;
the directory tree structure generating unit is used for reading the file directory information of the project database according to the project root directory of the project database and obtaining a directory tree structure according to the file directory information and the directory structure;
and the description file optimizing unit is used for inserting the obtained directory tree structure into the Markdown description file according to the corresponding relation between the directory structure and the project directory structure information of the Markdown description file.
8. The project-description-file optimizing system according to claim 7, further comprising a description-file determining unit that determines whether a Markdown description file exists in the project database;
when the Markdown description file does not exist in the project database, the script file generates a standard directory structure according to a standard template;
reading file directory information of the project database according to a project root directory of the project database, and obtaining a directory tree structure according to the file directory information and the directory structure;
and forming a Markdown description file by using the standard directory structure and the obtained directory tree structure.
9. An electronic device, comprising: at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a program executable by the at least one processor to enable the at least one processor to perform the project description file optimization method of any one of claims 1 to 6.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the project description file optimization method according to any one of claims 1 to 6.
CN202011561981.9A 2020-12-25 2020-12-25 Project description file optimization method, system and storage medium Pending CN112527738A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011561981.9A CN112527738A (en) 2020-12-25 2020-12-25 Project description file optimization method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011561981.9A CN112527738A (en) 2020-12-25 2020-12-25 Project description file optimization method, system and storage medium

Publications (1)

Publication Number Publication Date
CN112527738A true CN112527738A (en) 2021-03-19

Family

ID=74976447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011561981.9A Pending CN112527738A (en) 2020-12-25 2020-12-25 Project description file optimization method, system and storage medium

Country Status (1)

Country Link
CN (1) CN112527738A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094036A (en) * 2021-04-19 2021-07-09 罗普特科技集团股份有限公司 Software engineering directory structure annotation aerial view generation method and system
CN115391289A (en) * 2022-08-15 2022-11-25 广州市玄武无线科技股份有限公司 Directory structure generation method and device containing file information

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094036A (en) * 2021-04-19 2021-07-09 罗普特科技集团股份有限公司 Software engineering directory structure annotation aerial view generation method and system
CN113094036B (en) * 2021-04-19 2022-09-27 罗普特科技集团股份有限公司 Software engineering directory structure annotation aerial view generation method and system
CN115391289A (en) * 2022-08-15 2022-11-25 广州市玄武无线科技股份有限公司 Directory structure generation method and device containing file information
CN115391289B (en) * 2022-08-15 2023-08-11 广州市玄武无线科技股份有限公司 Method and device for generating directory structure containing file information

Similar Documents

Publication Publication Date Title
US20230214366A1 (en) Method and system for document versions encoded in a hierarchical representation
CN106951228B (en) Method and device for processing differences in version iteration
KR101961970B1 (en) Dynamically updating a running page
US10565293B2 (en) Synchronizing DOM element references
US8996682B2 (en) Automatically instrumenting a set of web documents
US7032210B2 (en) Method and system for generating program source code of a computer application from an information model
US20060277452A1 (en) Structuring data for presentation documents
CN102124481A (en) Embedding macros in web pages with advertisements
CN110673847A (en) Configuration page generation method and device, electronic equipment and readable storage medium
CN112527738A (en) Project description file optimization method, system and storage medium
CN114153459A (en) Interface document generation method and device
CN111984262A (en) WeChat cascading style sheet file processing method, device, equipment and storage medium
US20150161160A1 (en) Application Localization
US20040181750A1 (en) Exception markup documents
CN108694172B (en) Information output method and device
CN112860265A (en) Method and device for detecting operation abnormity of source code database
CN112783482A (en) Visual form generation method, device, equipment and storage medium
Le Zou et al. On synchronizing with web service evolution
CN106227713B (en) The processing method and processing device of document
CN115291887A (en) Code generation method, device, equipment and storage medium
CN114625372A (en) Automatic component compiling method and device, computer equipment and storage medium
CN115033436A (en) Page testing method and device, electronic equipment and storage medium
CN114625373A (en) Application conversion method and device, electronic equipment and storage medium
CN114676369A (en) Webpage embedding method, device, equipment and computer readable storage medium
CN107577476A (en) A kind of Android system source code difference analysis method, server and medium based on Module Division

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