From be2b1e7bba51ad3a874c33c120f1b5cd5022d0c8 Mon Sep 17 00:00:00 2001
From: Andy McFadden
Date: Fri, 13 Sep 2019 18:22:34 -0700
Subject: [PATCH] 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.
---
SourceGen/AppSettings.cs | 1 -
SourceGen/RuntimeData/Help/codegen.html | 54 ++++++++++++++++++++++++
SourceGen/RuntimeData/Help/mainwin.html | 7 ++-
SourceGen/RuntimeData/Help/settings.html | 9 ++--
SourceGen/WpfGui/Export.xaml | 1 -
SourceGen/WpfGui/Export.xaml.cs | 9 ----
6 files changed, 62 insertions(+), 19 deletions(-)
diff --git a/SourceGen/AppSettings.cs b/SourceGen/AppSettings.cs
index 3c25e5d..40a81fa 100644
--- a/SourceGen/AppSettings.cs
+++ b/SourceGen/AppSettings.cs
@@ -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";
diff --git a/SourceGen/RuntimeData/Help/codegen.html b/SourceGen/RuntimeData/Help/codegen.html
index a5e56aa..9036d7e 100644
--- a/SourceGen/RuntimeData/Help/codegen.html
+++ b/SourceGen/RuntimeData/Help/codegen.html
@@ -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.
The generation / assembly dialog can be opened with File > Assemble.
+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 below.
@@ -299,6 +302,57 @@ code, but also needs to know how to handle the corner cases.
No undocumented opcodes are supported.
+
+
+
+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.
+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.
+
+Use File > Export to open the export dialog. You have several options:
+
+ - Include only selected lines. 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 not affect link generation
+ for HTML output, so you my have some dead internal links if you don't
+ export the entire file.
+ - Include notes. Notes are normally excluded from generated
+ sources. Check this to include them.
+ - Show <Column>. The leftmost five columns are optional,
+ and will not appear in the output unless the appropriate option is
+ checked.
+ - Column widths. 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.
+ - Text vs. CSV. 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.
+ - Overwrite CSS file. 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 not sticky, and will revert
+ to unchecked. (Think of this as a proactive alternative to "are you
+ sure you wish to overwrite SGStyle.css?")
+
+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.
+
+All output uses UTF-8 encoding.
+