Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable Doc2FAQ changes are recorded here. Version numbers follow semantic versioning; entries describe shipped source functionality and do not imply an external AI service.

## [Unreleased]

### Added
- Export preview, copy, and downloads can include only approved FAQs, with a count of the selected entries.
- The browser demo shows original PDF page numbers on FAQ sources and links to those pages while the PDF is loaded.

### Changed
- Browser drafting suggests more specific questions for common handbook, product guide, and policy sections. Generated suggestions retain their original section titles and keep explicit Q&A separate.
- Similar-question flags preserve differences in word order and qualifying terms such as roles and negation.

## [0.5.0] — 2026-11-08

### Added
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Created by **Okan Tiktas** · [OKAN-SOFTWARE](https://github.com/OKAN-SOFTWARE).

> **Latest release: v0.5.0 — Source & Review.** Download the ready-to-run JAR, Windows ZIP, and checksum file from [GitHub Releases](https://github.com/OKAN-SOFTWARE/Doc2FAQ/releases/tag/v0.5.0).

## In development for v0.6.0

- **Approved-only exports:** choose **All FAQs** or **Approved only** for preview, copy, and downloads. The selection count updates as you review.
- **Original PDF pages:** the development browser demo shows page numbers beside the extracted passage. Open the referenced page in a new tab while the original PDF is loaded.
- **Draft quality:** browser suggestions use more specific phrasing for common sections and keep adjacent explicit Q&A separate. Similar-question flags compare normalized wording in order so differences in roles and qualifying terms stay visible.

## New in v0.5.0 — Source & Review

I redesigned Doc2FAQ with an illustrated homepage and a responsive FAQ workbench. Visit the [product homepage](https://okantiktas.com/projects/doc2faq/) for an overview, or try the [interactive browser demo](https://okantiktas.com/projects/doc2faq/demo/) to import documents, review FAQs, and export the results directly in your browser. The browser demo and downloadable Java application have different processing engines, so their FAQ suggestions may differ. See the [v0.5.0 changes](CHANGELOG.md#050--2026-11-08) and [design system](docs/DESIGN-SYSTEM.md) for details.
Expand Down Expand Up @@ -209,7 +215,7 @@ The preview heading and footer display the full project version from `pom.xml`.
6. Combine the question/answer search with the **All statuses**, **Needs review**, or **Approved** filter. Read the visible and review counts; use **Clear filters** to restore the list. Filters do not restrict saved projects, previews, or exports.
7. Reorder, remove, or add FAQs. Review similar questions, choose Keep both or merge, and use Undo immediately after a removal/merge if needed. Review status changes clear that undo history too.
8. Set the document title and use **Save work** to keep source, edits, order, references, duplicate decisions, and review status. **Open saved work** resumes a project. Optional autosave is off by default. New schema-2 project files require v0.5 or later; schema-1 files open with Needs review defaults.
9. Choose **Markdown**, **JSON**, **HTML**, **PDF**, or **Word**, optionally include references, and inspect **Preview export**. Use **Copy** for text formats or **Download** for any format. All FAQs are included, even if filtered out. Any blank question or answer blocks export; approval is a review aid and is not required to export.
9. Choose **Markdown**, **JSON**, **HTML**, **PDF**, or **Word**, optionally include references, and inspect **Preview export**. Use **Copy** for text formats or **Download** for any format. Choose **All FAQs** (default) or **Approved only**. Every selected FAQ needs a completed question and answer. Preview, copy, and download use the selected scope in draft order.

Example document for **Generate Mode**:

Expand Down Expand Up @@ -321,7 +327,7 @@ GitHub Actions automatically runs the Java and JavaScript checks on pushes and p
| `'mvn' is not recognized` | Run the temporary PATH command above, reopen CMD after permanent PATH setup, or use the full `mvn.cmd` path |
| Maven selects the wrong Java version | Check `mvn -version` and set `JAVA_HOME` to your JDK 21 installation |
| `No complete Q&A pairs found` | Switch from **Extract Mode** to **Generate Mode**, or format existing pairs as Markdown question headings |
| No FAQs visible after filtering | Use **Clear filters**; the draft and its export still include every FAQ |
| No FAQs visible after filtering | Use **Clear filters** to show the full draft. Check **Export scope** for the current export selection |
| Approval changes after editing | Expected: edited or merged content returns to Needs review |
| Saved project will not open in v0.4 | Schema-2 projects need v0.5 or later; keep the original schema-1 file when using older releases |
| Browser document tools fail to load | Allow the version-pinned jsDelivr libraries and retry; document content remains on your device |
Expand Down
10 changes: 5 additions & 5 deletions docs/USER-GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Doc2FAQ — Source & Review guide

This guide describes the `0.5.0` release-candidate source build, which has not yet been published. The latest published v0.4.0 download does not include the new source viewer or approval filters. See the [README](../README.md) for installation and [browser-demo comparison](WEB-DEMO.md) for the website's supported features.
This guide describes the current development build. See the [README](../README.md) for installation and the [browser-demo comparison](WEB-DEMO.md) for differences between the website and Java app.

## Create a draft

Expand All @@ -13,7 +13,7 @@ Changing source text or mode clears the current draft. Save work before replacin

## Compare an answer with its source

Select **View source beside answer** on an FAQ. The read-only viewer highlights every matching original passage, including multiple references retained after merging. On desktop it sits beside the editor; on narrow screens it stacks above it. References use extracted-text line numbers, not original PDF pages. **Show source** expands a specific excerpt within the FAQ card.
Select **View source beside answer** on an FAQ. The read-only viewer highlights every matching original passage, including multiple references retained after merging. On desktop it sits beside the editor; on narrow screens it stacks above it. The Java app shows extracted-text line numbers. In the browser demo, select **Open PDF page** to jump to the original page in your browser’s PDF viewer. Saved projects keep the page numbers and extracted text. The page links are available while the original PDF is loaded. **Show source** expands a specific excerpt within the FAQ card.

Editing a question or answer preserves the source viewer's content and scroll position. Explicitly opening a source selection scrolls to its first highlight. Selecting another FAQ updates the highlighted passages. Manually added FAQs have no automatic source reference; the viewer says so. An edited badge means the current text differs from its original draft; approving does not remove that history.

Expand All @@ -28,15 +28,15 @@ Editing a question or answer preserves the source viewer's content and scroll po
| Undo a removal or merge | Restores the previous snapshot, including status |
| Open a schema-1 project | Needs review unless a recognized status was explicitly present |

Approval is a manual review decision. It does not automatically verify accuracy or prevent export of other complete FAQs.
Review the answer against its source before approving it. Choose **Approved only** when you want to share only the FAQs you approved.

## Search and organize

Search matches questions and answers without case sensitivity. Combine it with All statuses, Needs review, or Approved. Counts show the visible number and the whole draft's approved/pending totals. Clear filters restores the list. Adding an FAQ clears filters so the new blank entry is visible.

Editing a matching FAQ can make it disappear from the filtered list; the edit remains in the draft. Search and filters never remove data, restrict exports, or limit saved projects.

Similar-question warnings use word overlap. Keep both retains distinct passages; Merge into this FAQ combines answers and source references. Review the merged result. Undo removal / merge restores the previous snapshot until another edit, addition, reorder, review choice, or approval-status change clears that history.
Similar-question warnings compare normalized wording and word order, ignoring differences such as punctuation and common articles. Keep both retains distinct passages; Merge into this FAQ combines answers and source references. Review the merged result. Undo removal / merge restores the previous snapshot until another edit, addition, reorder, review choice, or approval-status change clears that history.

## Save and reopen

Expand All @@ -48,6 +48,6 @@ Optional browser autosave is off by default. Enabling it stores source and draft

## Export

Set the document title and download filename, choose a format, optionally include source references, and preview the result. All FAQs are exported in draft order, regardless of search or status filters. Every entry must have a nonblank question and answer; approval is optional.
Set the document title and download filename, choose a format, optionally include source references, and preview the result. Choose **All FAQs** (default) or **Approved only** under **Export scope**. The selected count updates as you review. Preview, copy, and download use that selection in draft order, independent of search and review filters. Each selected entry needs a complete question and answer. **Save work** always keeps the whole draft.

Markdown, JSON, and standalone HTML can be copied or downloaded. In the Java app, PDF and Word downloads use the local Java server. On the website demo, document import and PDF/Word generation run in the browser. Both apply their own pagination. The browser demo requires an initial download of version-pinned document libraries; your document content is not uploaded. Browser PDF fonts have Latin character coverage; Word preserves Unicode. Unsupported PDF glyphs produce an error suggesting Word. Finished FAQ JSON is an export, not a saved project: use Save work to preserve review state and resume editing later.
8 changes: 5 additions & 3 deletions docs/WEB-DEMO.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ The public-facing homepage route is `https://okantiktas.com/projects/doc2faq/`.
| Extract explicit Q&A | Simplified JavaScript rules | Java extraction service |
| Suggest questions from sections | Simplified Markdown-heading rules | Java generation service, with broader heuristics |
| Source viewer, editing, reorder, duplicate review | Shared frontend | Yes |
| Original PDF page references | Page numbers and links to the currently loaded PDF | Extracted-text lines |
| Export scope | All FAQs or Approved only | All FAQs or Approved only |
| Approval status, search, filters | Shared frontend | Yes |
| Saved projects and optional browser autosave | Yes; schemas 1/2 read, schema 2 saved | Yes |
| Markdown/JSON/HTML export | Browser downloads | Browser downloads |
| PDF/DOCX import and export | Yes; browser PDF.js / Word XML extraction and PDF-LIB / docx exports | Yes; PDFBox / Apache POI |
| OCR, external AI, accounts/billing | No | Not implemented |

PDF and Word files are processed on the visitor's device. PDF import is limited to 5 MB, 50 pages and 50,000 extracted characters; DOCX import is limited to 5 MB, 50,000 extracted characters, 1,000 archive entries and an 8 MB expanded main XML part. Legacy `.doc`, password-protected PDFs and image-only/scanned PDFs are not supported. Word extraction reads main-document paragraphs and tables, mapping standard Heading 1–6 styles to Markdown section headings (levels 2–6) so the generator treats Heading 1 as a section rather than a document title. Headers/footers, images and complex layouts may not be retained. Browser PDF export **embeds bundled DejaVu Sans regular/bold font subsets** for Turkish, extended Latin, IPA and many mathematical symbols. If a font still cannot display a character, the app recommends Word rather than silently dropping it. Word exports preserve Unicode. Both exports include every FAQ regardless of filters and optionally include source references.
PDF and Word files are processed on the visitor's device. PDF import is limited to 5 MB, 50 pages and 50,000 extracted characters; DOCX import is limited to 5 MB, 50,000 extracted characters, 1,000 archive entries and an 8 MB expanded main XML part. Legacy `.doc`, password-protected PDFs and image-only/scanned PDFs are not supported. Word extraction reads main-document paragraphs and tables, mapping standard Heading 1–6 styles to Markdown section headings (levels 2–6) so the generator treats Heading 1 as a section rather than a document title. Headers/footers, images and complex layouts may not be retained. Browser PDF export **embeds bundled DejaVu Sans regular/bold font subsets** for Turkish, extended Latin, IPA and many mathematical symbols. If a font still cannot display a character, the app recommends Word rather than silently dropping it. Word exports preserve Unicode. Both exports follow **Export scope** and can include extracted-text source references. During review, **View source beside answer** shows links to the original PDF pages in a browser PDF viewer. Saved work keeps page numbers but stores only extracted text, so reopened projects display page numbers without clickable links.

The demo demonstrates the review workflow; it is not a hosted Java backend and does not claim identical generation results. Its development features may be newer than the latest published JAR. No pasted text is sent to an FAQ server. Optional autosave and downloaded project files contain source text; clear saved data on shared devices. Normal website hosting still serves the page and assets. The document adapter lazily loads version-pinned PDF.js, PDF-LIB, fontkit, JSZip and docx code from jsDelivr. DejaVu fonts are **served by the same website**, not downloaded from a third-party font service. An internet connection is needed on first use; load failures leave the workspace available for retry. See [third-party libraries](../web-demo/THIRD-PARTY.md).

Expand All @@ -43,8 +45,8 @@ The portfolio is hosted through its existing GitHub-main → Hostinger deploymen
- Examples and pasted TXT/Markdown work in both modes; text source references match exactly.
- Source highlights remain stable while typing, including on mobile.
- Approvals persist after save/open and optional autosave/reload; edits/merges reset approval.
- Search and status filters combine; downloads and previews retain all FAQs.
- Import real PDF and Word files, then export and open PDF and Word downloads. Check page breaks, references, long tokens, Unicode Word text, and PDF glyph errors.
- Combine search and status filters, then switch export scope. Verify that previews and downloads use the selected scope and preserve draft order.
- Import real PDF and Word files. Follow an original PDF page link, then export and open PDF and Word downloads. Check page breaks, references, long tokens, Unicode Word text, and PDF glyph errors.
- Invalid, oversized, protected, scanned and excessive-page files are rejected without replacing the current workspace. Clear or edit during processing to confirm late results/downloads are discarded.
- No document content becomes executable HTML; no FAQ requests go to a server.
- Check desktop, narrow-screen controls, keyboard navigation, and reduced-motion behavior.
5 changes: 2 additions & 3 deletions scripts/build-web-demo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ html = html.replaceAll('@project.version@', version)
.replace('LOCAL JAVA WORKSPACE', 'THE INTERACTIVE PLAYGROUND')
.replace('WELCOME TO DOC2FAQ /', 'WELCOME TO THE DOC2FAQ PLAYGROUND /')
.replace('PDF/DOCX files are processed by this server in memory; no documents are permanently saved.', 'Demo text is processed in this browser. Load an example to get started.')
.replace('Paste text or open <code>.txt</code>, <code>.md</code>, <code>.pdf</code>, or <code>.docx</code> (up to 5 MB for PDF/Word). Choose how to build your draft.', 'Paste text or open <code>.txt</code>, <code>.md</code>, <code>.pdf</code>, or <code>.docx</code>. PDF/Word files: up to 5 MB; PDFs: up to 50 pages. Documents are processed in your browser. Legacy .doc files and OCR are not supported.')
.replace('Content preview. PDF and Word downloads apply their own page layout.', 'All FAQs are included, even when filtered. PDF and Word downloads apply their own pagination.');
.replace('Paste text or open <code>.txt</code>, <code>.md</code>, <code>.pdf</code>, or <code>.docx</code> (up to 5 MB for PDF/Word). Choose how to build your draft.', 'Paste text or open <code>.txt</code>, <code>.md</code>, <code>.pdf</code>, or <code>.docx</code>. PDF/Word files: up to 5 MB; PDFs: up to 50 pages. Documents are processed in your browser. Legacy .doc files and OCR are not supported.');
const noteStart = html.indexOf(' <p><strong>Good to know.</strong>');
const noteEnd = html.indexOf('</p>', noteStart) + 4;
html = html.slice(0, noteStart) + ' <p><strong>Browser demo.</strong> Text processing and text exports happen on your device. Nothing you paste is sent to an FAQ server. No AI is used. This simplified demo may produce different drafts from the full Java app. Source references use text lines, not PDF pages. Optional autosave stores source and drafts in this browser; use Clear saved data on shared devices. Saved projects contain the source. PDF and Word (.docx) import/export run in your browser. Scanned PDFs need OCR, which is not included. PDF export embeds bundled DejaVu Sans fonts for extended Unicode coverage; unsupported scripts may still require Word. Document libraries load from a CDN when needed; your document content is not uploaded.</p>' + html.slice(noteEnd);
html = html.slice(0, noteStart) + ' <p><strong>Browser demo.</strong> Text processing and text exports happen on your device. Nothing you paste is sent to an FAQ server. No AI is used. This simplified demo may produce different drafts from the full Java app. Source references use extracted-text lines. Imported PDFs also show original page numbers during review. Optional autosave stores source and drafts in this browser; use Clear saved data on shared devices. Saved projects contain the source. PDF and Word (.docx) import/export run in your browser. Scanned PDFs need OCR, which is not included. PDF export embeds bundled DejaVu Sans fonts for extended Unicode coverage; unsupported scripts may still require Word. Document libraries load from a CDN when needed; your document content is not uploaded.</p>' + html.slice(noteEnd);
html = html.replace(' <section class="workspace"', ` <nav class="demo-links" aria-label="Project navigation"><a class="button button-secondary" href="https://okantiktas.com/projects/doc2faq/">← Back to Doc2FAQ homepage</a><a class="button button-secondary" href="https://github.com/OKAN-SOFTWARE/Doc2FAQ" target="_blank" rel="noopener noreferrer">Explore source ↗</a><a class="button button-primary" href="https://github.com/OKAN-SOFTWARE/Doc2FAQ/releases/latest" target="_blank" rel="noopener noreferrer">Download Java app ↗</a></nav>\n <p class="demo-disclosure">Try the review workflow here. The latest downloadable release may have fewer features than this development demo. <a href="https://github.com/OKAN-SOFTWARE/Doc2FAQ/blob/main/docs/WEB-DEMO.md">Compare demo and app ↗</a></p>\n <section class="workspace"`);
await writeFile(path.join(output, 'index.html'), html);
let app = await readFile(path.join(source, 'app.js'), 'utf8');
Expand Down
Loading