1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-17 09:04:43 +00:00

Add Export feature to documentation

Also, removed "include symbol table" from export dialog.  You can
exclude the table by removing it from the template, which right
now  you'd need to do anyway to get rid of the H2 header and other
framing.  To make this work correctly as an option we'd need to
parse the "div" in the template file and strip the whole section,
or split the template into multiple parts that get included as
needed.  Not worth doing the work until we're sure it matters.
This commit is contained in:
Andy McFadden 2019-09-13 18:22:34 -07:00
parent d3ff1f6eff
commit be2b1e7bba
6 changed files with 62 additions and 19 deletions

View File

@ -125,7 +125,6 @@ namespace SourceGen {
public const string EXPORT_COL_WIDTHS = "export-col-widths";
public const string EXPORT_TEXT_MODE = "export-text-mode";
public const string EXPORT_SELECTION_ONLY = "export-selection-only";
public const string EXPORT_INCLUDE_SYMTAB = "export-include-symtab";
// Internal debugging features.
public const string DEBUG_MENU_ENABLED = "debug-menu-enabled";

View File

@ -18,6 +18,9 @@ the target assembler, will recreate the original data file exactly.
Every assembler is different, so support must be added to SourceGen
for each.</p>
<p>The generation / assembly dialog can be opened with File &gt; Assemble.</p>
<p>If you want to show code to others, perhaps by adding a page to
your web site, you can "export" the formatted code as text or HTML.
This is explained in more detail <a href="#export-source">below</a>.
<h2><a name="supported">Supported Assemblers</a></h2>
@ -299,6 +302,57 @@ code, but also needs to know how to handle the corner cases.</p>
<li>No undocumented opcodes are supported.</li>
</ul>
<h2><a name="export-source">Exporting Source Code</a></h2>
<p>The "export" function takes what you see in the code list in the app
and converts it to text or HTML. The options you've set in the app
settings, such as capitalization, text delimiters, pseudo-opcode names,
and operand expression style, are all taken into account. The file
generated is not expected to work with an actual assembler.</p>
<p>The text output is similar to what you'd get by copying lines to the
clipboard and pasting them into a text file, except that you have greater
control over which columns are included. The HTML version is augmented
with links.</p>
<p>Use File > Export to open the export dialog. You have several options:</p>
<ul>
<li><b>Include only selected lines</b>. This allows you to choose between
exporting all or part of a file. If no lines are selected, the entire
file will exported. This setting does <b>not</b> affect link generation
for HTML output, so you my have some dead internal links if you don't
export the entire file.</li>
<li><b>Include notes</b>. Notes are normally excluded from generated
sources. Check this to include them.</li>
<li><b>Show &lt;Column&gt;</b>. The leftmost five columns are optional,
and will not appear in the output unless the appropriate option is
checked.</li>
<li><b>Column widths</b>. These determine the minimum widths of the
rightmost four columns. These are not hard limits: if the contents
of the column are too wide, the next column will start farther over.
The width specified does not include the space character that is
automatically added between fields. The widths are not used at
all for CSV output.</li>
<li><b>Text vs. CSV</b>. For text generation, you can choose between
plain text and Comma-Separated Value format. The latter is useful
for importing source code into another application, such as a
spreadsheet.</li>
<li><b>Overwrite CSS file</b>. Some aspects of the HTML output's format
are defined by a file called "SGStyle.css", which may be shared between
multiple HTML files and customized. The file is copied out
of the RuntimeData directory without modification. It will be
created if it doesn't exist, but will not be overwritten unless this
box is checked. The setting is <b>not</b> sticky, and will revert
to unchecked. (Think of this as a proactive alternative to "are you
sure you wish to overwrite SGStyle.css?")</li>
</ul>
<p>Once you've picked your options, click either "Generate HTML" or
"Generate Text", then select an output file name from the standard file
dialog. Any additional files generated, such as graphics for HTML pages,
will be written to the same directory.</p>
<p>All output uses UTF-8 encoding.</p>
</div>
<div id="footer">

View File

@ -496,11 +496,10 @@ code snippets into forum postings or documentation. The text is
copied from the data shown on screen, so your chosen capitalization
and pseudo-ops will appear in the copy.</p>
<p>Long comments are included, but notes are not.</p>
<p>By default, the label, opcode, operand, and comment fields are included.
From the
<p>By default, only the label, opcode, operand, and comment fields are
included. From the
<a href="settings.html#app-settings">app settings</a> dialog you can select
a different format, "Disassembly", which also includes the address and byte
columns.</p>
alternative formats that include additional columns.</p>
<p>A copy of all of the fields is also written to the clipboard in CSV
format. If you have a spreadsheet like Excel, you can use Paste Special

View File

@ -57,12 +57,13 @@ is no setting for labels, which are always case-sensitive.</p>
<a href="mainwin.html#clipboard">copied to the clipboard</a>. The
"Assembler Source" format includes the rightmost columns (label,
opcode, operand, and comment), like assembly source code does. The
"Disassembly" format adds the address and bytes on the left.</p>
"Disassembly" format adds the address and bytes on the left. Use
the "All Columns" format to get all columns.</p>
<p>The "add spaces in bytes column" checkbox changes the format of the
hex data in the code list "bytes" column from dense (<code>20edfd</code>)
to spaced (<code>20 ed fd</code>). This also affects the way the
"Disassembly" copy &amp; paste format looks.</p>
to spaced (<code>20 ed fd</code>). This also affects the format of
clipboard copies and exports.</p>
<h3><a name="appset-textdelim">Text Delimiters</a></h3>
@ -88,7 +89,7 @@ and end of the operand. For string operands, the prefix is added to the
start of the first line, and suffixes aren't allowed.
<p>These options change the way the code list looks on screen. They
do not affect generated code, which must use the delimiter characters
specified by the assembler.</p>
specified by the chosen assembler.</p>
<h3><a name="appset-asmconfig">Asm Config</a></h3>

View File

@ -99,7 +99,6 @@ limitations under the License.
<GroupBox Grid.Row="2" Header="HTML Options" Padding="2,4">
<StackPanel>
<CheckBox Content="Include symbol table" IsChecked="{Binding IncludeSymbolTable}"/>
<CheckBox Content="Overwrite CSS file" Margin="0,2,0,0" IsChecked="{Binding OverwriteCss}"/>
</StackPanel>
</GroupBox>

View File

@ -153,12 +153,6 @@ namespace SourceGen.WpfGui {
set { mTextModeCsv = value; OnPropertyChanged(); }
}
private bool mIncludeSymbolTable;
public bool IncludeSymbolTable {
get { return mIncludeSymbolTable; }
set { mIncludeSymbolTable = value; OnPropertyChanged(); }
}
private bool mOverwriteCss;
public bool OverwriteCss {
get { return mOverwriteCss; }
@ -208,8 +202,6 @@ namespace SourceGen.WpfGui {
ShowFlags = AppSettings.Global.GetBool(AppSettings.EXPORT_SHOW_FLAGS, false);
ShowAttr = AppSettings.Global.GetBool(AppSettings.EXPORT_SHOW_ATTR, false);
SelectionOnly = AppSettings.Global.GetBool(AppSettings.EXPORT_SELECTION_ONLY, false);
IncludeSymbolTable = AppSettings.Global.GetBool(AppSettings.EXPORT_INCLUDE_SYMTAB,
false);
int[] colWidths = new int[] { 9, 8, 11, 72 }; // 100-col output
string colStr = AppSettings.Global.GetString(AppSettings.EXPORT_COL_WIDTHS, null);
@ -247,7 +239,6 @@ namespace SourceGen.WpfGui {
AppSettings.Global.SetBool(AppSettings.EXPORT_SHOW_FLAGS, ShowFlags);
AppSettings.Global.SetBool(AppSettings.EXPORT_SHOW_ATTR, ShowAttr);
AppSettings.Global.SetBool(AppSettings.EXPORT_SELECTION_ONLY, SelectionOnly);
AppSettings.Global.SetBool(AppSettings.EXPORT_INCLUDE_SYMTAB, IncludeSymbolTable);
int[] colWidths = new int[] {
AsmLabelColWidth, AsmOpcodeColWidth, AsmOperandColWidth, AsmCommentColWidth
};