Add comprehensive tutorial examples and wiki documentation#296
Conversation
Co-authored-by: quodlibetbv <220320055+quodlibetbv@users.noreply.github.com>
Co-authored-by: quodlibetbv <220320055+quodlibetbv@users.noreply.github.com>
Co-authored-by: quodlibetbv <220320055+quodlibetbv@users.noreply.github.com>
Co-authored-by: quodlibetbv <220320055+quodlibetbv@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive tutorial documentation to the Boxable library by creating 12 self-contained, runnable tutorial classes that demonstrate different features of the library. The tutorials cover basic table creation through advanced features like rotated text, nested tables, and colspan. Additionally, it adds a convenience method to the Row class for creating table cells and updates the README with tutorial instructions.
Changes:
- Added 12 tutorial classes demonstrating all major Boxable features with visual PDF outputs
- Created TutorialRunner to execute all tutorials sequentially with error reporting
- Added convenience method
createTableCell(float width, String tableData)to Row class to simplify nested table creation - Updated README with comprehensive tutorial documentation and running instructions
- Cleaned up unused imports in BottomTablePlacementTest
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tutorial01_BasicTable.java | Demonstrates basic table creation, headers, rows, and cell styling |
| Tutorial02_HtmlFormatting.java | Shows all supported HTML tags including new <sup> and <sub> tags |
| Tutorial03_ColorsAndTransparency.java | Covers RGB colors, text colors, and alpha channel transparency |
| Tutorial04_Alignment.java | Demonstrates horizontal and vertical text alignment options |
| Tutorial05_Images.java | Shows image insertion with scaling, padding, and aspect ratios |
| Tutorial06_BordersAndStyling.java | Covers border styles, colors, widths, and selective borders |
| Tutorial07_HeaderRows.java | Demonstrates single/multiple headers with page repetition |
| Tutorial08_DataImport.java | Shows CSV and List data import with customization |
| Tutorial09_MultiPageTables.java | Demonstrates automatic page breaks and large tables |
| Tutorial10_NestedTables.java | Shows tables within cells using HTML <table> tags |
| Tutorial11_FixedHeightRows.java | Demonstrates fixed-height rows with auto-fit text |
| Tutorial12_AdvancedFeatures.java | Covers rotated text, line spacing, and colspan |
| TutorialRunner.java | Runs all tutorials sequentially with error handling and reporting |
| Row.java | Adds convenience method for creating table cells |
| README.md | Adds comprehensive tutorial documentation section |
| BottomTablePlacementTest.java | Removes unused imports |
| * </p> | ||
| * | ||
| * @param width | ||
| * Table width |
There was a problem hiding this comment.
The JavaDoc parameter description is incorrect. The parameter is named 'width' and represents the cell's width, not the table's width. This should be changed to 'Cell width' or 'Cell's width' to match the documentation pattern used in the existing createTableCell method at line 128.
| * Table width | |
| * Cell width |
| be.quodlibet.boxable.TableCell<PDPage> innerTableCell = fullAreaRow.createTableCell(70, innerTableHtml); | ||
|
|
||
| // Configure cell to use full area | ||
| innerTableCell.setLeftPadding(0); | ||
| innerTableCell.setRightPadding(0); | ||
| innerTableCell.setTopPadding(0); | ||
| innerTableCell.setBottomPadding(0); | ||
| innerTableCell.setMarginBetweenElementsY(0); | ||
| innerTableCell.setLeftBorderStyle(null); | ||
| innerTableCell.setTopBorderStyle(null); | ||
|
|
||
| // Configure inner table borders and layout | ||
| innerTableCell.setInnerTableBorders(false, false, false, false); | ||
| innerTableCell.setInnerTableInnerBorders(true, true); | ||
| innerTableCell.setInnerTableStartAtTop(true); | ||
| innerTableCell.setInnerTableBorderStyle(new be.quodlibet.boxable.line.LineStyle(Color.BLACK, 1)); | ||
| innerTableCell.setInnerTableCellPadding(2f, 2f, 2f, 2f); |
There was a problem hiding this comment.
The code uses fully qualified class names be.quodlibet.boxable.TableCell and be.quodlibet.boxable.line.LineStyle instead of importing them at the top of the file. This is inconsistent with other tutorials (e.g., Tutorial06_BordersAndStyling imports LineStyle). Add these imports at the top of the file and use the simple class names for better code readability and consistency.
Boxable v1.8.2-RC1 has extensive features including newly added
<sup>and<sub>HTML tags, but lacks comprehensive documentation and runnable examples. This PR adds complete tutorial coverage and wiki documentation.Tutorial Classes (12 + Runner)
Created self-contained, runnable tutorials in
src/test/java/be/quodlibet/boxable/tutorial/:<sup>/<sub>), colors/transparency, alignmentEach tutorial generates its own PDF in
target/tutorials/for visual verification.Example from Tutorial02 demonstrating new superscript/subscript support:
Wiki Documentation
Created in
wiki-docs/for GitHub wiki migration:<sup>/<sub>examples and use casesREADME Update
Added "Tutorial" section with:
All 12 tutorials compile and run successfully, generating 12 PDFs (~90 KB total).
Original prompt
Add Comprehensive Tutorial Examples and Wiki Documentation
Background
The Boxable library (v1.8.2-RC1) has extensive features but limited documentation. The wiki needs to be updated with:
<sup>,<sub>tags)Objectives
Create a complete tutorial section with runnable examples covering all Boxable features based on the existing test files and library capabilities.
Requirements
1. Create Tutorial Examples Package
Create
src/test/java/be/quodlibet/boxable/tutorial/with standalone, well-documented example classes:Tutorial01_BasicTable.java
target/tutorials/Tutorial01_BasicTable.pdfTutorial02_HtmlFormatting.java
<b>,<i>,<u>,<s>,<h1>-<h6>,<sup>,<sub><p>and<br><ul>,<ol>,<li>target/tutorials/Tutorial02_HtmlFormatting.pdfTutorial03_ColorsAndTransparency.java
target/tutorials/Tutorial03_ColorsAndTransparency.pdfTutorial04_Alignment.java
target/tutorials/Tutorial04_Alignment.pdfTutorial05_Images.java
target/tutorials/Tutorial05_Images.pdfTutorial06_BordersAndStyling.java
target/tutorials/Tutorial06_BordersAndStyling.pdfTutorial07_HeaderRows.java
target/tutorials/Tutorial07_HeaderRows.pdfTutorial08_DataImport.java
target/tutorials/Tutorial08_DataImport.pdfTutorial09_MultiPageTables.java
target/tutorials/Tutorial09_MultiPageTables.pdfTutorial10_NestedTables.java
<table>HTML tagtarget/tutorials/Tutorial10_NestedTables.pdfTutorial11_FixedHeightRows.java
target/tutorials/Tutorial11_FixedHeightRows.pdfTutorial12_AdvancedFeatures.java
target/tutorials/Tutorial12_AdvancedFeatures.pdf2. Create Tutorial Runner
Create
src/test/java/be/quodlibet/boxable/tutorial/TutorialRunner.java:target/tutorials/directory3. Update README.md
Add a "Tutorials" section linking to the new tutorial package with:
4. Create Wiki Documentation Files
Create markdown documentation in a
wiki-docs/directory (for easy copy to GitHub wiki):Home.md
Getting-Started.md
Tutorial-01-Basic-Table.md through Tutorial-12-Advanced-Features.md
API-Reference.md
HTML-Tags-Reference.md
FAQ.md
Technical Requirements
target/tutorials/directorySuccess Criteria
wiki-docs/...
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.