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.
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.