Skip to content

Commit 21f406e

Browse files
authored
Merge pull request #293 from ma10/yaml2sheet-fix-formatting-20250404
Properly apply column width and text wrapping.
2 parents 6353609 + eddcc74 commit 21f406e

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

tools/scripts/yaml2sheet/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "yaml2sheet"
7-
version = "0.1.0"
7+
version = "0.1.1"
88
description = "Generate checklist in Google Sheets from YAML data"
99
readme = "README.md"
1010
authors = [

tools/scripts/yaml2sheet/src/yaml2sheet/sheet_formatter.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@ def apply_basic_formatting(self, sheet_id: int, data_length: int) -> List[Dict]:
4444
}
4545
})
4646

47+
# Set wrapStrategy to all data cells.
48+
requests.append({
49+
'repeatCell': {
50+
'range': {
51+
'sheetId': sheet_id,
52+
'startRowIndex': 1,
53+
'endRowIndex': data_length + 1
54+
},
55+
'cell': {
56+
'userEnteredFormat': {
57+
'wrapStrategy': 'WRAP'
58+
}
59+
},
60+
'fields': 'userEnteredFormat.wrapStrategy'
61+
}
62+
})
63+
4764
# Freeze top row
4865
requests.append({
4966
'updateSheetProperties': {

0 commit comments

Comments
 (0)