CN116842907A - Code type identification method based on MarkDown markup language - Google Patents
Code type identification method based on MarkDown markup language Download PDFInfo
- Publication number
- CN116842907A CN116842907A CN202210684622.5A CN202210684622A CN116842907A CN 116842907 A CN116842907 A CN 116842907A CN 202210684622 A CN202210684622 A CN 202210684622A CN 116842907 A CN116842907 A CN 116842907A
- Authority
- CN
- China
- Prior art keywords
- code
- language
- markdown
- identification
- programming language
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 238000007373 indentation Methods 0.000 claims abstract description 9
- 238000010586 diagram Methods 0.000 description 5
- 101150060298 add2 gene Proteins 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/14—Tree-structured documents
- G06F40/143—Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/33—Intelligent editors
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Artificial Intelligence (AREA)
- Computing Systems (AREA)
- Character Input (AREA)
Abstract
A code type identification method based on MarkDown markup language includes providing a plain text editor to write programming language including multiple identification code types and code line formats with different degrees of indentification; adding an automatic identification button control and an automatic indentation control, and identifying all identification code types in programming language according to the starting requirement of the button control; according to the starting requirement of the automatic retraction control, in the programming language, identifying all code line formats retracted to different degrees according to a certain code line reference code line; marking all identification code types in a programming language by using a MarkDown marking language; and the code line format of all the indents with different degrees is adjusted to be the same as the code format of the reference code line by using the MarkDown markup language. The invention not only can automatically identify the code type based on the MarkDown markup language, but also can standardize the code format.
Description
Technical Field
The invention relates to the field of communication equipment in semiconductor automatic test equipment (Automatic Test Equipment, ATE for short), in particular to a code type identification method based on a Markdown markup language.
Background
Currently, markdown is a markup language that can be written using a plain text editor, which can put plain text content in a format through a markup syntax like HTML. Using Markdown editing, a document with a simple but clean format can be written.
HTML, PDF, and its own md files can be easily exported using Markdown. The plain text content is compatible with all text editors and word processing software. The version of your article is modified at any time, and a plurality of file versions are not needed to be generated like word processing software, so that confusion is caused.
There are two ways to format the code in existing Markdown:
(1) the inline code may be used by placing the reverse quotation marks(s) around the various parts of the row;
(2) code blocks may also be used, to which some renderers will apply syntax highlighting.
For example:
and (5) inline code: for instance, writing 'array.prototype.map ()' in markdown will render as array.prototype.map ().
Code block:
```
var add2=function(number){return number+2;}
var add2 = function (number) { return number +2; }
```
It will be apparent to those skilled in the art that grammar highlighting is a special character system set up for the convenience of a software developer that identifies keywords in color for a certain programming language, telling the developer the special role of that word, each programming language having its particular grammar highlighting system.
If the grammar of Markdown is to be used for highlighting, the language names such as ' js ', ' cpp ', ' html and the like are added after the reverse quotation marks in the prior art. If the code is expected to retract in the first line, the space key is required to be tapped for multiple times, and the regular format is achieved through multiple times of adjustment.
The method is slightly complicated in writing the document, the language needs to be judged by oneself, the corresponding language label is added, the label needs to be manually knocked in every time a section of code is input, and if the code format needs to be deleted, the code format still needs to be searched from top to bottom and deleted.
Disclosure of Invention
The invention aims to provide a code type identification method based on a Markdown mark language, which is used for solving the problem that the code type identification method based on the Markdown mark language cannot be automatically realized and standardizing a code format.
In order to achieve the above purpose, the technical scheme of the invention is as follows:
a code type identification method based on MarkDown markup language comprises the following steps:
step S11: providing a plain text editor writing a programming language comprising a plurality of identification code types;
step S12: adding an automatic identification button control, and identifying all identification code types in the programming language according to the starting requirement of the button control;
step S13: all of the identification code types in the programming language are marked using a Markdown mark-up language.
Further, the identification code type includes at least an inline code and a code block.
Further, the programming language is a C language, a Java language, or a Python language.
In order to achieve the above object, a further technical solution of the present invention is as follows:
a code type identification method based on MarkDown markup language is characterized in that,
step S21: providing a plain text editor writing a programming language comprising a plurality of recognition code types and code line formats with different degrees of indentation;
step S22: adding an automatic identification button control and an automatic indentation control, and identifying all identification code types in the programming language according to the starting requirement of the button control; and identifying all code line formats which retract to different degrees in the programming language according to the starting requirement of the automatic retract control by using a certain code line as a reference code line;
step S23: marking all the identification code types in the programming language by using a MarkDown marking language; and adjusting the code line formats of all the different degrees of indents to be the same as the code format of the reference code line by using a MarkDown markup language.
From the technical proposal, the code type identification method based on Markdown markup language provided by the invention,
(1) the system automatically recognizes all the recognition code types in 65+ programming languages such as C, java, python, and can mark all the recognition code types in the programming languages based on a Markdown mark-up language;
(2) when the automatic retraction mode is started, automatic retraction adjustment is performed according to the original code format when copy and paste is performed. When the auto-retract mode is turned off, the user may be allowed to manually adjust the code format.
Drawings
FIG. 1 is a flow chart of a code type identification method based on MarkDown markup language in an embodiment of the invention
FIG. 2 is a diagram of a control interface for automatically identifying code types in an embodiment of the invention
FIG. 3 is a diagram showing the comparison of the results before and after automatically identifying the code type in the embodiment of the present invention
FIG. 4 is a flowchart illustrating another method for identifying code types based on Markdown markup language in an embodiment of the present invention
FIG. 5 is a graph showing the comparison of the results before and after automatic retraction in an embodiment of the present invention
Detailed Description
The following describes embodiments of the present invention in further detail with reference to FIGS. 1-4.
Example 1
Referring to fig. 1, fig. 1 is a flow chart of a code type identification method based on Markdown markup language in an embodiment of the invention. As shown in fig. 1, the method comprises the steps of:
step S11: providing a plain text editor writing a programming language comprising a plurality of identification code types;
step S12: adding an automatic identification button control, and identifying all identification code types in the programming language according to the starting requirement of the button control;
step S13: all of the identification code types in the programming language are marked using a Markdown mark-up language.
In a semiconductor test ATE system, a through grammar highlighting is a special character system set for the convenience of a software developer, which identifies keywords of a certain programming language in color, tells the developer of the special role of the word, and each programming language has a specific grammar highlighting system.
In the embodiment of the invention, all the identification code types in 65+ programming languages such as C language, java language or Python language are automatically identified, and all the identification code types in the programming languages can be marked based on MarkDown marking language; wherein the identification code type at least comprises an inline code and a code block.
Referring to fig. 2, fig. 2 is a schematic diagram of a control interface for automatically identifying a code type according to an embodiment of the invention. As shown in fig. 2, the control for automatically recognizing the code type is located at the upper left corner, that is, for the code grammar highlighting problem, by adding the automatic recognition button control, the code type input in the document can be opened and automatically recognized by inputting the code, and the dark gray color shown in fig. 2 represents the recognized different code type.
Referring to fig. 3, fig. 3 is a schematic diagram showing comparison of results before and after automatically identifying a code type according to an embodiment of the invention.
Example 2
Referring to fig. 4, fig. 4 is a flowchart illustrating another method for identifying code types based on Markdown markup language according to an embodiment of the present invention. As shown in fig. 4, the method comprises the steps of:
step S21: providing a plain text editor writing a programming language comprising a plurality of recognition code types and code line formats with different degrees of indentation;
step S22: adding an automatic identification button control and an automatic indentation control, and identifying all identification code types in the programming language according to the starting requirement of the button control; and identifying all code line formats which retract to different degrees in the programming language according to the starting requirement of the automatic retract control by using a certain code line as a reference code line;
step S23: marking all the identification code types in the programming language by using a MarkDown marking language; and adjusting the code line formats of all the different degrees of indents to be the same as the code format of the reference code line by using a MarkDown markup language.
In an embodiment of the present invention, for the indentation problem, automatic typesetting, optimization format, and highlighting can be perfectly solved by adding an automatic indentation button (as shown in the upper right corner of fig. 2). That is, not only is manual entry of the "and code language labels unnecessary, but also the button is opened when the copy code is pasted, ensuring consistency with the original code format and reducing the steps of manual adjustment.
Selection of automatic retraction:
(1) automatic retraction is started: and automatically retracting and adjusting according to the original code format during copying and pasting.
(2) Closing automatic retraction: enter a manual adjustment code format.
Referring to fig. 5, fig. 5 is a schematic diagram showing comparison of results before and after automatically identifying a code type according to an embodiment of the invention.
In summary, the code type recognition method based on the Markdown markup language not only can automatically recognize the code type based on the Markdown markup language, but also can standardize the code format.
The foregoing description is only of the preferred embodiments of the present invention, and the embodiments are not intended to limit the scope of the invention, so that all changes made in the equivalent structures of the present invention described in the specification and the drawings are included in the scope of the invention.
Claims (6)
1. A code type recognition method based on Markdown markup language, comprising:
step S11: providing a plain text editor writing a programming language comprising a plurality of identification code types;
step S12: adding an automatic identification button control, and identifying all identification code types in the programming language according to the starting requirement of the button control;
step S13: all of the identification code types in the programming language are marked using a Markdown mark-up language.
2. The Markdown markup language based code type recognition method according to claim 1, wherein the recognition code type includes at least an inline code and a code block.
3. The Markdown markup language-based code type recognition method according to claim 1, wherein the programming language is C language, java language, or Python language.
4. A code type identification method based on MarkDown markup language is characterized in that,
step S21: providing a plain text editor writing a programming language comprising a plurality of recognition code types and code line formats with different degrees of indentation;
step S22: adding an automatic identification button control and an automatic indentation control, and identifying all identification code types in the programming language according to the starting requirement of the button control; and identifying all code line formats which retract to different degrees in the programming language according to the starting requirement of the automatic retract control by using a certain code line as a reference code line;
step S23: marking all the identification code types in the programming language by using a MarkDown marking language; and adjusting the code line formats of all the different degrees of indents to be the same as the code format of the reference code line by using a MarkDown markup language.
5. The Markdown markup language based code type recognition method according to claim 4, wherein the recognition code type includes at least an inline code and a code block.
6. The Markdown markup language-based code type recognition method according to claim 4, wherein the programming language is C language, java language or Python language.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210304979 | 2022-03-25 | ||
CN2022103049796 | 2022-03-25 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116842907A true CN116842907A (en) | 2023-10-03 |
Family
ID=88160477
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210684622.5A Pending CN116842907A (en) | 2022-03-25 | 2022-06-16 | Code type identification method based on MarkDown markup language |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116842907A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117193739A (en) * | 2023-11-03 | 2023-12-08 | 建信金融科技有限责任公司 | Script editing method and device |
-
2022
- 2022-06-16 CN CN202210684622.5A patent/CN116842907A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117193739A (en) * | 2023-11-03 | 2023-12-08 | 建信金融科技有限责任公司 | Script editing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8239882B2 (en) | Markup based extensibility for user interfaces | |
US7496230B2 (en) | System and method for automatic natural language translation of embedded text regions in images during information transfer | |
CN111428467B (en) | Method, device, equipment and storage medium for generating problem questions for reading and understanding | |
CN101443790B (en) | Efficient processing of non-reflow content in a digital image | |
CN108595389B (en) | Method for converting Word document into txt plain text document | |
US20030101043A1 (en) | Method for translating slide presentations into different languages | |
Treviranus et al. | Authoring Tool Accessibility Guidelines | |
CN110705237A (en) | Automatic document generation method, data processing device, and storage medium | |
CN103488484A (en) | Software implementation method and system for online editor | |
CN116842907A (en) | Code type identification method based on MarkDown markup language | |
CN113220738A (en) | Business rule generation method, device, equipment and storage medium | |
US20080141112A1 (en) | Document Processing Device and Document Processing Method | |
US20050039108A1 (en) | Fast tag entry in a multimodal markup language editor | |
US20100169866A1 (en) | Navigation in computer software applications developed in a procedural language | |
CN113297856B (en) | Document translation method and device and electronic equipment | |
KR102129705B1 (en) | Method And Apparatus for Converting Accessibility E-Book | |
US20070220439A1 (en) | Information Management Device | |
CN108228179A (en) | The international processing method of the page, device, computer and storage medium | |
CN113297425A (en) | Document conversion method, device, server and storage medium | |
CN112364632A (en) | Book checking method and device | |
CN114035726B (en) | Method and system for robot flow automatic page element identification process | |
US20040164989A1 (en) | Method and apparatus for disclosing information, and medium for recording information disclosure program | |
Olaverri-Monreal et al. | Variable menus for the local adaptation of graphical user interfaces | |
CN113627134A (en) | Data annotation system and data annotation method | |
EP1936516A1 (en) | Method to directly and automatically load data from documents and/or extract data to documents |
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 |