Improve custom rules syntax help (based on info in docs).
Also turns on table processing in ConvertMarkdown2Html(). Fixes https://gitlab.com/kicad/code/kicad/-/issues/15609
This commit is contained in:
parent
8149522c34
commit
9114578004
|
@ -692,10 +692,12 @@ void PANEL_SETUP_RULES::OnSyntaxHelp( wxHyperlinkEvent& aEvent )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_helpWindow = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) );
|
m_helpWindow = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) );
|
||||||
m_helpWindow->SetDialogSizeInDU( 320, 320 );
|
m_helpWindow->SetDialogSizeInDU( 420, 320 );
|
||||||
|
|
||||||
wxString html_txt;
|
wxString html_txt;
|
||||||
ConvertMarkdown2Html( wxGetTranslation( msg ), html_txt );
|
ConvertMarkdown2Html( wxGetTranslation( msg ), html_txt );
|
||||||
|
|
||||||
|
html_txt.Replace( wxS( "<td" ), wxS( "<td valign=top" ) );
|
||||||
m_helpWindow->AddHTML_Text( html_txt );
|
m_helpWindow->AddHTML_Text( html_txt );
|
||||||
|
|
||||||
m_helpWindow->ShowModeless();
|
m_helpWindow->ShowModeless();
|
||||||
|
|
|
@ -20,36 +20,31 @@
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
### Constraint Types
|
### Constraints
|
||||||
|
|
||||||
* annular\_width
|
| Constraint type | Argument type | Description |
|
||||||
* assertion
|
|---------------------------|------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
* clearance
|
| `annular_width` | min/opt/max | Checks the width of annular rings on vias.<br> |
|
||||||
* connection\_width
|
| `clearance` | min | Specifies the **electrical** clearance between copper objects of different nets. (See `physical_clearance` if you wish to specify clearance between objects regardless of net.)<br><br>To allow copper objects to overlap (collide), create a `clearance` constraint with the `min` value less than zero (for example, `-1`).<br> |
|
||||||
* courtyard_clearance
|
| `courtyard_clearance` | min | Checks the clearance between footprint courtyards and generates an error if any two courtyards are closer than the `min` distance. If a footprint does not have a courtyard shape, no errors will be generated from this constraint.<br> |
|
||||||
* diff\_pair\_gap
|
| `diff_pair_gap` | min/opt/max | Checks the gap between coupled tracks in a differential pair. Coupled tracks are segments that are parallel to each other. Differential pair gap is not tested on uncoupled portions of a differential pair (for example, the fanout from a component).<br> |
|
||||||
* diff\_pair\_uncoupled
|
| `diff_pair_uncoupled` | max | Checks the distance that a differential pair track is routed uncoupled from the other polarity track in the pair (for example, where the pair fans out from a component, or becomes uncoupled to pass around another object such as a via).<br> |
|
||||||
* disallow
|
| `disallow` | `track`<br>`via`<br>`micro_via`<br>`buried_via`<br>`pad`<br>`zone`<br>`text`<br>`graphic`<br>`hole`<br>`footprint`<br> | Specify one or more object types to disallow, separated by spaces. For example, `(constraint disallow track)` or `(constraint disallow track via pad)`. If an object of this type matches the rule condition, a DRC error will be created.<br><br>This constraint is essentially the same as a keepout rule area, but can be used to create more specific keepout restrictions.<br> |
|
||||||
* edge\_clearance
|
| `edge_clearance` | min/opt/max | Checks the clearance between objects and the board edge.<br><br>This can also be thought of as the "milling tolerance" as the board edge will include all graphical items on the `Edge.Cuts` layer as well as any *oval* pad holes. (See `physical_hole_clearance` for the drilling tolerance.)<br> |
|
||||||
* length
|
| `length` | min/max | Checks the total routed length for the nets that match the rule condition and generates an error for each net that is below the `min` value (if specified) or above the `max` value (if specified) of the constraint.<br> |
|
||||||
* hole\_clearance
|
| `hole` | min/max | Checks the size (diameter) of a drilled hole in a pad or via. For oval holes, the smaller (minor) diameter will be tested against the `min` value (if specified) and the larger (major) diameter will be tested against the `max` value (if specified).<br> |
|
||||||
* hole\_size
|
| `hole_clearance` | min | Checks the clearance between a drilled hole in a pad or via and copper objects on a different net. The clearance is measured from the diameter of the hole, not its center.<br> |
|
||||||
* min\_resolved\_spokes
|
| `hole_to_hole` | min | Checks the clearance between mechanically-drilled holes in pads and vias. The clearance is measured between the diameters of the holes, not between their centers.<br><br>This constraint is soley for the protection of drill bits. The clearance between **laser-drilled** (microvias) and other non-mechanically-drilled holes is not checked, nor is the clearance between **milled** (oval-shaped) and other non-mechanically-drilled holes.<br> |
|
||||||
* physical\_clearance
|
| `physical_clearance` | min | Checks the clearance between two objects on a given layer (including non-copper layers).<br><br>While this can perform more general-purpose checks than `clearance`, it is much slower. Use `clearance` where possible.<br> |
|
||||||
* physical\_hole\_clearance
|
| `physical_hole_clearance` | min | Checks the clearance between a drilled hole in a pad or via and another object, regardless of net. The clearance is measured from the diameter of the hole, not its center.<br><br>This can also be thought of as the "drilling tolerance" as it only includes **round** holes (see `edge_clearance` for the milling tolerance).<br> |
|
||||||
* silk\_clearance
|
| `silk_clearance` | min/opt/max | Checks the clearance between objects on silkscreen layers and other objects.<br> |
|
||||||
* skew
|
| `skew` | max | Checks the total skew for the nets that match the rule condition, that is, the difference between the length of each net and the average of all the lengths of each net that is matched by the rule. If the absolute value of the difference between that average and the length of any one net is above the constraint `max` value, an error will be generated.<br> |
|
||||||
* text\_height
|
| `thermal_relief_gap` | min | Specifies the width of the gap between a pad and a zone with a thermal-relief connection.<br> |
|
||||||
* text\_thickness
|
| `thermal_spoke_width` | opt | Specifies the width of the spokes connecting a pad to a zone with a thermal-relief connection.<br> |
|
||||||
* thermal\_relief\_gap
|
| `track_width` | min/opt/max | Checks the width of track and arc segments. An error will be generated for each segment that has a width below the `min` value (if specified) or above the `max` value (if specified).<br> |
|
||||||
* thermal\_spoke\_width
|
| `via_count` | max | Counts the number of vias on every net matched by the rule condition. If that number exceeds the constraint `max` value on any matched net, an error will be generated for that net.<br> |
|
||||||
* track\_width
|
| `zone_connection` | `solid`<br>`thermal_reliefs`<br>`none` | Specifies the connection to be made between a zone and a pad.<br> |
|
||||||
* via\_count
|
|
||||||
* via\_diameter
|
|
||||||
* zone\_connection
|
|
||||||
|
|
||||||
Note: `clearance` and `hole_clearance` rules are not run against items of the same net; `physical_clearance` and `physical_hole_clearance` rules are.
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
### Items
|
### Items
|
||||||
|
|
||||||
|
@ -59,28 +54,6 @@ Note: `clearance` and `hole_clearance` rules are not run against items of the sa
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
### Item Types
|
|
||||||
|
|
||||||
* buried\_via
|
|
||||||
* graphic
|
|
||||||
* hole
|
|
||||||
* micro\_via
|
|
||||||
* pad
|
|
||||||
* text
|
|
||||||
* track
|
|
||||||
* via
|
|
||||||
* zone
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
### Zone Connections
|
|
||||||
|
|
||||||
* solid
|
|
||||||
* thermal\_reliefs
|
|
||||||
* none
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
### Severity Names
|
### Severity Names
|
||||||
|
|
||||||
* warning
|
* warning
|
||||||
|
|
|
@ -21,36 +21,31 @@ _HKI( "### Top-level Clauses\n"
|
||||||
"\n"
|
"\n"
|
||||||
"<br>\n"
|
"<br>\n"
|
||||||
"\n"
|
"\n"
|
||||||
"### Constraint Types\n"
|
"### Constraints\n"
|
||||||
"\n"
|
"\n"
|
||||||
" * annular\\_width\n"
|
"| Constraint Type | Argument Type | Description |\n"
|
||||||
" * assertion\n"
|
"|---------------------------|-------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n"
|
||||||
" * clearance\n"
|
"| `annular_width` | min/opt/max | Checks the width of annular rings on vias.<br> | \n"
|
||||||
" * connection\\_width\n"
|
"| `clearance` | min | Specifies the **electrical** clearance between copper objects of different nets. (See `physical_clearance` if you wish to specify clearance between objects regardless of net.)<br><br>To allow copper objects to overlap (collide), create a `clearance` constraint with the `min` value less than zero (for example, `-1`).<br> |\n"
|
||||||
" * courtyard_clearance\n"
|
"| `courtyard_clearance` | min | Checks the clearance between footprint courtyards and generates an error if any two courtyards are closer than the `min` distance. If a footprint does not have a courtyard shape, no errors will be generated from this constraint.<br> |\n"
|
||||||
" * diff\\_pair\\_gap\n"
|
"| `diff_pair_gap` | min/opt/max | Checks the gap between coupled tracks in a differential pair. Coupled tracks are segments that are parallel to each other. Differential pair gap is not tested on uncoupled portions of a differential pair (for example, the fanout from a component).<br> |\n"
|
||||||
" * diff\\_pair\\_uncoupled\n"
|
"| `diff_pair_uncoupled` | max | Checks the distance that a differential pair track is routed uncoupled from the other polarity track in the pair (for example, where the pair fans out from a component, or becomes uncoupled to pass around another object such as a via).<br> |\n"
|
||||||
" * disallow\n"
|
"| `disallow` | `track`<br>`via`<br>`micro_via`<br>`buried_via`<br>`pad`<br>`zone`<br>`text`<br>`graphic`<br>`hole`<br>`footprint`<br> | Specify one or more object types to disallow, separated by spaces. For example, `(constraint disallow track)` or `(constraint disallow track via pad)`. If an object of this type matches the rule condition, a DRC error will be created.<br><br>This constraint is essentially the same as a keepout rule area, but can be used to create more specific keepout restrictions.<br> |\n"
|
||||||
" * edge\\_clearance\n"
|
"| `edge_clearance` | min/opt/max | Checks the clearance between objects and the board edge.<br><br>This can also be thought of as the \"milling tolerance\" as the board edge will include all graphical items on the `Edge.Cuts` layer as well as any *oval* pad holes. (See `physical_hole_clearance` for the drilling tolerance.)<br> |\n"
|
||||||
" * length\n"
|
"| `length` | min/max | Checks the total routed length for the nets that match the rule condition and generates an error for each net that is below the `min` value (if specified) or above the `max` value (if specified) of the constraint.<br> |\n"
|
||||||
" * hole\\_clearance\n"
|
"| `hole` | min/max | Checks the size (diameter) of a drilled hole in a pad or via. For oval holes, the smaller (minor) diameter will be tested against the `min` value (if specified) and the larger (major) diameter will be tested against the `max` value (if specified).<br> |\n"
|
||||||
" * hole\\_size\n"
|
"| `hole_clearance` | min | Checks the clearance between a drilled hole in a pad or via and copper objects on a different net. The clearance is measured from the diameter of the hole, not its center.<br> |\n"
|
||||||
" * min\\_resolved\\_spokes\n"
|
"| `hole_to_hole` | min | Checks the clearance between mechanically-drilled holes in pads and vias. The clearance is measured between the diameters of the holes, not between their centers.<br><br>This constraint is soley for the protection of drill bits. The clearance between **laser-drilled** (microvias) and other non-mechanically-drilled holes is not checked, nor is the clearance between **milled** (oval-shaped) and other non-mechanically-drilled holes.<br> | \n"
|
||||||
" * physical\\_clearance\n"
|
"| `physical_clearance` | min | Checks the clearance between two objects on a given layer (including non-copper layers).<br><br>While this can perform more general-purpose checks than `clearance`, it is much slower. Use `clearance` where possible.<br> |\n"
|
||||||
" * physical\\_hole\\_clearance\n"
|
"| `physical_hole_clearance` | min | Checks the clearance between a drilled hole in a pad or via and another object, regardless of net. The clearance is measured from the diameter of the hole, not its center.<br><br>This can also be thought of as the \"drilling tolerance\" as it only includes **round** holes (see `edge_clearance` for the milling tolerance).<br> | \n"
|
||||||
" * silk\\_clearance\n"
|
"| `silk_clearance` | min/opt/max | Checks the clearance between objects on silkscreen layers and other objects.<br> |\n"
|
||||||
" * skew\n"
|
"| `skew` | max | Checks the total skew for the nets that match the rule condition, that is, the difference between the length of each net and the average of all the lengths of each net that is matched by the rule. If the absolute value of the difference between that average and the length of any one net is above the constraint `max` value, an error will be generated.<br> |\n"
|
||||||
" * text\\_height\n"
|
"| `thermal_relief_gap` | min | Specifies the width of the gap between a pad and a zone with a thermal-relief connection.<br> |\n"
|
||||||
" * text\\_thickness\n"
|
"| `thermal_spoke_width` | opt | Specifies the width of the spokes connecting a pad to a zone with a thermal-relief connection.<br> |\n"
|
||||||
" * thermal\\_relief\\_gap\n"
|
"| `track_width` | min/opt/max | Checks the width of track and arc segments. An error will be generated for each segment that has a width below the `min` value (if specified) or above the `max` value (if specified).<br> |\n"
|
||||||
" * thermal\\_spoke\\_width\n"
|
"| `via_count` | max | Counts the number of vias on every net matched by the rule condition. If that number exceeds the constraint `max` value on any matched net, an error will be generated for that net.<br> |\n"
|
||||||
" * track\\_width\n"
|
"| `zone_connection` | `solid`<br>`thermal_reliefs`<br>`none` | Specifies the connection to be made between a zone and a pad.<br> |\n"
|
||||||
" * via\\_count\n"
|
|
||||||
" * via\\_diameter\n"
|
|
||||||
" * zone\\_connection\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
"Note: `clearance` and `hole_clearance` rules are not run against items of the same net; `physical_clearance` and `physical_hole_clearance` rules are.\n"
|
|
||||||
"<br><br>\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
"### Items\n"
|
"### Items\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -60,28 +55,6 @@ _HKI( "### Top-level Clauses\n"
|
||||||
"\n"
|
"\n"
|
||||||
"<br>\n"
|
"<br>\n"
|
||||||
"\n"
|
"\n"
|
||||||
"### Item Types\n"
|
|
||||||
"\n"
|
|
||||||
" * buried\\_via\n"
|
|
||||||
" * graphic\n"
|
|
||||||
" * hole\n"
|
|
||||||
" * micro\\_via\n"
|
|
||||||
" * pad\n"
|
|
||||||
" * text\n"
|
|
||||||
" * track\n"
|
|
||||||
" * via\n"
|
|
||||||
" * zone\n"
|
|
||||||
"\n"
|
|
||||||
"<br>\n"
|
|
||||||
"\n"
|
|
||||||
"### Zone Connections\n"
|
|
||||||
"\n"
|
|
||||||
" * solid\n"
|
|
||||||
" * thermal\\_reliefs\n"
|
|
||||||
" * none\n"
|
|
||||||
"\n"
|
|
||||||
"<br>\n"
|
|
||||||
"\n"
|
|
||||||
"### Severity Names\n"
|
"### Severity Names\n"
|
||||||
"\n"
|
"\n"
|
||||||
" * warning\n"
|
" * warning\n"
|
||||||
|
|
|
@ -38,7 +38,7 @@ void ConvertMarkdown2Html( const wxString& aMarkdownInput, wxString& aHtmlOutput
|
||||||
struct buf* ob = bufnew( OUTPUT_UNIT );
|
struct buf* ob = bufnew( OUTPUT_UNIT );
|
||||||
|
|
||||||
sdhtml_renderer( &callbacks, &options, 0 );
|
sdhtml_renderer( &callbacks, &options, 0 );
|
||||||
struct sd_markdown* markdown = sd_markdown_new( 0, 16, &callbacks, &options );
|
struct sd_markdown* markdown = sd_markdown_new( MKDEXT_TABLES, 16, &callbacks, &options );
|
||||||
|
|
||||||
sd_markdown_render( ob, (uint8_t*)markdownInput.data(), markdownInput.size(), markdown );
|
sd_markdown_render( ob, (uint8_t*)markdownInput.data(), markdownInput.size(), markdown );
|
||||||
sd_markdown_free( markdown );
|
sd_markdown_free( markdown );
|
||||||
|
|
Loading…
Reference in New Issue