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.

Supported Assemblers

@@ -299,6 +302,57 @@ code, but also needs to know how to handle the corner cases.

  • No undocumented opcodes are supported.
  • + + +

    Exporting Source Code

    +

    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:

    + +

    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.

    +