AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗PrintForm.js is a lightweight (zero-dependency Vanilla JS) browser-side pagination script.
Its core function is: automatically splitting a long HTML container (.printform) into multiple pages that fit the print paper size. It handles headers, footers, repeated table headers, page number updates, and dummy row filling automatically.
| I want to... | Read this |
|---|---|
| Understand the project | Project Overview - Architecture, concepts, tech stack |
| Start using in 5 minutes | Quick Start Guide - Step-by-step tutorial |
| Use it correctly (full guide) | Usage Guide - Structure, API, PTAC/PADDT, pitfalls |
| See all configuration options | Configuration Reference - All data-* attributes |
Studio v2 is a Production Pilot for ERP engineers. It builds inspectable, self-contained print-form HTML; it is not a no-code freeform canvas.
| I want to... | Read this |
|---|---|
| Design a general print form without coding | Studio v3: general business forms, browser AI and optional isolated Node/JSON source profile; Pilot evidence/limits. ERPNext is optional; full production qualification remains open |
| Build a Pilot single-HTML form | Open studio-v2/index.html — protocol-based, offline, WebMCP-ready |
| Understand v2 status and roadmap | Studio v2 documentation index (authoritative Chinese) |
| Review architecture and task status | GOAL.md · DESIGN.md · SPEC.md · EPIC.md · ROADMAP.md · TASK.md · PROGRESS.md · |
Studio v2 is the intended production path and remains Production Pilot. It exports a self-contained HTML with declarative bindings, embedded runtimes and validation records. Versions: runtime 1.0.0 / Studio 0.11.0 / Protocol 2.0.0 / Agent Contract 4.0.0. E14's four-layer panel, change cards, mode controls, history and resizable rail exist; the current worktree includes shared scope/apply/data-policy enforcement and closed Agent projections, while composed release acceptance remains incomplete. See the production plan for current evidence, pending requirements and proposed layout. Production Ready has not been declared. Studio v1 remains frozen and independent.
| I want to... | Read this |
|---|---|
| Understand the code structure | Code Structure - File organization, data flow |
| Develop and extend | Developer Handbook · Node24 CI · Dependency advisory remediation |
| Learn about auto-docs | Auto Documentation Guide - How docs are generated |
| Document | Description |
|---|---|
| CONFIGURATION.md | Auto-generated config reference (Markdown) |
| configuration.html | Auto-generated config reference (HTML, view in browser) |
| config-reference.json | Auto-generated config reference (JSON, for tools) |
| CHANGELOG.md | Notable changes, most recent first |
| Compatibility matrix | The four independent version lines and how they combine (Chinese) |
| LICENSE | MIT |
To help understand how printform.js works, please refer to the flowchart below:
See: docs/LOGIC_DIAGRAM.md.
Link: Link to the flowchart image
You need a static server to preview the effect (to avoid browser local file restrictions).
# Option A: Python (Recommended)
python3 -m http.server 8000
# Option B: Node/Vite
npm install
npm run dev
Open in browser:
http://localhost:8000/index.html (Full demo)http://localhost:8000/index001.html (Basic structure)PrintForm does not require complex build tools, just follow a specific HTML structure convention.
Some mobile browsers can auto-adjust font sizes and/or allow user scaling which may change layout measurements and break the expected print-like pagination. For consistent rendering, set these on your HTML page:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
<style>
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
</style>
If you need to keep pinch-zoom for accessibility, remove maximum-scale=1, user-scalable=no and keep text-size-adjust.
Create a div with class="printform" and configure the paper size.
<!-- Explicit logical CSS-pixel budget, not physical A4; use data-paper-size for a preset. -->
<div class="printform"
data-papersize-width="750"
data-papersize-height="1050">
<!-- 1. Header (Repeated at top of every page) -->
<div class="pheader">...</div>
<!-- 2. Doc Info (Repeats by default; configurable) -->
<div class="pdocinfo">...</div>
<!-- 3. Table Header (Column titles, repeated on new pages) -->
<div class="prowheader">...</div>
<!-- 4. Data Rows (Core content, split automatically) -->
<div class="prowitem">Row 1</div>
<div class="prowitem">Row 2</div>
<div class="prowitem">Row 3...</div>
<!-- 5. Footer (Defaults to last page; configurable) -->
<div class="pfooter">...</div>
</div>
<!-- Include script -->
<script src="./dist/printform.js"></script>
Note: Do not rely on data-* attributes for styling. During formatting, the engine replaces section class names (e.g. .pheader → .pheader_processed). If you style by class, mirror rules for both original and _processed class names.
| Class | Description | Default Behavior |
|---|---|---|
.printform | Root Container | The script only processes content inside this container. |
.pheader | Header | Repeats on every page. |
.pdocinfo | Doc Info | Document metadata (e.g. invoice details), repeats on every page (configurable). |
.prowheader | Table Header | Table column headers, repeats on every page. |
.prowitem | Business Row | Measured DOM Range continuations retain one semantic identity across multi-cell/multirow fragments; indivisible content must fit. See continuation limits. |
.pfooter | Footer | Defaults to last page only (can be configured to repeat). |
.ptac | Terms/Text | Measured rich-text and table-cell continuations; preserves graphemes and authored inline content. |
.paddt | Audit/Addendum | PADDT rows rendered after main pages. |
You can use data-* attributes directly on the .printform element to control behavior.
For the full list, see docs/CONFIGURATION.md.
| Attribute | Example | Description |
|---|---|---|
data-papersize-width | 750 | Paper width (px). |
data-papersize-height | 1050 | Paper height budget (px); page container height is intentionally not forced so debug can show actual content height (final fill spacer may be sub-pixel). |
data-paper-size | A4 | Preset paper size (A4/A5/LETTER/LEGAL). Used when width/height not set. |
data-dpi | 96 | DPI used to convert data-paper-size to pixels. |
data-orientation | portrait / landscape | Paper orientation. |
data-repeat-header | y / n | Repeat header on every page (Default y). |
data-repeat-footer | y / n | Repeat footer on every page (Default n). |
data-show-logical-page-number | y / n | Show page numbers (e.g. "Page 1 of 3"). |
data-show-physical-page-number | y / n | Show physical page numbers (for N-up). |
data-n-up | Positive integer | N-Up Printing: Validated logical pages uniformly scaled into physical sheet cells; see geometry and limits. |
| Attribute | Example | Description |
|---|---|---|
data-height-of-dummy-row-item | 26 | Height for each dummy row item used to fill remaining space. |
data-repeat-docinfo | y / n | Repeat .pdocinfo on every page. |
data-repeat-docinfo002 | y / n | Repeat .pdocinfo002 on every page. |
data-repeat-docinfo003 | y / n | Repeat .pdocinfo003 on every page. |
data-repeat-docinfo004 | y / n | Repeat .pdocinfo004 on every page. |
data-repeat-docinfo005 | y / n | Repeat .pdocinfo005 on every page. |
data-repeat-rowheader | y / n | Repeat .prowheader on every page. |
data-repeat-ptac-rowheader | y / n | Repeat .prowheader on PTAC-only pages. |
data-repeat-footer | y / n | Repeat .pfooter on every page (final page always includes all footers). |
data-repeat-footer002 | y / n | Repeat .pfooter002 on every page. |
data-repeat-footer003 | / |
| Attribute | Example | Description |
|---|---|---|
data-repeat-paddt | y / n | Reserved toggle for PADDT repeat behavior (currently unused). |
data-repeat-paddt-rowheader | y / n | Repeat .prowheader on PADDT pages. |
data-insert-paddt-dummy-row-items | y / n | Insert dummy row items on PADDT pages. |
data-paddt-max-words-per-segment | 180 | Max words per PADDT segment when splitting paragraphs. |
data-paddt-debug | y / n | Enable PADDT debug logs. |
data-repeat-paddt-docinfo | y / n | Repeat .pdocinfo on PADDT pages only. |
data-repeat-paddt-docinfo002 | y / n | Repeat .pdocinfo002 on PADDT pages only. |
data-repeat-paddt-docinfo003 | y / n | Repeat .pdocinfo003 on PADDT pages only. |
data-repeat-paddt-docinfo004 | y / n | Repeat .pdocinfo004 on PADDT pages only. |
data-repeat-paddt-docinfo005 | y / n | Repeat .pdocinfo005 on PADDT pages only. |
<div class="printform"
data-papersize-width="800"
data-papersize-height="1100"
data-repeat-footer="y"
data-show-logical-page-number="y">
...
</div>
If a page is not full, PrintForm automatically inserts empty rows to push the footer to the bottom.
<template class="custom-dummy-row-item-content">
<tr style="height:20px;"><td style="border:0;">...</td></tr>
</template>
<template class="custom-dummy-spacer-content">
<table style="width:100%; table-layout:fixed;" cellpadding="0" cellspacing="0">
<tr><td style="border-top:1px solid #000;"></td></tr>
</table>
</template>
Add tb_page_break_before to the row to start a new page before it.
<div class="prowitem tb_page_break_before">...</div>
If you need a page to start without the repeating .prowheader, add without_prowheader (or tb_without_rowheader) on the row that starts that page.
<table class="prowitem tb_page_break_before without_prowheader">...</table>
The script runs automatically on load. If you generate content dynamically (e.g. AJAX), trigger formatting manually:
// Format all .printform elements
await PrintForm.formatAll({ force: true });
// Or format a specific node
const myForm = document.querySelector('#invoice-1');
PrintForm.format(myForm);
formatAll() processes current source forms, including later additions; concurrent calls share completion. It returns {formattedCount, failedCount} and rejects with AggregateError plus error.report if any form fails.
Successful formatting removes the source .printform; failed formatting preserves it. See the ERP support contract for layout, business-data and actual-print limits.
If you modify the source (src/ directory), rebuild:
npm run build
Output is in dist/printform.js (and root *.html + README.md/README.zh-CN.md are copied to dist/ for npm run preview).
Q: Why is my content cut off? A: Check the configured height after headers/footers. Text and supported table cells can continue; oversized atomic assets, money, nested tables or chrome fail instead of silently clipping. See measured continuation limits.
Q: How to hide the header on the first page? A: The logic prefers consistency. For special cases, hide the header via CSS using a wrapper selector or split the DOM before formatting.
Q: Margins are wrong when printing?
A: Physical margins are controlled by the browser and printer driver. In the print dialog, enable "Background graphics" and set margins to "None" or "Minimum" (PDF viewers at non-100% zoom may show 1px jitter; pin footers via @media print absolute positioning if you need visual lock).
src/printform.js - Entry pointsrc/printform/formatter/ - Core Logic (Pagination calculation)src/printform/config.js - Configuration definitionssrc/printform/dom.js - DOM helpersindex.html - Full test case| Understand the v2 single-HTML contract | Studio v2 Protocol (Chinese) |
| Connect Codex or Claude Code | Agent setup |
| Maintain the legacy v1 Studio | Studio v1 Design Doc (Chinese) |
| Connect an ERP / check transaction and format coverage | ERP support · PCAR/CCAR · transactions · ERPNext returns · ERPNext Payment Entry · safe import · nested schemas · exact scenarios · continuations · special paper · additional paper · Letter / Legal / drivers · audit (Chinese) |
ynRepeat .pfooter003 on every page. |
data-repeat-footer004 | y / n | Repeat .pfooter004 on every page. |
data-repeat-footer005 | y / n | Repeat .pfooter005 on every page. |
data-repeat-footer-logo | y / n | Repeat .pfooter_logo on every page. |
data-repeat-footer-pagenum | y / n | Repeat .pfooter_pagenum on every page. |
data-insert-dummy-row-item-while-format-table | y / n | Insert repeated dummy row items to fill height. |
data-insert-ptac-dummy-row-items | y / n | Insert dummy row items on PTAC pages. |
data-insert-dummy-row-while-format-table | y / n | Insert a single dummy row block to fill remaining space. |
data-insert-footer-spacer-while-format-table | y / n | Insert a footer spacer to push footers down. |
data-insert-footer-spacer-with-dummy-row-item-while-format-table | y / n | Use dummy row items as the footer spacer. |
data-custom-dummy-row-item-content | HTML | Custom dummy row item markup (or use <template class="custom-dummy-row-item-content">). |
data-custom-dummy-spacer-content | HTML | Custom dummy spacer markup (or use <template class="custom-dummy-spacer-content">). |
data-div-page-break-before-class-append | pagebreak_bf_processed | Append extra class(es) (space-separated) onto generated div_page_break_before nodes (legacy HTML-to-PDF support). |