Move sch_text help into markdown file
This commit is contained in:
parent
42496a7d62
commit
006e383f2a
|
@ -22,6 +22,7 @@ eeschema/dialogs/dialog_bom_cfg_lexer.h
|
|||
common/template_fieldnames_keywords.cpp
|
||||
common/template_fieldnames_lexer.h
|
||||
eeschema/schematic_keywords.*
|
||||
eeschema/sch_text_help_md.h
|
||||
pcbnew/pcb_plot_params_keywords.cpp
|
||||
pcbnew/pcb_plot_params_lexer.h
|
||||
pcbnew/dialogs/panel_setup_rules_help_md.h
|
||||
|
|
|
@ -330,6 +330,23 @@ set_source_files_properties( dialogs/dialog_bom.cpp
|
|||
OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_help_md.h
|
||||
)
|
||||
|
||||
# Create a C++ compilable string initializer containing markdown text into a *.h file:
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help_md.h
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DinputFile=${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help.md
|
||||
-DoutputFile=${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help_md.h
|
||||
-P ${CMAKE_MODULE_PATH}/markdown2C.cmake
|
||||
DEPENDS ${CMAKE_MODULE_PATH}/markdown2C.cmake ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help.md
|
||||
COMMENT "creating ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help_md.h
|
||||
from ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help.md"
|
||||
)
|
||||
|
||||
set_source_files_properties( sch_text.cpp
|
||||
PROPERTIES
|
||||
OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help_md.h
|
||||
)
|
||||
|
||||
if( APPLE )
|
||||
# setup bundle
|
||||
set( EESCHEMA_RESOURCES eeschema.icns eeschema_doc.icns )
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include <project/project_file.h>
|
||||
#include <project/net_settings.h>
|
||||
#include <sch_iref.h>
|
||||
#include <dialog_helpers.h>
|
||||
|
||||
using KIGFX::SCH_RENDER_SETTINGS;
|
||||
|
||||
|
@ -1237,136 +1238,16 @@ BITMAP_DEF SCH_HIERLABEL::GetMenuImage() const
|
|||
|
||||
HTML_MESSAGE_BOX* SCH_TEXT::ShowSyntaxHelp( wxWindow* aParentWindow )
|
||||
{
|
||||
wxString msg = _(
|
||||
"<table>"
|
||||
" <tr>"
|
||||
" <th>Markup</th>"
|
||||
" <th></th>"
|
||||
" <th>Result</th>"
|
||||
" </tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>^{superscript}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp><sup>superscript</sup> </samp></td>"
|
||||
" </tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>Driver Board^{Rev A}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp>Driver Board<sup>Rev A</sup></samp></td>"
|
||||
" </tr>"
|
||||
" <tr><td><br></td></tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>_{subscript}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp><sub>subscript</sub> </samp></td>"
|
||||
" </tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>D_{0} - D_{15}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp>D<sub>0</sub> - D<sub>31</sub></samp></td>"
|
||||
" </tr>"
|
||||
" <tr><td></td></tr>"
|
||||
" <tr>"
|
||||
" <td>"
|
||||
" <br><samp>~overbar</samp><br>"
|
||||
" <br><samp>~CLK</samp><br>"
|
||||
" <br><samp>~~</samp>"
|
||||
" </td>"
|
||||
" <td></td>"
|
||||
" <td>"
|
||||
" <samp><u> </u></samp><br>"
|
||||
" <samp>overbar</samp><br>"
|
||||
" <samp><u> </u></samp><br>"
|
||||
" <samp>CLK</samp><br>"
|
||||
" <samp> </samp><br>"
|
||||
" <samp>~</samp>"
|
||||
" </td>"
|
||||
" </tr>"
|
||||
" <tr><td><br></td></tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>${variable}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp><i>variable_value</i></samp></td>"
|
||||
" </tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>${REVISION}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp>2020.1</samp></td>"
|
||||
" </tr>"
|
||||
" <tr><td><br></td></tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>${refdes:field}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp><i>field_value</i> of symbol <i>refdes</i></samp></td>"
|
||||
" </tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>${R3:VALUE}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp>150K</samp></td>"
|
||||
" </tr>"
|
||||
" <tr><td><br></td></tr>"
|
||||
" <tr><td><br></td></tr>"
|
||||
" <tr>"
|
||||
" <th>Bus Definition</th>"
|
||||
" <th> </th>"
|
||||
" <th>Resultant Nets</th>"
|
||||
" </tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>prefix[m..n]</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp>prefixm to prefixn</samp></td>"
|
||||
" </tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>D[0..7]</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp>D0, D1, D2, D3, D4, D5, D6, D7</samp></td>"
|
||||
" </tr>"
|
||||
" <tr><td><br></td></tr>"
|
||||
" <tr><samp>"
|
||||
" <td> <br><samp>{net1 net2 ...}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp>net1, net2, ...</samp></td>"
|
||||
" </tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>{SCL SDA}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp>SCL, SDA</samp></td>"
|
||||
" </tr></samp>"
|
||||
" <tr><td><br></td></tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>prefix{net1 net2 ...}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp>prefix.net1, prefix.net2, ...</samp></td>"
|
||||
" </tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>USB1{DP DM}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br><samp>USB1.DP, USB1.DM</samp></td>"
|
||||
" </tr>"
|
||||
" <tr><td><br></td></tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>MEM{D[1..2] LATCH}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td> <br>"
|
||||
" <samp>MEM.D1, MEM.D2, MEM.LATCH</samp>"
|
||||
" </td>"
|
||||
" </tr>"
|
||||
" <tr>"
|
||||
" <td> <br><samp>MEM{D_{[1..2]} ~LATCH}</samp></td>"
|
||||
" <td></td>"
|
||||
" <td>"
|
||||
" <samp> "
|
||||
" "
|
||||
" <u> </u></samp><br>"
|
||||
" <samp>MEM.D<sub>1</sub>, MEM.D<sub>2</sub>, MEM.LATCH</samp>"
|
||||
" </td>"
|
||||
" </tr>"
|
||||
"</table>" );
|
||||
wxString msg =
|
||||
#include "sch_text_help_md.h"
|
||||
;
|
||||
|
||||
HTML_MESSAGE_BOX* dlg = new HTML_MESSAGE_BOX( aParentWindow, _( "Syntax Help" ) );
|
||||
dlg->SetDialogSizeInDU( 280, 280 );
|
||||
|
||||
dlg->AddHTML_Text( msg );
|
||||
wxString html_txt;
|
||||
ConvertMarkdown2Html( wxGetTranslation( msg ), html_txt );
|
||||
dlg->m_htmlWindow->AppendToPage( html_txt );
|
||||
dlg->ShowModeless();
|
||||
|
||||
return dlg;
|
||||
|
|
|
@ -0,0 +1,124 @@
|
|||
<table>
|
||||
<tr>
|
||||
<th>Markup</th>
|
||||
<th></th>
|
||||
<th>Result</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>^{superscript}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp><sup>superscript</sup> </samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>Driver Board^{Rev A}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp>Driver Board<sup>Rev A</sup></samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>_{subscript}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp><sub>subscript</sub> </samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>D_{0} - D_{15}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp>D<sub>0</sub> - D<sub>31</sub></samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>~overbar</samp><br> <br><samp>~CLK</samp><br> <br><samp>~~</samp> </td>
|
||||
<td></td>
|
||||
<td> <samp><u> </u></samp><br> <samp>overbar</samp><br> <samp><u> </u></samp><br> <samp>CLK</samp><br> <samp> </samp><br> <samp>~</samp> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>${variable}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp><i>variable_value</i></samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>${REVISION}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp>2020.1</samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>${refdes:field}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp><i>field_value</i> of symbol <i>refdes</i></samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>${R3:VALUE}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp>150K</samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Bus Definition</th>
|
||||
<th> </th>
|
||||
<th>Resultant Nets</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>prefix[m..n]</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp>prefixm to prefixn</samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>D[0..7]</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp>D0, D1, D2, D3, D4, D5, D6, D7</samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
</tr>
|
||||
<tr><samp>
|
||||
<td> <br><samp>{net1 net2 ...}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp>net1, net2, ...</samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>{SCL SDA}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp>SCL, SDA</samp></td>
|
||||
</tr></samp>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>prefix{net1 net2 ...}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp>prefix.net1, prefix.net2, ...</samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>USB1{DP DM}</samp></td>
|
||||
<td></td>
|
||||
<td> <br><samp>USB1.DP, USB1.DM</samp></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>MEM{D[1..2] LATCH}</samp></td>
|
||||
<td></td>
|
||||
<td> <br> <samp>MEM.D1, MEM.D2, MEM.LATCH</samp> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <br><samp>MEM{D_{[1..2]} ~LATCH}</samp></td>
|
||||
<td></td>
|
||||
<td> <samp> <u> </u></samp><br> <samp>MEM.D<sub>1</sub>, MEM.D<sub>2</sub>, MEM.LATCH</samp> </td>
|
||||
</tr>
|
||||
</table>
|
Loading…
Reference in New Issue