Skip to content

docs: add a tutorial and fix what the reference got wrong - #67

Merged
skjnldsv merged 1 commit into
mainfrom
docs/readme-tutorial
Sep 29, 2026
Merged

skjnldsv merged 1 commit into
mainfrom
docs/readme-tutorial

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

A docs pass on the README, plus a small tutorial for people porting their first handler.

The tutorial builds a notes viewer end to end: the view, the registration, the Vite entry, the BeforeTemplateRenderedEvent listener, and opening a file from your own code with a node fetched from WebDAV (the permissions lesson from nextcloud/assistant#670).

Fixes in the reference, found while going through it against the code:

  • ViewerOptions listed 6 of its 11 options, and onPrev/onNext without the file they get
  • localSource and turns were missing from the props
  • the migration table mapped OCA.Viewer.enableSidebar to isSidebarShown, which is the sidebar's state, not the option, and said nothing about onPrev, onNext, onClose, canLoop or LoadViewer
  • registerDefaultHandlers() is also needed by apps that still run on 35
  • "Getting the viewer onto the page" repeated step 3, merged into it
  • the intro still called the viewer an app, and the em dashes are gone

It documents main as it is, #64 included, and nothing from #62, #65 or #66 yet. Not rendered on GitHub before opening, only the anchors are checked.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

A short tutorial builds a handler end to end: the view, the
registration, the build entry, the PHP listener, and opening a file
from your own code.

The reference now lists every ViewerOptions entry with its real
signature, the two optional props, the LoadViewer migration and the
getters that have no equivalent, drops the section that repeated step
3, says when registerDefaultHandlers() is needed on older servers, and
no longer calls the viewer an app.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv added status: review Waiting for reviews type: documentation 📖 Improvements or additions to documentation AI assisted labels Sep 29, 2026
@skjnldsv skjnldsv self-assigned this Sep 29, 2026
@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.78%. Comparing base (b49e6c8) to head (494bc23).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #67   +/-   ##
=======================================
  Coverage   88.78%   88.78%           
=======================================
  Files          39       39           
  Lines        2765     2765           
  Branches      569      569           
=======================================
  Hits         2455     2455           
  Misses        303      303           
  Partials        7        7           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@skjnldsv
skjnldsv merged commit 71535a6 into main Sep 29, 2026
18 checks passed
@skjnldsv
skjnldsv deleted the docs/readme-tutorial branch September 29, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted status: review Waiting for reviews type: documentation 📖 Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant