Document Workflow
Convert CSV or JSON to a Markdown table without corrupting data
A practical workflow for scoping records, parsing quoted CSV or strict JSON, resolving warnings, checking the table preview, and validating GFM in its destination.
Written and tested by SimpleWebUtilsPublished: Reviewed:
How this workflow was checked
For “Document an API fixture that contains a late key, a zero, and a nested owner”, we entered the documented fixture in Data Table Workbench and followed “Confirm whether the source contract is CSV or JSON” before “Resolve every parser, shape, and precision finding”. We compared the browser result with the stated output, then reviewed “Using production data as a convenient sample” and “Trusting delimiter detection without checking the export settings” as separate failure boundaries.
The GFM table kept first-seen column order, represented the nested owner as compact JSON, preserved false and zero, and left the missing score cell empty rather than dropping the row.
Problem
Spreadsheet exports and API examples look simple until a quoted comma, embedded newline, uneven row, late JSON key, nested object, null value, large identifier, pipe character, or HTML-shaped string changes the table. A converter can still emit plausible Markdown while moving data into the wrong column or rounding a number. The task is therefore not just to create pipe syntax; it is to preserve the intended records, disclose unavoidable normalization, remove sensitive fields, and prove that the destination renders the same table readers are meant to see.
When to use this
- A reviewed spreadsheet export needs to become a compatibility matrix, release table, inventory excerpt, or README reference.
- A small API response fixture should be documented as rows while preserving false, zero, null, and keys that appear in later objects.
- A support runbook or incident appendix needs a compact table from scrubbed operational records without uploading source data to a conversion service.
- A data-contract change needs a before-and-after Markdown fixture whose row count, column count, escaping, and mobile rendering can be reviewed in a pull request.
Steps
- Step 1
Define the audience and isolate a safe representative fixture
Decide what question the table must answer and keep only the rows and columns needed for that answer. Remove access tokens, email addresses, customer identifiers, internal hosts, unpublished prices, and unrelated metadata. Preserve difficult but non-sensitive cases such as a quoted delimiter, multiline note, false, zero, null, later-added key, long value, and literal pipe so the fixture tests the real contract instead of an unrealistically clean sample.
- Step 2
Confirm whether the source contract is CSV or JSON
For CSV, identify the export delimiter, quote character, header policy, line ending, and encoding. Do not infer structure by visually splitting on commas because quoted fields can contain commas and newlines. For JSON, require a strict top-level array of objects and decide whether nested arrays or objects are acceptable as compact cell text. Convert exact large identifiers to JSON strings at the source rather than allowing JavaScript number parsing to round them.
- Step 3
Convert with explicit delimiter, header, and alignment choices
Open Data Table Workbench and select CSV or JSON. In CSV mode, use automatic delimiter detection only when the export contract is unknown, then verify the detected character; otherwise select the known comma, tab, semicolon, pipe, or one-character custom delimiter. Set the first-row header option accurately. Choose alignment for presentation, not as a substitute for typing or validating numeric data, and run the conversion manually.
- Step 4
Resolve every parser, shape, and precision finding
Stop on malformed quotes, invalid JSON, primitive JSON rows, duplicate keys, unsafe integers, lossy decimals, or resource-limit errors. Review warnings for blank rows, uneven CSV records, generated or duplicate headers, nested values, null cells, multiline content, edge whitespace, and HTML-shaped text. Compare reported row and column counts with the source fixture and explain every difference before accepting the output.
- Step 5
Compare the visual preview with the generated Markdown
Scan the preview by row and column, including the last record and every field that was missing in some objects. Then inspect the Markdown source for escaped pipes, backslashes, generated <br> markers, non-breaking space entities, encoded HTML characters, alignment markers, and compact nested JSON. Confirm that false and zero are visible and that null, missing, and empty-string cells are not being treated as the same business state without an explicit label.
- Step 6
Render, review, and publish in the real destination
Copy or download the .md file and render it with the exact GitHub, wiki, static-site, or documentation build that will publish it. Check table semantics, long cells, code-like values, links, raw HTML policy, 390px mobile overflow, dark mode, keyboard reading order, and the final diff. Run the repository formatter, linter, link checker, accessibility check, and production build where applicable, then publish only from the reviewed artifact.
Example
Document an API fixture that contains a late key, a zero, and a nested owner
Input
[{"name":"Ada","active":true,"owner":{"team":"Docs"}},{"name":"Grace","active":false,"score":0,"owner":null}]Output
A GFM table with name, active, owner, and score columns in first-seen order. The nested owner is compact JSON, false and zero remain visible, null becomes an empty owner cell with a warning, and the table is checked in the destination renderer before publication.Common mistakes
Using production data as a convenient sample
Local conversion reduces one transmission path but does not make secrets appropriate for documentation, screenshots, clipboard history, analytics extensions, or source control. Build a scrubbed fixture that keeps only the structural edge cases needed for verification.
Trusting delimiter detection without checking the export settings
A short or one-column sample may not provide enough evidence for automatic detection. Confirm the detected delimiter and resulting column count against the source application, especially for regional semicolon exports and tab-separated reports.
Ignoring warnings because the table looks aligned
Padding an uneven row can make a preview look rectangular while a value was already shifted or omitted upstream. Trace each warning to the exact source record and fix the export when column meaning is ambiguous.
Flattening nested JSON by assumption
Compact JSON in a cell preserves evidence but is not a normalized schema. Do not claim that nested arrays or objects became independent table columns; redesign or preselect fields when readers need to compare those values.
Reviewing only the built-in preview
The final renderer controls whether <br> markers, entities, raw HTML, long words, and table overflow behave as expected. Test the generated file in the same build, theme, and mobile width used by readers.
FAQ
Should an identifier such as 9007199254740993 be a JSON number?
No when exact digits matter in a browser workflow. Encode identifiers outside the safe integer range as JSON strings and document their type explicitly. The workbench rejects them rather than returning a rounded value.
What should I do when CSV rows have different column counts?
Find the exact records, confirm the delimiter and quote rules, and compare them with the export schema. Missing trailing cells can be intentional, but shifted columns or malformed quotes should be fixed at the source before publication.
Why are nested JSON values shown as compact text?
One Markdown cell cannot represent a nested table contract without an additional flattening policy. Compact JSON preserves the value honestly. Choose and document a separate flattening rule if atomic columns are required.
Does encoding HTML-shaped text sanitize the final page?
It keeps source strings from becoming active HTML in this generated table. The destination must still enforce its own Markdown, raw HTML, link, and content security policies for the complete document.
What evidence should accompany the published table?
Keep the scrubbed source fixture, selected options, expected row and column counts, resolved warning notes, generated Markdown diff, destination-rendered check, and the relevant build or accessibility results.