TapeTrack Documentation

Because there is more to tape management than you ever realized

User Tools

Site Tools


technote:markdown_reports

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
technote:markdown_reports [2026/09/18 01:16] – [Example Environment] Scott Cunliffetechnote:markdown_reports [2026/09/18 01:21] (current) – [References] Scott Cunliffe
Line 1: Line 1:
-====== Glow Terminal Markdown Renderer ======+====== TapeTrack Command Line Utilities - Markdown Report Output ======
  
 ===== Overview ===== ===== Overview =====
  
-[[https://github.com/charmbracelet/glow|Glow]] is a terminal-based Markdown reader and renderer. It can be used to display Markdown reports directly in a command prompt or PowerShell session with formatted headings, tables, links, code blocks and terminal colour styling.+TapeTrack provides command-line utilities that can be used for reporting and task automation. The TapeTrack documentation identifies these utilities as a separate component of the TapeTrack system and provides a Command Line Utility reference. [[https://docs.tapetrack.com/|TapeTrack Documentation]]
  
-Glow is useful when working with TapeTrack command-line utilities that produce Markdown outputas it allows the generated report to be reviewed directly from the command line without opening a separate Markdown editor.+TapeTrack utility output can be formatted as Markdown by setting the ''TMSSREPORTFORMAT'' environment variable to ''MARKDOWN''.
  
-Glow can also browse Markdown files in a directory and provides a terminal user interface (TUI) for reading documents.+This can be useful when the output is intended to be:
  
-===== Installation =====+* Saved as a Markdown file 
 +* Viewed with a Markdown renderer such as Glow 
 +* Included in documentation 
 +* Compared with another generated report 
 +* Processed as part of an automated reporting workflow
  
-==== Windows ====+===== Setting the Report Format =====
  
-Glow can be installed on Windows using Windows Package Manager (WinGet).+Set the following environment variable before running the TapeTrack utility:
  
-Open PowerShell and run: +<code cmd
- +set TMSSREPORTFORMAT=MARKDOWN
-<code powershell+
-winget install charmbracelet.glow+
 </code> </code>
  
-After installation, close and reopen the PowerShell window. This is required if the installer has modified the PATH environment variable.+The variable instructs the TapeTrack utility to produce Markdown-formatted report output.
  
-Verify the installation:+==== Windows Command Prompt ====
  
-<code powershell+For a temporary setting within the current command session: 
-glow --version+ 
 +<code cmd
 +set TMSSREPORTFORMAT=MARKDOWN
 </code> </code>
  
-==== Example ====+The setting applies to commands run from that command session.
  
-A successful installation will report the installed Glow version.+==== Batch File =====
  
-<code> +When using a Windows batch file, the following form can be used:
-Glow v3.0.0 +
-</code>+
  
-The exact version may change as newer releases become available.+<code batch> 
 +@echo off 
 +set "TMSSREPORTFORMAT=MARKDOWN"
  
-===== Basic Use =====+TMSS10Inventory 
 +</code>
  
-Change to the directory containing the Markdown report:+Using the quoted ''set'' syntax prevents accidental trailing spaces from becoming part of the environment variable value.
  
-<code powershell> +===== Writing Utility Output to a Markdown File =====
-cd "C:\GazillaByte\Markdown+
-</code>+
  
-Display a Markdown report:+Standard output can be redirected to a Markdown file.
  
-<code powershell+For example: 
-glow .\Inventory_one.md+ 
 +<code batch
 +TMSS10Inventory > out.md
 </code> </code>
  
-A second report can be displayed in the same way:+The result is a Markdown report saved as:
  
-<code powershell+<code> 
-glow .\Inventory_two.md+out.md
 </code> </code>
  
-Glow does not modify the Markdown file. It reads the file and renders it in the terminal.+The original command-line output is therefore retained as a file that can be viewed or processed independently.
  
-===== Rendering Styles =====+===== Capturing Standard Error =====
  
-Glow supports terminal rendering styles. The standard styles include ''dark'' and ''light''.+Standard error can be redirected separately from the report output.
  
-To explicitly use the dark style:+For example:
  
-<code powershell+<code batch
-glow -s dark .\Inventory_one.md+TMSS10Inventory > out.md 2> err.txt
 </code> </code>
  
-To use the light style:+This creates:
  
-<code powershell+<code> 
-glow -s light .\Inventory_one.md+out.md 
 +err.txt
 </code> </code>
  
-The style affects the appearance of the rendered Markdown, including terminal colours and formatting.+The Markdown report is written to ''out.md''while messages written to standard error are written to ''err.txt''.
  
-===== Word Wrapping =====+This separation is useful when validating automated report generation because the report itself can remain clean Markdown while diagnostic or error output is retained separately.
  
-Reports containing wide tables may benefit from specifying the terminal width.+===== Complete Example =====
  
-For example:+A simple batch file can therefore be:
  
-<code powershell+<code batch
-glow -s dark -w 120 .\Inventory_one.md+@echo off 
 +set "TMSSREPORTFORMAT=MARKDOWN" 
 + 
 +TMSS10Inventory > out.md 2> err.txt
 </code> </code>
  
-The ''-w'' option specifies the maximum width used for wrapping rendered output. +The processing flow is:
- +
-===== Interactive Mode ===== +
- +
-Running Glow without a file argument starts its terminal user interface:+
  
-<code powershell+<code> 
-glow+TMSS10Inventory 
 +       | 
 +       +---- standard output ----> out.md 
 +       | 
 +       +---- standard error -----> err.txt
 </code> </code>
  
-Glow searches the current directory and subdirectories for Markdown files and allows them to be browsed from the terminal.+===== Generating Multiple Reports =====
  
-===== Paging =====+When two reports are generated at different times, they can be saved separately.
  
-Glow can use a pager when displaying Markdown:+For example:
  
-<code powershell+<code batch
-glow -p .\Inventory_one.md+@echo off 
 +set "TMSSREPORTFORMAT=MARKDOWN" 
 + 
 +TMSS10Inventory > out.md 2> err.txt
 </code> </code>
  
-This is useful for reports that are longer than the visible terminal window.+A subsequent execution can save the second report as:
  
-===== Reading Markdown from Standard Input =====+<code batch> 
 +@echo off 
 +set "TMSSREPORTFORMAT=MARKDOWN"
  
-Glow can also receive Markdown through standard input.+TMSS10Inventory > out2.md 2> err2.txt 
 +</code>
  
-For example:+The directory may then contain:
  
-<code powershell+<code> 
-Get-Content .\Inventory_one.md | glow -+out.md 
 +out2.md 
 +err.txt 
 +err2.txt
 </code> </code>
  
-The ''-'' tells Glow to read the Markdown from standard input.+===== Viewing the Markdown Report =====
  
-===== Configuration ===== +Once the report has been generated, it can be displayed using Glow.
- +
-Glow provides a configuration facility:+
  
 <code powershell> <code powershell>
-glow config+glow .\out.md
 </code> </code>
  
-The configuration can be used to set options such as rendering style, word-wrap width and pager usage.+A specific Glow style can be selected:
  
-===== Testing Glow with a TapeTrack Report =====+<code powershell> 
 +glow -s dark .\out.md 
 +</code>
  
-First confirm the reports exist:+For a wide TapeTrack inventory table:
  
 <code powershell> <code powershell>
-dir .\*.md+glow -s dark -w 120 .\out.md
 </code> </code>
  
-Then render the report:+The second report can be viewed using:
  
 <code powershell> <code powershell>
-glow -s dark .\Inventory_one.md+glow -s dark -w 120 .\out2.md
 </code> </code>
  
-A Markdown table produced by a TapeTrack utility should be rendered as a formatted terminal table rather than displayed as raw Markdown syntax.+Glow provides terminal-based Markdown rendering and colour styling. It does not alter the generated Markdown file.
  
-===== Glow and Report Comparison =====+===== Example TapeTrack Inventory Report =====
  
-Glow is a Markdown renderer, not file comparison utility. +Markdown inventory report generated from ''TMSS10Inventory'' can contain table such as:
- +
-For example, if the following files exist:+
  
 <code> <code>
-Inventory_one.md +| Seq| Barcode | Location | Repository | Expiry | Next Move | Last Move | GDup | CDup | Container | 
-Inventory_two.md+| ---: | --- | --- | --- | --- | --- | --- | ---: | ---: | --- | 
 +| 1 | US02.LTO.0001 | Red 11 [1.12] | Offsite Vault [12] | Permanent | Permanent | 2026-09-08 13:14:04 | 6 | 1 | |
 </code> </code>
  
-Glow can render each report:+Glow renders the Markdown table in a terminal-friendly format.
  
-<code powershell> +===== Comparing Two Generated Reports =====
-glow -s dark .\Inventory_one.md +
-glow -s dark .\Inventory_two.md +
-</code>+
  
-A separate comparison tool should be used to identify differences.+When two Markdown reports have been generated, PowerShell can be used to compare their contents.
  
-For a simple PowerShell comparison:+A basic line comparison is:
  
 <code powershell> <code powershell>
-Compare-Object (Get-Content .\Inventory_one.md) (Get-Content .\Inventory_two.md)+Compare-Object (Get-Content .\out.md) (Get-Content .\out2.md)
 </code> </code>
  
-===== Highlighting Changed Lines ===== +For reports where records remain in the same order, changed lines can be highlighted while displaying the first report:
- +
-PowerShell can be used to display ''Inventory_one.md'' while colouring lines that differ from the corresponding line in ''Inventory_two.md''+
- +
-The following example colours changed lines red:+
  
 <code powershell> <code powershell>
-$a = Get-Content .\Inventory_one.md +$a = Get-Content .\out.md 
-$b = Get-Content .\Inventory_two.md+$b = Get-Content .\out2.md
  
 $max = [Math]::Max($a.Count, $b.Count) $max = [Math]::Max($a.Count, $b.Count)
Line 200: Line 210:
 ``` ```
  
-} </code>+} 
 +</code>
  
-This is a PowerShell comparison and highlighting techniqueThe colour is being applied by PowerShell, not by Glow.+This example displays the contents of ''out.md'' and colours lines red when the corresponding line in ''out2.md'' is different.
  
-For reports where rows remain in the same order, this provides simple way to identify changed report lines.+This comparison method is intended for reports where the line order is consistent. For inventory reports where records can move position, a comparison based on a unique field such as Barcode is more robust.
  
-For production comparison of inventory reports, comparing records by Barcode rather than simply comparing line positions is preferable if rows may be added, removed or reordered.+===== Example Workflow =====
  
-===== Example Environment ===== +A practical workflow for generating, rendering and comparing TapeTrack Markdown reports is:
- +
-An example working directory may contain:+
  
 <code> <code>
-Markdown\ +1Set TMSSREPORTFORMAT=MARKDOWN 
-    Inventory_one.md +             | 
-    Inventory_two.md +             v 
-    Inventory_stderr.txt +2Run TMSS10Inventory 
-    runMarkdown.bat +             | 
-    Report-2026-09-18-10-29-08.pdf+             +---- stdout ----> out.md 
 +             | 
 +             +---- stderr ----> err.txt 
 +             | 
 +             v 
 +3. Render with Glow 
 +             | 
 +             v 
 +4. Generate a second report 
 +             | 
 +             v 
 +5. Render out2.md with Glow 
 +             | 
 +             v 
 +6. Compare out.md and out2.md
 </code> </code>
  
-The Markdown reports can then be viewed with:+Example commands:
  
 <code powershell> <code powershell>
-glow -s dark .\Inventory_one.md +set "TMSSREPORTFORMAT=MARKDOWN" 
-glow -s dark .\Inventory_two.md+ 
 +TMSS10Inventory > out.md 2> err.txt 
 + 
 +glow -s dark -w 120 .\out.md
 </code> </code>
 +
 +After generating a second report:
 +
 +<code powershell>
 +glow -s dark -w 120 .\out2.md
 +
 +Compare-Object (Get-Content .\out.md) (Get-Content .\out2.md)
 +</code>
 +
 +===== Validation =====
 +
 +After setting up Markdown report generation, verify the following:
 +
 +* The ''TMSSREPORTFORMAT'' environment variable is set to ''MARKDOWN''.
 +* The TapeTrack utility completes normally.
 +* The standard output file contains Markdown.
 +* The report can be opened with Glow.
 +* The Markdown table is rendered correctly.
 +* Standard error is captured separately when required.
 +* A second report can be generated without overwriting the first report.
 +* Differences between reports can be identified using a comparison tool.
 +
 +===== Troubleshooting =====
 +
 +==== Markdown file is empty ====
 +
 +Check that the TapeTrack utility produced output and that the command is being executed from the expected environment.
 +
 +Check the error output:
 +
 +<code powershell>
 +Get-Content .\err.txt
 +</code>
 +
 +==== Glow is not recognised ====
 +
 +If Glow has just been installed using WinGet, close and reopen PowerShell so that the updated PATH is loaded.
 +
 +Verify:
 +
 +<code powershell>
 +glow --version
 +</code>
 +
 +==== The Markdown table is difficult to read ====
 +
 +Specify a wider rendering width:
 +
 +<code powershell>
 +glow -s dark -w 120 .\out.md
 +</code>
 +
 +==== Differences appear on many lines ====
 +
 +The simple PowerShell comparison compares corresponding line positions. If records have been inserted, deleted or reordered, many lines may appear different.
 +
 +For TapeTrack inventory reports, compare records using the Barcode field when a record-level comparison is required.
  
 ===== References ===== ===== References =====
  
-* [[https://github.com/charmbracelet/glow|Glow]]+* [[https://docs.tapetrack.com/|TapeTrack Documentation]] 
 +* [[https://github.com/charmbracelet/glow|Glow Markdown Renderer]]
 * [[https://github.com/charmbracelet/glow#the-cli|Glow CLI]] * [[https://github.com/charmbracelet/glow#the-cli|Glow CLI]]
 +
 +
 +{{tag> technote markdown glow}}
  
technote/markdown_reports.1789694200.txt.gz · Last modified: 2026/09/18 01:16 by Scott Cunliffe