Skip to content

✨ feat(table): add to_csv function and update docs#1296

Merged
harehare merged 1 commit intomainfrom
feat/table-csv-export
Feb 18, 2026
Merged

✨ feat(table): add to_csv function and update docs#1296
harehare merged 1 commit intomainfrom
feat/table-csv-export

Conversation

@harehare
Copy link
Copy Markdown
Owner

  • Add to_csv function to table.mq for CSV export
  • Update builtins.html to document new table functions
  • Update update_doc.sh to include table module in docs generation

- Add to_csv function to table.mq for CSV export
- Update builtins.html to document new table functions
- Update update_doc.sh to include table module in docs generation
Copilot AI review requested due to automatic review settings February 18, 2026 12:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new to_csv function to the table module for CSV export functionality and updates the documentation generation process to include the table module.

Changes:

  • Added to_csv function to table.mq module with CSV export capability
  • Updated update_doc.sh script to include -M table flag for documentation generation
  • Regenerated builtins.html documentation with table module functions

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
scripts/update_doc.sh Added -M table flag to include table module in documentation generation
crates/mq-lang/modules/table.mq Added to_csv function and imported csv module
docs/books/src/builtins.html Regenerated documentation showing table module with 10 functions (count) but only 9 listed

Comment on lines +133 to +135
let header = table[:header]
| let rows = table[:rows]
| csv::csv_stringify([header] + rows, delimiter)
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The to_csv function passes markdown table cell nodes directly to csv_stringify, but csv_stringify expects arrays of simple values (strings/numbers). Table cells are markdown nodes with a 'values' field containing text.

The header and rows need to be converted from markdown table cell nodes to their text values before passing to csv_stringify. You should map over the header and rows to extract the text from each cell, likely using the to_text builtin function or by accessing the cell values directly.

Suggested change
let header = table[:header]
| let rows = table[:rows]
| csv::csv_stringify([header] + rows, delimiter)
let header_text = map(table[:header], to_text)
| let rows_text = map(table[:rows], fn(row): map(row, to_text);)
| csv::csv_stringify([header_text] + rows_text, delimiter)

Copilot uses AI. Check for mistakes.
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 18, 2026

Merging this PR will not alter performance

✅ 29 untouched benchmarks


Comparing feat/table-csv-export (a86f2ce) with main (32a3240)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (7a36c5f) during the generation of this report, so 32a3240 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@harehare harehare merged commit 311be27 into main Feb 18, 2026
13 checks passed
@harehare harehare deleted the feat/table-csv-export branch February 18, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants