CN116360793A - Method and device for compiling component example page - Google Patents

Method and device for compiling component example page Download PDF

Info

Publication number
CN116360793A
CN116360793A CN202310347779.3A CN202310347779A CN116360793A CN 116360793 A CN116360793 A CN 116360793A CN 202310347779 A CN202310347779 A CN 202310347779A CN 116360793 A CN116360793 A CN 116360793A
Authority
CN
China
Prior art keywords
component
document
example page
target
page
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
CN202310347779.3A
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.)
Beijing Shangyin Microchip Technology Co ltd
Original Assignee
Beijing Shangyin Microchip Technology 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 Beijing Shangyin Microchip Technology Co ltd filed Critical Beijing Shangyin Microchip Technology Co ltd
Priority to CN202310347779.3A priority Critical patent/CN116360793A/en
Publication of CN116360793A publication Critical patent/CN116360793A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a method and a device for compiling a component example page, which are applied to the technical field of computing. Acquiring a target component document in a Markdown format corresponding to the target component example page according to the mapping relation file of the component example page and the component document in the Markdown format; converting the target component document into a component document html fragment; and inserting the component document html fragment into the target component example page to complete compiling of the target component example page. In this way, the target component document in the Markdown format corresponding to the target component example page is converted into the component document html fragment, and then the component document html fragment is automatically inserted into the target component example page, so that the integration of the target component document and the target component example page is completed, and the compiling efficiency of the target component example page can be improved.

Description

Method and device for compiling component example page
Technical Field
The application relates to the technical field of computers, in particular to a method and a device for compiling a component example page.
Background
At present, a component developer writes a component document and a component example in a MarkDown document in a fixed grammar, and then directly compiles the document and the component example into Web application codes; or writing the content of the component document in the component realization code in a fixed grammar, regenerating into a Markdown document, and compiling into Web application code.
However, for the case that the component example page exists but the component document does not exist, the component example page can be split and migrated to the Markdown document or the component implementation code; component documents may also be manually maintained in component instantiation pages. However, the current method consumes long time, the integration efficiency of the component document and the component example page is low, and the compiling efficiency of the component example page is low.
Disclosure of Invention
In view of this, the present application provides a method and apparatus for compiling component example pages, which can improve the integration efficiency of component documents and component example pages, and further improve the compiling efficiency of component example pages.
In order to solve the problems, the technical scheme provided by the application is as follows:
in a first aspect, the present application provides a component example page compiling method, the method including:
acquiring a target component document in a Markdown format corresponding to the target component example page according to the mapping relation file of the component example page and the component document in the Markdown format;
converting the target component document into a component document html fragment;
and inserting the component document html fragment into the target component example page to complete compiling of the target component example page.
In one possible implementation, the method further includes:
acquiring component realization codes according to the catalogue and the file name of the component example page;
extracting component document content from the component implementation code;
generating a component document in a MarkDown format according to the component document content;
and generating a mapping relation file of the component example page and the component document in the MarkDown format.
In one possible implementation manner, the extracting the component document content from the component implementation code includes:
extracting the document content of the component from the component implementation code according to annotation data, wherein the annotation data comprises the name, the attribute, the event, the slot and the externally callable method of the component.
In one possible implementation manner, the inserting the component document html fragment into the target component example page includes:
and inserting the html fragments of the component document into preset positions of the target component example page according to the component realization code.
In one possible implementation, if the target component document is a special component document, the method further includes:
and manually maintaining a special mapping relation between the special component document and the special component example page, wherein the special component document is a component document which cannot generate a MarkDown format.
In a second aspect, the present application provides a component example page compiling apparatus, the apparatus comprising:
the acquisition module is used for acquiring the target component document in the Markdown format corresponding to the target component example page according to the mapping relation file of the component example page and the component document in the Markdown format;
the conversion module is used for converting the target component document into a component document html fragment;
and the compiling module is used for inserting the html fragments of the component document into the target component example page to complete the compiling of the target component example page.
In one possible implementation, the apparatus further includes:
the acquisition module is also used for acquiring component realization codes according to the catalogue and the file name of the component example page;
the extraction module is used for extracting the document content of the component from the component realization code;
the generating module is used for generating the component document in the MarkDown format according to the component document content;
the generating module is further configured to generate a mapping relationship file between the component example page and the component document in Markdown format.
In one possible implementation manner, the extracting module is specifically configured to:
extracting the document content of the component from the component implementation code according to annotation data, wherein the annotation data comprises the name, the attribute, the event, the slot and the externally callable method of the component.
In one possible implementation manner, the compiling module is configured to insert the component document html fragment into the target component example page, and includes:
and inserting the html fragments of the component document into preset positions of the target component example page according to the component realization code.
In one possible implementation, if the target component document is a special component document, the apparatus further includes:
the manual maintenance module is used for manually maintaining the special mapping relation between the special component document and the special component example page, wherein the special component document is a component document which cannot generate a MarkDown format.
In a third aspect, the present application provides a component example page compiling apparatus, comprising: a processor, memory, system bus;
the processor and the memory are connected through the system bus;
the memory is for storing one or more programs, the one or more programs comprising instructions, which when executed by the processor, cause the processor to perform the component example page compilation method of the first aspect described above.
In a fourth aspect, the present application provides a computer readable storage medium storing instructions that, when executed on a device, cause the device to perform the component example page compilation method of the first aspect described above.
From this, this application has following beneficial effect:
the application provides a compiling method and device for an example page of a component, which acquire a target component document in a Markdown format corresponding to an example page of a target component according to a mapping relation file of the example page of the component and the component document in the Markdown format; converting the target component document into a component document html fragment; and inserting the component document html fragment into the target component example page to complete compiling of the target component example page. In this way, the target component document in the Markdown format corresponding to the target component example page is converted into the component document html fragment, and then the component document html fragment is automatically inserted into the target component example page, so that the integration of the target component document and the target component example page is completed, and the compiling efficiency of the target component example page can be improved.
Drawings
Fig. 1 is a flowchart of an exemplary page compiling method for a component according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an exemplary page compiling execution flow of a component according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an exemplary page compiling device for a component according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a component example page compiling device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The existing integration scheme of the component document and the component example page is generally that a component developer writes the component document and the component example in a Markdown document in a fixed grammar or writes the component document and the component example page in a component example page, and then directly compiles the component document and the component example page into Web application codes. Or writing the content of the component document in the component realization code in a fixed grammar, generating a Markdown document, and compiling the Markdown document into Web application code.
However, if the above scheme is adopted, the component example page needs to be split and migrated to the Markdown document or the component implementation code, which is very time-consuming. Or require manual maintenance of component documents in component instantiation pages, again requiring significant time. The integration efficiency of the component document and the component example page is lower, resulting in the compiling efficiency of the component example page being lower.
The embodiment of the application provides a compiling method and device for a component example page, which can automatically and rapidly complete the integration work of a component document and the component example page. Acquiring a target component document in a Markdown format corresponding to the target component example page according to the mapping relation file of the component example page and the component document in the Markdown format; converting the target component document into a component document html fragment; and inserting the component document html fragment into the target component example page to complete compiling of the target component example page. In this way, the target component document in the Markdown format corresponding to the target component example page is converted into the component document html fragment, and then the component document html fragment is automatically inserted into the target component example page, so that the integration of the target component document and the target component example page is completed, and the compiling efficiency of the target component example page can be improved.
In order to facilitate understanding of the technical solution provided by the embodiments of the present application, a method and an apparatus for compiling component example pages provided by the embodiments of the present application are described below with reference to the accompanying drawings.
First, nouns are explained.
The Web front-end component library is used to package some common display and interaction effects into components. Generally, a component library provides tens of components, and in the development process of Web projects, the components can be directly used to rapidly complete the development of business pages.
A component instantiation page is a web page that is used to introduce a component user how a component is to be used. Each component will have a separate component instantiation page. The page may contain a function profile, function instance, example code, and component document for the component.
The component document is detailed information used to program the component user, describing the properties, methods, events, slots, etc. provided by the component. Typically, the component document will be displayed at the lowest of the component example pages.
Referring to fig. 1, fig. 1 is a flowchart of a component example page compiling method according to an embodiment of the present application, where the method specifically includes S101-S103.
S101: and obtaining the target component document in the Markdown format corresponding to the target component example page according to the mapping relation file of the component example page and the component document in the Markdown format.
In one possible implementation, the method further includes: acquiring component realization codes according to the catalogue and the file name of the component example page; extracting component document content from the component implementation code; generating a component document in a MarkDown format according to the component document content; and generating a mapping relation file of the component example page and the component document in the MarkDown format.
Inlet files in each component implementation code are mapped according to the directory and filenames of the component instance pages. Extracting component document content from the component realization code by using an open source tool, generating a component document in a Markdown format, and generating a mapping relation file of a component example page to the component document in the Markdown format. For a few special components, component documents and corresponding special mapping relationship files may be manually maintained.
In one possible implementation manner, the extracting the component document content from the component implementation code includes: extracting the document content of the component from the component implementation code according to annotation data, wherein the annotation data comprises the name, the attribute, the event, the slot and the externally callable method of the component.
Referring to fig. 2, fig. 2 is a schematic diagram of an exemplary page compiling execution flow of a component according to an embodiment of the present application. Annotations for generating component documents are added in advance within the component implementation code, and generally, the locations to be added include the names, attributes, events, slots, and externally callable methods of the components. Taking a button assembly (components/button. Vue file) as an example, the implementation code is as follows:
Figure BDA0004160761280000061
Figure BDA0004160761280000071
the new component example page is a component example page for inserting a new component document into the component example page, and the component example page is a component user for providing more complete component introduction. Taking the example of button component example page (example/button. Vue file), the implementation code is as follows:
Figure BDA0004160761280000072
in the embodiment of the application, the tool is used for extracting the annotation data written in the component realization code in a fixed format, analyzing the content of the component (namely, the vue file), and taking the annotation data with special grammar characteristic positions as the extraction content, for example, the property tips of the component and the event $emit. The extraction of annotation data can be completed by adopting a vue-docgen-cli tool, and other modes can be adopted, the method is not limited in the embodiment of the application, the annotation grammar is matched with a vue-docgen-cli tool, and if the using tool is replaced, the grammar corresponding to the tool is required to be replaced correspondingly. And automatically generating the component document in a MarkDown format according to the content of the component document, and simultaneously designing a mode of manually maintaining the component document of a special component, so that the component document can be maintained in a personalized mode.
Executing the execution script of the vue-docgen-cli tool, extracting the content of the component document from the component realization code, and generating the component document and the mapping relation file in the MarkDown format. The name of the component example page needs to meet a certain specification, so that the corresponding component file can be conveniently searched. Taking a button assembly as an example: the component example page path is "example/button. Vue", and the corresponding component file path is "components/button. Vue". For component instance pages that do not meet the specification, additional special mappings need to be configured. Take a calendar component as an example:
const specialExamplePageToComponentMap = { "date-pipe/date-pipe/js",/. Other example pages omitted/}
Specifically, a component document in the MarkDown format is generated from the content of the component document, and the implementation code is as follows, taking a button component (docs/button. Doc. Md file) as an example:
##Button
attribute # #
Omitting details
Method of # # - #
Omitting details
Event # #
Omitting details
# # slot
Omitting details
Specifically, a mapping relation file of a component example page and a component document in a Markdown format is generated, and the content of the file is exemplified by a button component:
{ "button.vue": "button/button.doc.md",/. Other components omitted/}
For a few special components, add component instance pages that need to be ignored to the configuration list, take notification component instance pages (example/notify. Vue file) as an example:
const ignoreExamplePages = [ 'notify.vue',/other example pages omitted/]
In one possible implementation, if the target component document is a special component document, the method further includes: and manually maintaining a special mapping relation between the special component document and the special component example page, wherein the special component document is a component document which cannot generate a MarkDown format.
The component example page and the component document of the corresponding component in the configuration list are manually maintained, and also taking the notification component (docs/notify/notify.doc.md) as an example, the document content of the notification component in the notify.doc.md file needs to be in the same format as the component document in Markdown format generated by the non-specific component.
In the special mapping relation file, a mapping relation from a component example page of the configuration list to the added component document is maintained. As an example, the file content takes the notification notify component as an example, the implementation code is as follows:
{ "notify.vue": "notify/notify.doc.md",/. Other components omitted/}
The notify component, unlike other component writing methods, cannot use tools to generate a component document in Markdown format. After manually maintaining the docs/notify/notify.doc.md file, the md file needs to take part in the subsequent process, so the component document and the corresponding special mapping relationship file need to be manually maintained. Here the mapping of the notify/notify. Doc. Md file to the notify/notify. Md file is added to tell the subsequent process which.
It should be noted that the configuration list, the mapping relation file, the special mapping relation and the special mapping relation file may all adopt other formats, and accordingly, the configuration content can be correctly read and analyzed at the position where the configuration content is used. As an example, in the configuration list and the special mapping relationship, the configured content is part of the javascript file, so that the syntax format of the javascript is met. The mapping relation file and the special mapping relation file are separate json files, and the content accords with the json grammar format. Javascript, json, XML or plain text, etc., may be used, and at the same time, the code of the corresponding read configuration item needs to be modified for parsing the configuration list into data available in javascript.
According to the embodiment of the application, when the standardized component is automatically processed, the mapping relation between the component example page and the component in the code file is automatically analyzed, and the component document is manually maintained and the special mapping relation is manually maintained, so that the requirements of inserting different components into the component example page are met. And converting the component document in the MarkDown format corresponding to the component example page into an html fragment according to the mapping relation file and the mapping relation in the special mapping relation file, and inserting the html fragment into the lowest part of the component example page. The method and the device can reduce the time for a component developer to manually maintain the component document in the component example page under the condition that the total quantity of components is large and the component example page exists in the development process of the Web front-end component library, and greatly improve the compiling efficiency of the component example page.
S102: and converting the target component document into a component document html fragment.
And executing a compiling command of the project of the component example page, and when compiling to a certain component example page at the beginning of compiling the project of the component example page, reading the content of the component document corresponding to the component example page according to the generated and maintained mapping relation file. The content is in a MarkDown format, and the component document content in the MarkDown format is converted into html fragments by using a 'remark' tool and a plug-in thereof.
Taking the button assembly as an example, the mapping value "button/button. Doc. Md" of "button. Vue" is read, and then the contents of the "docs/button. Doc. Md" file are read, where the contents after conversion are:
<h2>Button</h2>
< h3> Property (h 3)
< table > < -! Omitting details
< h3> method </h3>
< -! Omitting details ]
< h3> event (h 3)
< table > < -! Omitting details
< h3> slot </h3>
< table > < -! Omitting details
It should be noted that, according to the supporting situation of the tool, component documents in other formats than the target component document in Markdown format may be generated, and the "remark" tool also needs to be converted into a tool capable of converting the document in the corresponding format into html fragments. If the html fragment can be generated directly, then the "remark" tool can be omitted.
In the compiling process of the component example page, converting the component document in the Markdown format corresponding to the component example page into an html fragment according to the mapping relation in the mapping relation file and the special mapping relation file, and inserting the html fragment into the component example page. Thus, the integration of the component document with the component instance page is completed. And the developer of the component only needs to pay attention to the name of the component example page, the annotation used for generating the component document in the component realization code and the component document of a few special components.
S103: and inserting the component document html fragment into the target component example page to complete compiling of the target component example page.
In one possible implementation manner, the inserting the component document html fragment into the target component example page includes: and inserting the html fragments of the component document into preset positions of the target component example page according to the component realization code.
Taking a button assembly as an example, the implementation code is as follows:
Figure BDA0004160761280000101
Figure BDA0004160761280000111
the preset positions of the inserts are controlled in the implementation code and are not random. Generally, the preset position may be set to be the lowest page.
And continuing compiling the item of the component instance page to generate the final Web application code.
In the Web front-end component library development process, in the case where the total number of components is large and there is already a component example page, a component developer needs to spend a lot of time manually maintaining a component document in the component example page. The method has the advantages that the standardized components are automatically processed, meanwhile, the mode of manually maintaining the component documents and special mapping relations is adopted, and the requirements of inserting the component documents into the component example pages by different components are met.
Based on the related content of the S101-S103, obtaining a target component document in a Markdown format corresponding to the target component example page according to the mapping relation file of the component example page and the component document in the Markdown format; converting the target component document into a component document html fragment; and inserting the component document html fragment into the target component example page to complete compiling of the target component example page. In this way, the target component document in the Markdown format corresponding to the target component example page is converted into the component document html fragment, and then the component document html fragment is automatically inserted into the target component example page, so that the integration of the target component document and the target component example page is completed, and the compiling efficiency of the target component example page can be improved.
The foregoing embodiments of the present application provide a method for compiling a component example page based on the foregoing description. Next, a component example page compiling apparatus that executes the method shown in fig. 1 and that performs the functions of the component example page compiling apparatus is described, where a schematic structural diagram of the component example page compiling apparatus is shown in fig. 3, and includes an acquisition module 301, a conversion module 302, and a compiling module 303.
The acquiring module 301 is configured to acquire a target component document in a Markdown format corresponding to the target component example page according to a mapping relationship file between the component example page and the component document in the Markdown format;
a conversion module 302, configured to convert the target component document into a component document html fragment;
and the compiling module 302 is configured to insert the component document html fragment into the target component example page, and complete compiling of the target component example page.
In one possible implementation, the apparatus further includes:
the acquiring module 301 is further configured to acquire component implementation codes according to the directory and the file name of the component example page;
the extraction module is used for extracting the document content of the component from the component realization code;
the generating module is used for generating the component document in the MarkDown format according to the component document content;
the generating module is further configured to generate a mapping relationship file between the component example page and the component document in Markdown format.
In one possible implementation manner, the extracting module is specifically configured to:
extracting the document content of the component from the component implementation code according to annotation data, wherein the annotation data comprises the name, the attribute, the event, the slot and the externally callable method of the component.
In one possible implementation manner, the compiling module 303 is configured to insert the component document html fragment into the target component example page, and includes:
and inserting the html fragments of the component document into preset positions of the target component example page according to the component realization code.
In one possible implementation, if the target component document is a special component document, the apparatus further includes:
the manual maintenance module is used for manually maintaining the special mapping relation between the special component document and the special component example page, wherein the special component document is a component document which cannot generate a MarkDown format.
The embodiment of the application provides a device for compiling a component example page, which comprises an acquisition module, a conversion module and a compiling module. The acquisition module is used for acquiring the target component document in the Markdown format corresponding to the target component example page according to the mapping relation file of the component example page and the component document in the Markdown format; the conversion module is used for converting the target component document into a component document html fragment; and the compiling module is used for inserting the component document html fragment into the target component example page to complete the compiling of the target component example page. In this way, the target component document in the Markdown format corresponding to the target component example page is converted into the component document html fragment, and then the component document html fragment is automatically inserted into the target component example page, so that the integration of the target component document and the target component example page is completed, and the compiling efficiency of the target component example page can be improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an exemplary page compiling device for a component according to an embodiment of the present application. Based on the method for compiling the component example page provided by the method embodiment, the embodiment of the application also provides a component example page compiling device, which comprises: a processor, memory, system bus;
the processor and the memory are connected through the system bus;
the memory is used to store one or more programs, the one or more programs comprising instructions, which when executed by the processor, cause the processor to perform the component example page compilation method of any of the embodiments above.
Based on the component example page compiling method provided by the method embodiment, the embodiment of the application further provides a computer readable storage medium, wherein the computer readable storage medium stores instructions, and when the instructions run on a device, the instructions cause the device to execute the component example page compiling method according to any one of the embodiments.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A component example page compilation method, the method comprising:
acquiring a target component document in a Markdown format corresponding to the target component example page according to the mapping relation file of the component example page and the component document in the Markdown format;
converting the target component document into a component document html fragment;
and inserting the component document html fragment into the target component example page to complete compiling of the target component example page.
2. The method according to claim 1, wherein the method further comprises:
acquiring component realization codes according to the catalogue and the file name of the component example page;
extracting component document content from the component implementation code;
generating a component document in a MarkDown format according to the component document content;
and generating a mapping relation file of the component example page and the component document in the MarkDown format.
3. The method of claim 2, wherein extracting component document content from the component implementation code comprises:
extracting the document content of the component from the component implementation code according to annotation data, wherein the annotation data comprises the name, the attribute, the event, the slot and the externally callable method of the component.
4. The method of claim 1, wherein inserting the component document html fragment into the target component instance page comprises:
and inserting the html fragments of the component document into preset positions of the target component example page according to the component realization code.
5. The method of claim 1, wherein if the target component document is a special component document, the method further comprises:
and manually maintaining a special mapping relation between the special component document and the special component example page, wherein the special component document is a component document which cannot generate a MarkDown format.
6. A component example page compilation apparatus, the apparatus comprising:
the acquisition module is used for acquiring the target component document in the Markdown format corresponding to the target component example page according to the mapping relation file of the component example page and the component document in the Markdown format;
the conversion module is used for converting the target component document into a component document html fragment;
a compiling module for inserting the html fragment of the component document into the target component example page,
and completing compiling of the target component example page.
7. The apparatus of claim 6, wherein the apparatus further comprises:
the acquisition module is also used for acquiring component realization codes according to the catalogue and the file name of the component example page;
the extraction module is used for extracting the document content of the component from the component realization code;
the generating module is used for generating the component document in the MarkDown format according to the component document content;
the generating module is further configured to generate a mapping relationship file between the component example page and the component document in Markdown format.
8. The apparatus according to claim 6, wherein the extraction module is specifically configured to:
extracting the document content of the component from the component implementation code according to annotation data, wherein the annotation data comprises the name, the attribute, the event, the slot and the externally callable method of the component.
9. The apparatus of claim 6, wherein the compiling module for inserting the component document html fragment into the target component instance page comprises:
and inserting the html fragments of the component document into preset positions of the target component example page according to the component realization code.
10. The apparatus of claim 6, wherein if the target component document is a special component document, the apparatus further comprises:
the manual maintenance module is used for manually maintaining the special mapping relation between the special component document and the special component example page, wherein the special component document is a component document which cannot generate a MarkDown format.
CN202310347779.3A 2023-04-03 2023-04-03 Method and device for compiling component example page Pending CN116360793A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310347779.3A CN116360793A (en) 2023-04-03 2023-04-03 Method and device for compiling component example page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310347779.3A CN116360793A (en) 2023-04-03 2023-04-03 Method and device for compiling component example page

Publications (1)

Publication Number Publication Date
CN116360793A true CN116360793A (en) 2023-06-30

Family

ID=86907631

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310347779.3A Pending CN116360793A (en) 2023-04-03 2023-04-03 Method and device for compiling component example page

Country Status (1)

Country Link
CN (1) CN116360793A (en)

Similar Documents

Publication Publication Date Title
US8176412B2 (en) Generating formatted documents
US7568184B1 (en) Software documentation generator
RU2348064C2 (en) Method and system of extending functional capacity of insertion for computer software applications
US8407585B2 (en) Context-aware content conversion and interpretation-specific views
US7739588B2 (en) Leveraging markup language data for semantically labeling text strings and data and for providing actions based on semantically labeled text strings and data
US8255790B2 (en) XML based form modification with import/export capability
US20010014900A1 (en) Method and system for separating content and layout of formatted objects
US20040221233A1 (en) Systems and methods for report design and generation
US20110023022A1 (en) Method for application authoring employing an application template stored in a database
US20080109464A1 (en) Extending Clipboard Augmentation
US9032002B2 (en) Single file serialization for physical and logical meta-model information
JP2003114882A (en) System and method for formatting contents for publication
US7707496B1 (en) Method, system, and apparatus for converting dates between calendars and languages based upon semantically labeled strings
WO2006085455A1 (en) Document processing device and document processing method
US8117610B2 (en) System and method for integrated artifact management
CN112667563A (en) Document management and operation method and system
CN111126008B (en) Code generation method and device based on XSD, computer equipment and storage medium
US20040210881A1 (en) Method of generating an application program interface for resource description framwork (RDF) based information
Ide et al. Bridging the gaps: interoperability for GrAF, GATE, and UIMA
CN116303359A (en) Method for realizing multi-type document export of database structure
CN116360793A (en) Method and device for compiling component example page
Cole et al. SGML as a component of the digital library
US7934193B2 (en) Processing a module specification to produce a module definition
Lange Mathematical semantic markup in a wiki: The roles of symbols and notations
JP2004529427A (en) Design of extensible style sheet using meta tag information

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