docs: add missing feature docs and rearrange sidebar for progressive learning#882
docs: add missing feature docs and rearrange sidebar for progressive learning#882psxjoy merged 3 commits intoapache:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Reorganizes the Docusaurus documentation sidebar to follow a more progressive learning path, and adds several missing topic pages (EN + zh-cn) to match the new navigation flow.
Changes:
- Added the
downloaddoc into the sidebar immediately after the introduction. - Reordered the
readandwritedoc sequences to move from basic to advanced topics. - Added new docs for read formatting, write converter/merge, and advanced topics (password protection, custom converter, large-file writing), plus streamlined the introduction examples.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| website/sidebars.js | Inserts download into the sidebar and reorders read/write/advanced sections for progressive learning. |
| website/i18n/zh-cn/docusaurus-plugin-content-docs/current/sheet/write/merge.md | Adds zh-cn write “merge” documentation page. |
| website/i18n/zh-cn/docusaurus-plugin-content-docs/current/sheet/write/converter.md | Adds zh-cn write “converter” documentation page. |
| website/i18n/zh-cn/docusaurus-plugin-content-docs/current/sheet/read/format.md | Adds zh-cn read “format” documentation page. |
| website/i18n/zh-cn/docusaurus-plugin-content-docs/current/sheet/advanced/password.md | Adds zh-cn “password protection” advanced doc. |
| website/i18n/zh-cn/docusaurus-plugin-content-docs/current/sheet/advanced/large-file.md | Adds zh-cn “large file writing” advanced doc. |
| website/i18n/zh-cn/docusaurus-plugin-content-docs/current/sheet/advanced/custom-converter.md | Adds zh-cn “custom converter” advanced doc. |
| website/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md | Simplifies zh-cn introduction examples and links to Quick Start. |
| website/docs/sheet/write/merge.md | Adds EN write “merge” documentation page. |
| website/docs/sheet/write/converter.md | Adds EN write “converter” documentation page. |
| website/docs/sheet/read/pojo.md | Minor heading language consistency fix (“Code Example”). |
| website/docs/sheet/read/format.md | Adds EN read “format” documentation page. |
| website/docs/sheet/advanced/password.md | Adds EN “password protection” advanced doc. |
| website/docs/sheet/advanced/large-file.md | Adds EN “large file writing” advanced doc. |
| website/docs/sheet/advanced/custom-converter.md | Adds EN “custom converter” advanced doc. |
| website/docs/introduce.md | Simplifies EN introduction examples and links to Quick Start. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## Overview | ||
|
|
||
| Fesod supports Excel's built-in password encryption for both reading and writing. Use `.password("xxx")` on the builder to encrypt output files or decrypt input files. The encryption uses Excel's native AES encryption for `.xlsx` files, compatible with all Excel versions. |
There was a problem hiding this comment.
The overview currently claims password protection uses AES and is "compatible with all Excel versions", but Fesod’s writer-side .password(...) has important caveats (it’s implemented via POI encryption for XLSX and is documented in code as memory-intensive, and XLS behaves differently). Please adjust this section to avoid over-claiming compatibility and document the memory/format limitations (e.g., XLSX encryption + high memory usage; XLS is write-protect behavior).
| Fesod supports Excel's built-in password encryption for both reading and writing. Use `.password("xxx")` on the builder to encrypt output files or decrypt input files. The encryption uses Excel's native AES encryption for `.xlsx` files, compatible with all Excel versions. | |
| Fesod supports Excel's built-in password protection for both reading and writing. Use `.password("xxx")` on the builder to encrypt/decrypt files. For `.xlsx` output, Fesod uses Apache POI's encryption (AES-based) which can be memory‑intensive for large workbooks. For legacy `.xls` files, password protection behaves as write‑protection rather than full content encryption, so behavior and security guarantees differ from `.xlsx`. |
| ## 概述 | ||
|
|
||
| Fesod 支持 Excel 内置的密码加密功能,适用于读取和写入操作。在构建器上使用 `.password("xxx")` 即可加密输出文件或解密输入文件。加密使用 Excel 原生的 AES 加密方式(适用于 `.xlsx` 文件),兼容所有 Excel 版本。 | ||
|
|
||
| ## 带密码写入 |
There was a problem hiding this comment.
中文文档的概述段落同样写到“Excel 原生 AES 加密方式…兼容所有 Excel 版本”,且未提示 .password(...) 写入端加密会非常耗内存/并且不同格式(XLS/XLSX)行为不同。建议在这里补充格式限制与内存开销说明,并避免“兼容所有版本”的绝对表述。
| protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { | ||
| if (relativeRowIndex != null && relativeRowIndex % 2 == 0 && head.getColumnIndex() == 0) { | ||
| int startRow = relativeRowIndex + 1; | ||
| int endRow = startRow + 1; | ||
| sheet.addMergedRegion(new CellRangeAddress(startRow, endRow, 0, 0)); | ||
| } |
There was a problem hiding this comment.
In CustomMergeStrategy, computing startRow as relativeRowIndex + 1 implicitly assumes exactly one header row. Since relativeRowIndex is already “data-row relative” (and header rows are skipped), this example can produce wrong row indexes when headRowNumber is not 1 (multi-row headers) or when writing starts at an offset. Consider using cell.getRowIndex() (actual sheet row) or documenting/deriving the header-row offset explicitly to make the sample copy/paste safe.
| WriteSheet writeSheet = FesodSheet.writerSheet("Template").build(); | ||
| // Write 100,000 rows in batches of 100 | ||
| for (int i = 0; i < 1000; i++) { | ||
| excelWriter.write(data(), writeSheet); | ||
| } |
There was a problem hiding this comment.
The sample’s comments state “Write 100,000 rows in batches of 100”, but the code calls excelWriter.write(data(), ...) in a loop without showing that data() returns 100 rows. As written, the row counts in the comment aren’t verifiable/copy‑pastable; either include a data() implementation that returns the batch size you describe, or adjust the comments to avoid claiming specific row totals/batch sizes.
| WriteSheet writeSheet = FesodSheet.writerSheet("模板").build(); | ||
| // 分批写入 100,000 行,每批 100 行 | ||
| for (int i = 0; i < 1000; i++) { | ||
| excelWriter.write(data(), writeSheet); | ||
| } |
There was a problem hiding this comment.
代码注释写到“分批写入 100,000 行,每批 100 行”,但示例里循环调用 excelWriter.write(data(), ...),并未给出 data() 每批返回 100 行的实现(对读者来说无法验证/直接复制)。建议补充 data() 的批次数据构造(明确 100 行),或把注释改为不依赖具体行数的描述。
website/docs/sheet/read/format.md
Outdated
|
|
||
| | Excel Cell Value | Annotation | Java Field Value | | ||
| |:---|:---|:---| | ||
| | `Hello` | `@ExcelProperty(converter = CustomStringStringConverter.class)` | `"Custom:Hello"` | |
There was a problem hiding this comment.
In the conversion table, the example output uses a fullwidth colon ("Custom:Hello"). This is inconsistent with the converter examples (which use Custom:) and reads like a typo; please change it to a normal ASCII colon ("Custom: Hello").
| | `Hello` | `@ExcelProperty(converter = CustomStringStringConverter.class)` | `"Custom:Hello"` | | |
| | `Hello` | `@ExcelProperty(converter = CustomStringStringConverter.class)` | `"Custom: Hello"` | |
|
|
||
| @DateTimeFormat("yyyy年MM月dd日HH时mm分ss秒") | ||
| @ExcelProperty("Date Title") | ||
| private Date date; |
There was a problem hiding this comment.
This English doc uses a Chinese-locale date pattern (yyyy年MM月dd日HH时mm分ss秒) in @DateTimeFormat. That’s likely confusing for the English docs; consider switching to a locale-neutral pattern like yyyy-MM-dd HH:mm:ss (or explicitly note that the pattern is arbitrary) so readers can copy/paste safely.
- Add custom converter documentation covering per-field and global registration - Add large file writing guide for handling 100,000+ row datasets - Add password protection documentation for secure spreadsheets - Add read format guide documenting supported Excel formats - Add write converter guide with practical examples - Add merge cells documentation for complex layouts - Simplify introduction examples to focus on quick start patterns - Update POJO read documentation with enhanced examples - Add Chinese translations for all new documentation pages - Update sidebar navigation to include new advanced topics
…d remove extra blank lines
…llwidth colon, batch comments, and merge strategy caveat
Background
While refactoring the example module, I found several features and usages that were not documented. This PR adds the missing documentation and reorganizes the sidebar for a better reading experience.
New Documentation (EN + zh-CN)
Sidebar Reorganization
Other Changes