CN106293686A - The method and device of exhibiting pictures annotation in code text - Google Patents

The method and device of exhibiting pictures annotation in code text Download PDF

Info

Publication number
CN106293686A
CN106293686A CN201510355900.2A CN201510355900A CN106293686A CN 106293686 A CN106293686 A CN 106293686A CN 201510355900 A CN201510355900 A CN 201510355900A CN 106293686 A CN106293686 A CN 106293686A
Authority
CN
China
Prior art keywords
code
picture
text
code text
annotation
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.)
Granted
Application number
CN201510355900.2A
Other languages
Chinese (zh)
Other versions
CN106293686B (en
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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510355900.2A priority Critical patent/CN106293686B/en
Publication of CN106293686A publication Critical patent/CN106293686A/en
Application granted granted Critical
Publication of CN106293686B publication Critical patent/CN106293686B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

This application discloses the method and device of exhibiting pictures annotation in a kind of code text, wherein, described method includes: by Code Edit tool loads code, and judges whether comprise picture tag in code text;The most then resolve the image link address in described picture tag, and be showed in code text after render the picture of correspondence according to described image link address;If it is not, the most directly show described code text.Relative to prior art, in the code text of the application, the method and device of exhibiting pictures annotation can show the picture annotation of insertion in code text, picture is directly quoted when it supports not only annotation, time saving and energy saving, and understand that the logic of code is the most directly perceived effectively by picture, the efficiency of software development is had and obviously promotes.

Description

The method and device of exhibiting pictures annotation in code text
Technical field
The application relates to computer realm, especially relates to the side of exhibiting pictures annotation in a kind of code text Method and device.
Background technology
Usually, the Code Edit instrument of development platform can only be provided as the content of code insertion textual annotation, But, if the logic of code is complicated, then needing the word of big section to describe could be the logic of code being retouched State clear, not only waste time and energy, easily occur in ambiguity, and subsequent software development process these words The understanding difficulty described is the highest.
Summary of the invention
The purpose of the application is to provide the method and device of exhibiting pictures annotation, the method in a kind of code text The picture annotation inserted can be illustrated in code text with device.
For realizing one of above-mentioned application purpose, the application one embodiment provides in a kind of code text to be shown The method of picture annotation, described method includes:
By Code Edit tool loads code, and judge whether code text comprises picture tag;
The most then resolve the image link address in described picture tag, and according to described image link address It is showed in code text after rendering the picture of correspondence;
If it is not, the most directly show described code text.
As the further improvement of the application one embodiment, by Code Edit tool loads code steps Before, described method also includes compiled code edit tool step, specifically includes:
In Code Edit instrument, add the picture tag in inspection code text, resolve picture in picture tag Chained address, and render corresponding picture according to image link address and the process that is showed in code text is patrolled Volume.
As the further improvement of the application one embodiment, described code is the code that Java language is write.
As the further improvement of the application one embodiment, described picture tag is to support the figure of Html grammer Sheet label, described image link address is the Url address of picture.
As the further improvement of the application one embodiment, render correspondence according to described image link address Picture, and in code text, show text message corresponding to described picture tag and described picture tag simultaneously Corresponding picture.
For realizing one of above-mentioned application purpose, the application one embodiment provides in a kind of code text to be shown The device of picture annotation, including:
Insmod, for loading code;
Identification module, is used for judging whether comprise picture tag in code text;
Processing module, in time comprising picture tag in code text, resolves the figure in described picture tag Sheet chained address, and according to described image link address render correspondence picture after be showed in code text; And
When not comprising picture tag in code text, directly show described code text.
As the further improvement of the application one embodiment, described device also includes collector, described volume Translate module for:
In Code Edit instrument, add the picture tag in inspection code text, resolve picture in picture tag Chained address, and render corresponding picture according to image link address and the process that is showed in code text is patrolled Volume.
As the further improvement of the application one embodiment, described code is the code that Java language is write.
As the further improvement of the application one embodiment, described picture tag is to support the figure of Html grammer Sheet label, described image link address is the Url address of picture.
As the further improvement of the application one embodiment, described processing module is used for:
Render the picture of correspondence according to described image link address, and in code text, show described figure simultaneously The picture that text message that sheet label is corresponding is corresponding with described picture tag.
Relative to prior art, in the code text of the application, the method and device of exhibiting pictures annotation can be in generation Show, in code text, the picture annotation inserted, when it supports not only annotation, directly quote picture, time saving and energy saving, And understand that the logic of code is the most directly perceived effectively by picture, the efficiency of software development is had obviously Promote.
Accompanying drawing explanation
Fig. 1 is the flow chart of method of exhibiting pictures annotation in code text in the application one embodiment.
Fig. 2 be the application one example code text in exhibiting pictures annotation design sketch.
Fig. 3 is the module map of device of exhibiting pictures annotation in code text in the application one embodiment.
Detailed description of the invention
Below with reference to detailed description of the invention shown in the drawings, the application is described in detail.But these are real The mode of executing is not limiting as the application, and those of ordinary skill in the art is made according to these embodiments Structure, method or conversion functionally are all contained in the protection domain of the application.
As it is shown in figure 1, in the application one embodiment, the method for exhibiting pictures annotation in code text Including:
S1, by Code Edit tool loads code;
S2, described Code Edit instrument judge whether comprise picture tag in code text;
S3, the most then resolve the image link address in described picture tag, and according to described image link Address is showed in code text after rendering corresponding picture;
S4 is if it is not, the most directly show described code text.
In the present embodiment, the process of described Code Edit tool loads code comprises the steps that and first passes through generation Code edit tool opens code file, then reads code text by code file, and in code text Keyword coloring after format described code, with can be to this code text in described Code Edit instrument Executive editor.
Certainly, in other embodiments, it is possible to partial routine is added or omitted, such as need not be to source generation Keyword coloring etc. in code text, as long as finally code can be loaded in Code Edit instrument, and can Code is edited by Code Edit instrument.
In the present embodiment, the Code Edit instrument for loading code is the code being compiled in advance Edit tool, with during Code Edit tool loads code, adds the figure checked in code text Image link address in sheet label, parsing picture tag, and render corresponding figure according to image link address Sheet the process logic being showed in code text.
So, during by compiled code edit tool loading code, may be implemented in code text and open up Show picture annotation.
Further, in the present embodiment, described code is the code that Java language is write.This Java The code that language is write can be loaded by Java code edit tool and edit.
Further, described picture tag is to support the picture tag of Html grammer, such as<img>label Deng.
Further, described image link address is the Url address of picture.
It is understood that under present invention is conceived, user, can be at code when writing code Blank line in text add similar<imgsrc=“http://url’/>picture tag, with in described generation Insert pictures in code text.So, when with code described in the Code Edit tool loads after compiling, will Can show and link corresponding picture with Url.
In the concrete example of the application one, being annotated Euler's formula by picture, it is in code text In add:
<imgsrc=https: //cloud.githubusercontent.com/assets/3796876/7218398/8e660 7ec -e69f-11e4-92af-6d9377a0ec06.jpg/ > picture tag.
So, when code described in the code compilation tool loads after compiling, as in figure 2 it is shown, code is compiled The instrument of collecting identifies and contains picture tag in code text, and has resolved the picture in described picture tag Behind chained address, render the picture of correspondence according to described image link address after, it is showed in phase in code text Answer position.
It is apparent that by this Euler's formula of picture annotation, substantially increase user and understand the effect of Euler's formula Rate.It addition, well imagine, if being described by word, Euler's formula is annotated, not only on annotation rank Section is extremely difficult, and the follow-up understanding difficulty to this annotation is the highest.
Further, in the present embodiment, render the picture of correspondence according to described image link address after The step being showed in code text specifically includes:
Render the picture of correspondence according to described image link address, and show described in code text simultaneously The picture that text message corresponding to picture tag is corresponding with described picture tag.
The example of ginseng Fig. 2, in code text, not show only the picture that picture tag is corresponding, meanwhile, Still can text message corresponding to exhibiting pictures label:
<imgsrc=https: //cloud.githubusercontent.com/assets/3796876/7218398/8e66 07ec-e69f-11e4-92af-6d9377a0ec06.jpg/>.So, in order to follow-up this picture tag is entered Edlin.
As it is shown on figure 3, in the application one embodiment, the device of exhibiting pictures annotation in code text For Code Edit instrument or the machine that runs this Code Edit instrument, comprising:
Insmod 100, for loading code;
Identification module 200, is used for judging whether comprise picture tag in code text;
Processing module 300, in time comprising picture tag in code text, resolves in described picture tag Image link address, and according to described image link address render correspondence picture after be showed in code text; And
When not comprising picture tag in code text, directly show described code text.
In the present embodiment, insmod described in 100 for: first pass through Code Edit TO generation Code file, then read code text by code file, and to lattice after the keyword coloring in code text Code described in formula, with can be to this code text executive editor in described Code Edit instrument.
Certainly, in other embodiments, it is possible to partial routine is added or omitted, such as need not be to source generation Keyword coloring etc. in code text, as long as finally code can be loaded in Code Edit instrument, and can Code is edited by Code Edit instrument.
In the present embodiment, described Code Edit instrument also includes collector 400, described compiling mould Block 400 is used for:
In Code Edit instrument, add the picture tag in inspection code text, resolve in picture tag and scheme Sheet chained address, and render corresponding picture the place being showed in code text according to image link address Reason logic.
So, during by compiled code edit tool loading code, may be implemented in code text and open up Show picture annotation.
Further, in the present embodiment, described code is the code that Java language is write.This Java The code that language is write can be loaded by Java code edit tool and edit.
Further, described picture tag is to support the picture tag of Html grammer, such as<img>label Deng.
Further, described image link address is the Url address of picture.
It is understood that under present invention is conceived, user, can be at code when writing code Blank line in text add similar<imgsrc=“http://url’/>picture tag, with in described generation Insert pictures in code text.So, when with code described in the Code Edit tool loads after compiling, will Can show and link corresponding picture with Url.
In the concrete example of the application one, being annotated Euler's formula by picture, it is in code text In add:
<imgsrc=https: //cloud.githubusercontent.com/assets/3796876/7218398/8e660 7ec -e69f-11e4-92af-6d9377a0ec06.jpg/ > picture tag.
So, when code described in the code compilation tool loads after compiling, as in figure 2 it is shown, code is compiled The instrument of collecting identifies and contains picture tag in code text, and has resolved the picture in described picture tag Behind chained address, render the picture of correspondence according to described image link address after, it is showed in phase in code text Answer position.
It is apparent that by this Euler's formula of picture annotation, substantially increase user and understand the effect of Euler's formula Rate.It addition, well imagine, if being described by word, Euler's formula is annotated, not only on annotation rank Section is extremely difficult, and the follow-up understanding difficulty to this annotation is the highest.
Further, in the present embodiment, when comprising picture tag in code text, described process mould Block 300 specifically for:
Render the picture of correspondence according to described image link address, and in code text, show described figure simultaneously The picture that text message that sheet label is corresponding is corresponding with described picture tag.
The example of ginseng Fig. 2, in code text, not show only the picture that picture tag is corresponding, meanwhile, Still can text message corresponding to exhibiting pictures label:
<imgsrc=https: //cloud.githubusercontent.com/assets/3796876/7218398/8e66 07ec-e69f-11e4-92af-6d9377a0ec06.jpg/>.So, in order to follow-up this picture tag is entered Edlin.
In sum, in the code text of the application, the method and device of exhibiting pictures annotation can be in code text The interior picture annotation showing insertion, directly quotes picture when it supports not only annotation, time saving and energy saving, and logical Cross picture the most directly perceived effectively to the logic understanding code, especially for the field such as mathematical formulae, data structure Scape, has the efficiency of software development and obviously promotes.
Those skilled in the art is it can be understood that arrive, and for convenience and simplicity of description, above-mentioned retouches The specific works process of the device stated, device and module, be referred in preceding method embodiment is right Answer process, do not repeat them here.
In several embodiments provided herein, it should be understood that disclosed device, device And method, can realize by another way.Such as, device embodiments described above is only It is schematic, such as, the division of described module, it is only a kind of logic function and divides, actual realization Time can have other dividing mode, the most multiple modules or assembly can in conjunction with or be desirably integrated into another One device, or some features can ignore, or do not perform.Another point, that shows or discuss is mutual Between coupling or direct-coupling or communication connection can be indirect by some interfaces, device or module Coupling or communication connection, can be electrical, machinery or other form.
The described module illustrated as separating component can be or may not be physically separate, makees Parts for modules exhibit can be or may not be physical module, i.e. may be located at a place, Or can also be distributed on multiple mixed-media network modules mixed-media.Can select according to the actual needs part therein or The whole module of person realizes the purpose of present embodiment scheme.
It addition, each functional module in each embodiment of the application can be integrated in a processing module In, it is also possible to it is that modules is individually physically present, it is also possible to 2 or 2 are integrated in one with upper module In individual module.Above-mentioned integrated module both can realize to use the form of hardware, it would however also be possible to employ hardware adds The form of software function module realizes.
The above-mentioned integrated module realized with the form of software function module, can be stored in a computer In read/write memory medium.Above-mentioned software function module is stored in a storage medium, including some fingers Make with so that a computer installation (can be personal computer, server, or network equipment etc.) Or processor (processor) performs the part steps of method described in each embodiment of the application.And it is front The storage medium stated includes: USB flash disk, portable hard drive, read only memory (Read-Only Memory, ROM), Random access memory (Random Access Memory, RAM), magnetic disc or CD etc. are various can To store the medium of program code.
Last it is noted that embodiment of above is only in order to illustrate the technical scheme of the application, rather than right It limits;Although the application being described in detail with reference to aforementioned embodiments, this area common Skilled artisans appreciate that the technical scheme described in aforementioned each embodiment still can be repaiied by it Change, or wherein portion of techniques feature is carried out equivalent;And these amendments or replacement, do not make The essence of appropriate technical solution departs from the spirit and scope of the application each embodiment technical scheme.

Claims (10)

1. the method for exhibiting pictures annotation in a code text, it is characterised in that described method includes:
By Code Edit tool loads code, and judge whether code text comprises picture tag;
The most then resolve the image link address in described picture tag, and according to described image link address It is showed in code text after rendering the picture of correspondence;
If it is not, the most directly show described code text.
The method of exhibiting pictures annotation in code text the most according to claim 1, it is characterised in that Before by Code Edit tool loads code steps, described method also includes compiled code edit tool step, Specifically include:
In Code Edit instrument, add the picture tag in inspection code text, resolve picture in picture tag Chained address, and render corresponding picture according to image link address and the process that is showed in code text is patrolled Volume.
The method of exhibiting pictures annotation in code text the most according to claim 1, it is characterised in that Described code is the code that Java language is write.
The method of exhibiting pictures annotation in code text the most according to claim 1, it is characterised in that Described picture tag is to support the picture tag of Html grammer, and described image link address is the Url ground of picture Location.
The method of exhibiting pictures annotation in code text the most according to claim 1, it is characterised in that The step being showed in code text after rendering the picture of correspondence according to described image link address specifically includes:
Render the picture of correspondence according to described image link address, and in code text, show described figure simultaneously The picture that text message that sheet label is corresponding is corresponding with described picture tag.
6. the device of exhibiting pictures annotation in a code text, it is characterised in that described device includes:
Insmod, for loading code;
Identification module, is used for judging whether comprise picture tag in code text;
Processing module, in time comprising picture tag in code text, resolves the figure in described picture tag Sheet chained address, and according to described image link address render correspondence picture after be showed in code text; And
When not comprising picture tag in code text, directly show described code text.
The device of exhibiting pictures annotation in code text the most according to claim 6, it is characterised in that Described device also includes that collector, described collector are used for:
In Code Edit instrument, add the picture tag in inspection code text, resolve picture in picture tag Chained address, and render corresponding picture according to image link address and the process that is showed in code text is patrolled Volume.
The device of exhibiting pictures annotation in code text the most according to claim 6, it is characterised in that Described code is the code that Java language is write.
The device of exhibiting pictures annotation in code text the most according to claim 6, it is characterised in that Described picture tag is to support the picture tag of Html grammer, and described image link address is the Url ground of picture Location.
The device of exhibiting pictures annotation in code text the most according to claim 6, it is characterised in that Described processing module is used for:
Render the picture of correspondence according to described image link address, and in code text, show described figure simultaneously The picture that text message that sheet label is corresponding is corresponding with described picture tag.
CN201510355900.2A 2015-06-25 2015-06-25 The method and device that exhibiting pictures annotate in code text Active CN106293686B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510355900.2A CN106293686B (en) 2015-06-25 2015-06-25 The method and device that exhibiting pictures annotate in code text

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510355900.2A CN106293686B (en) 2015-06-25 2015-06-25 The method and device that exhibiting pictures annotate in code text

Publications (2)

Publication Number Publication Date
CN106293686A true CN106293686A (en) 2017-01-04
CN106293686B CN106293686B (en) 2019-08-02

Family

ID=57650816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510355900.2A Active CN106293686B (en) 2015-06-25 2015-06-25 The method and device that exhibiting pictures annotate in code text

Country Status (1)

Country Link
CN (1) CN106293686B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06124199A (en) * 1992-10-13 1994-05-06 Toshiba Corp Source code comment editor
CN102741835A (en) * 2009-12-10 2012-10-17 诺基亚公司 Method, apparatus or system for image processing
CN103019720A (en) * 2012-12-14 2013-04-03 北京奇虎科技有限公司 Method and device for processing page in browser
CN103324513A (en) * 2013-06-04 2013-09-25 北京大学 Program annotation method and device
CN103927370A (en) * 2014-04-23 2014-07-16 焦点科技股份有限公司 Network information batch acquisition method of combined text and picture information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06124199A (en) * 1992-10-13 1994-05-06 Toshiba Corp Source code comment editor
CN102741835A (en) * 2009-12-10 2012-10-17 诺基亚公司 Method, apparatus or system for image processing
CN103019720A (en) * 2012-12-14 2013-04-03 北京奇虎科技有限公司 Method and device for processing page in browser
CN103324513A (en) * 2013-06-04 2013-09-25 北京大学 Program annotation method and device
CN103927370A (en) * 2014-04-23 2014-07-16 焦点科技股份有限公司 Network information batch acquisition method of combined text and picture information

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JAVADOC HOME PAGE: "How to Write Doc Comments for the Javadoc Tool", 《HTTPS://WWW.ORACLE.COM/TECHNETWORK/ARTICLES/JAVA/INDEX-137868.HTML》 *

Also Published As

Publication number Publication date
CN106293686B (en) 2019-08-02

Similar Documents

Publication Publication Date Title
CN102201009B (en) Form generating method and device
CN102830975B (en) A kind of assembly language is to the code conversion method of higher level lanquage and device
CN104461484A (en) Front-end template implementation method and device
CN105630524A (en) Webpage text parsing method and device and mobile terminal
CN103488482A (en) Method and device for generating test cases
CN103077062B (en) The detection method of a kind of code change and device
CN104020984A (en) Method and device for generating static page
CN101650745A (en) Method and device for rapidly generating WEB page based on data definition
CN102298518B (en) Conversion from the administration order of technology the unknown to multiple management agreement
CN110221824B (en) Method and device for generating component
CN106547782A (en) The acquisition methods and device of log information
CN113672204A (en) Interface document generation method, system, electronic equipment and storage medium
CN111831384A (en) Language switching method and device, equipment and storage medium
CN104424239B (en) resource file loading method and device
CN104572744B (en) structured document generation method and device
CN103593406A (en) Static resource identifier processing method and device
CN102236573A (en) Name binding extensibility for typed programming language
CN110955410A (en) Automatic code generation method, device, equipment and medium
CN102254023A (en) Method and device for editing webpage
CN105589918A (en) Method and device for extracting page information
CN106293686A (en) The method and device of exhibiting pictures annotation in code text
CN110727458A (en) Method and device for switching page template settings through background management
Filipovikj et al. Analyzing industrial simulink models by statistical model checking
CN109240660B (en) Access method of advertisement data, storage medium, electronic device and system
CN111435300A (en) Web system development method, device, equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201012

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201012

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.