The design draft inspection can find layers in the design draft that do not conform to the transcoding specification, such as problems such as not using Semi components and instances not marked. After solving the problems, a more usable code product can be obtained.
If you don't know the design draft rules, you can check design draft rules.
In the "Design to code" Tab, click Start generate to inspect the design draft.
Inspection include info, warning, and error types.
Generally speaking, you only need to care about the error and warning types, and info is the prompt information.
One 🌰, in the inspection results shown in the figure below, there are 10 Semi components and 1 image node info, and 1 unmarked instance node warning.
Click the inspection card to enter the inspection details page, and click "Locate Node" to locate the corresponding node.
If there is a repair operation, it will be displayed on the problem details page.
If you need to re-inspect, click to select a new layer, and click to start generate.
Go back to D2C
After confirming that there is no problem, click "Generate code now" to proceed to the next step, translating the design draft.
Default supported checks
|Inspection Name||Inspection Description||Inspection Type||Recommendation|
|tableInvalid||Table contains unrecognized content||error||Use Semi Table component, see Table documentation|
|instanceNoMark||This node is an instance node and cannot be recognized as a Semi component||warning||Use the latest Semi UI Kit, replace this node or make a custom mark|
|semiComponent||This node is a legal Semi component or Semi Icon||info|
|customMark||The node has a custom mark||info|
|image||This node will be translated into img after transcoding||info||View what situations will be converted into images|
|autoWrapper||This node will be created as a parent node||info||See How to group automatically|
Custom Inspection plugin
Implement custom prompts through custom inspection plugins. The plug-in has not opened this ability yet.
Plugin Type Definition
Write a check plugin
Take the image inspection plugin as an example.
Packaging of custom plugins
It is recommended to package plugins in UMD format.
Used in D2C plugins