diff --git a/.env.template b/.env.template index 6b3e4c1bd..81fa3e6f7 100644 --- a/.env.template +++ b/.env.template @@ -18,9 +18,6 @@ NOTECRAFT_UI_VISUAL_DIR= NOTECRAFT_CONTROL_PORT= NOTECRAFT_CONTROL_KEY= -# Optional OfficeIMO bridge executable used by import development. -NOTECRAFT_OFFICEIMO_BRIDGE= - # Documentation and build output controls. UPDATE_DOCS= DIST= diff --git a/.gitignore b/.gitignore index ce8a449fd..27fcc6769 100644 --- a/.gitignore +++ b/.gitignore @@ -39,10 +39,9 @@ MEMORY.md *.exe *.dmp -# OfficeIMO bridge build output and temporary upstream source inspection. +# Preserve existing ignored build output from the removed bridge. /tools/officeimo/OfficeIMO.NoteCraft.Bridge/bin/ /tools/officeimo/OfficeIMO.NoteCraft.Bridge/obj/ -/.work-officeimo-*/ # website/demo is the compiled WASM build of notecraft-web. It is built fresh # by the deploy workflow (.github/workflows/deploy-website.yml), never diff --git a/AGENTS.md b/AGENTS.md index fc035b4df..58acd504d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -167,11 +167,16 @@ purpose summary. | `nc-hl-design` | Level 2: design router | Feature scope, architecture handoff, state and data-flow design, decisions, risks, and acceptance criteria. | Does not replace `nc-arch` or implement MVC details. Routes the detailed design to the relevant specialist below. | | `nc-design-artcraft-integration` | Design specialist: ArtCraft integration | Reuse and adapt established ArtCraft suite patterns, shared tools, and Android integration guidance while preserving NoteCraft product and architecture boundaries. | Does not override NoteCraft requirements, repository boundaries, licenses, or platform rules. | | `nc-design-egui-integration` | Design specialist: egui integration | egui and winit input boundaries, semantic events, raw input adapters, clipboard behavior, and ArtCraft egui interaction patterns. | Does not own commands, product behavior, or platform service implementation. Consult `nc-design-controller` and `nc-arch-x-plat`. | +| `nc-design-controller` | MVC specialist: user actions | User actions and commands: which behaviour is a command, and which model, controller and view it touches. | Does not own product requirements or the editing history. Consult `nc-design-editor` for undo and redo. Review against the MVE proposal (`docs/rfc/ver.0.1.x/rfc-mve-v1-branching.md`, a draft) before recommending a new boundary. | +| `nc-design-editor` | Editing and history | Every change to page content reaches the editor, is recorded in its history, and can be undone and redone. | Does not own the stored form (`nc-dom-ser`) or the controls (`nc-uiux-controls`). | +| `nc-info-search` | Design reference: search | Today's plain scan, the planned hybrid search (keyword BM25 plus embeddings, merged by reciprocal rank fusion), and what is indexed. | Does not own the search box UI (`nc-uiux-features`) or product scope (`nc-prod`). | +| `nc-devx-docs` | Developer documentation | MSDN-level reference documentation, accuracy checked against the code, and the map of every document and skill. | Does not decide design or architecture, and does not own machine setup (`nc-devx`). | | `nc-prod` | Product authority | Product requirements, non-negotiable behavior, local-file model, OneNote behavior, import, and format parity. | Does not design crate APIs or implement features. | | `nc-dom-ser` | MVC specialist: DOM and persistence | HTML and CMGFM page model, DOM semantics, serialization, deserialization, asset references, round trips, and cross-format parity. | Does not own general architecture or UI styling. Consult with `nc-arch`; route feature design through `nc-hl-design`. | | `nc-code-rust` | Implementation specialist | Rust code quality, error handling, logging, tests, linting, and maintainable crate implementation. | Does not decide product scope or architecture. Implements the approved design. | | `nc-uiux-features` | MVC specialist: end-to-end feature view | Complete user-facing features spanning ribbon, page content, storage integration, persistence, accessibility, and regression tests. | Does not redefine storage or format semantics. Consult `nc-dom-ser` and `nc-arch` when those boundaries are crossed. | | `nc-uiux-controls` | MVC specialist: interaction controls | Buttons, menus, hit targets, hover states, keyboard behavior, object selection, and dragging. | Does not own dialog theming, DOM persistence, or product scope. Consult `nc-uiux-z-order` when surfaces overlap or compete for pointer input. | +| `nc-uiux-keys` | MVC specialist: keyboard and pointer navigation | Moving into and out of page objects (code blocks, math, tables, images, diagrams) and between blocks: arrows, Page Up and Down, Home, End, and a single click to edit. | Does not own control hit targets (`nc-uiux-controls`) or the editing history (`nc-design-editor`). | | `nc-uiux-dialogs` | MVC specialist: dialog view | Themed modal dialogs, confirmations, progress surfaces, privacy prompts, recovery prompts, and error states. | Does not own command behavior or persistence. Consult `nc-uiux-controls` for interaction details and `nc-uiux-z-order` for layer priority, modality, and focus. | | `nc-uiux-bidi` | MVC specialist: text interaction | Bidirectional text, RTL controls, caret placement, selection, mixed-script behavior, and mirrored layout. | Does not own general editor serialization. Consult `nc-dom-ser` for persisted page representation. | | `nc-uiux-i18n` | UI foundation specialist | Interface string extraction, locale catalogs, language preference, translation fallback, coverage audits, and localization verification using ArtCraft conventions. | Does not own notebook content translation or RTL interaction/mirroring. Consult `nc-uiux-bidi` for RTL behavior and `nc-ua` for localized help and demo content. | @@ -181,6 +186,7 @@ purpose summary. | `nc-uiux-icons` | UI foundation specialist | Licensed icon selection, local asset integration, semantic mapping, accessibility, and icon-state consistency. | Does not own Windows Shell asset extraction or page serialization. Consult `nc-dom-ser` and `nc-themes` where applicable. | | `nc-uiux-testing` | UI automation and visual verification specialist | NoteCraft UI automation, semantic interaction tests, headless and real-window screenshot capture, visual assertions, accessibility-test integration, platform automation boundaries, and test evidence. | Does not own product documentation or demo content. Routes User Assistance assets and public screenshot selection to `nc-ua`; routes release acceptance evidence to `nc-release-signoff`. | | `nc-runtime-diagnostics` | Runtime diagnostics specialist | Local application logs, telemetry sessions, settings and diagnostic paths, session correlation, event schemas, redaction, export/clear behavior, and troubleshooting evidence. | Does not set product privacy policy, implement logging, or own CI/machine setup. Routes privacy decisions to `nc-prod`, Rust implementation to `nc-code-rust`, architecture to `nc-arch`, and developer environment issues to `nc-devx`. | +| `nc-info-ocr` | Design reference: image text | Traditional OCR of printed text in pictures (companion text, line boxes, search hits) and AI image descriptions for alt text; engines, models, licences, status and open decisions. | Does not own the search index (`nc-info-search`) or product scope (`nc-prod`). Read before changing the OCR crate, its companion files, or the description path. | | `nc-ua` | Product coverage specialist | User assistance, product coverage, multilingual demo content, generated outputs, scratch copies, public documentation screenshots, and demo-notebook consistency. | Does not own screenshot capture mechanics or UI automation. Consumes `nc-uiux-testing` and does not replace implementation or design skills. | | `nc-release-signoff` | Release gate | Versioning, demo parity, tests, lint, packaging, installers, assets, and release evidence. | Does not implement features or waive failing gates. | | `nc-devx` | Developer experience | Machine setup and its check scripts, the quality levels L0 to L4, git hooks, coverage, the PII scanner, and the daily workflow. | Does not decide product or architecture. Owns how work is checked, not what is built. | diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index e08ecfc01..b38815b65 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -110,7 +110,7 @@ source material. | `assets/demo/import-file.svg` | Synthetic OneNote file import walkthrough | NoteCraft project | MIT OR Apache-2.0 | | `assets/demo/import-open.png` | NoteCraft open screen showing the import actions | Rendered by `ui_shot` from NoteCraft with the Welcome notebook demo, in the default theme | MIT OR Apache-2.0 | | `assets/demo/page-menu.png` | The navigator's menu for a page, with Lock read only, shown in the demo notebook's menus page | Rendered by the UI test harness from NoteCraft, with a sample notebook, in the default light theme | MIT OR Apache-2.0 | -| `assets/demo/imported-notebook.png` | NoteCraft imported notebook view using synthetic fixture data | Rendered by `ui_shot` from NoteCraft; no personal notebook data | MIT OR Apache-2.0 | +| `assets/demo/imported-notebook.png` | NoteCraft notebook view with synthetic sample content | Rendered by `ui_shot` from NoteCraft; no personal notebook data | MIT OR Apache-2.0 | | `assets/demo/import-progress.png` | NoteCraft import progress dialog using synthetic fixture data | Rendered by `ui_shot` from NoteCraft with the Welcome notebook demo, in the default theme; no personal notebook data | MIT OR Apache-2.0 | These are screenshots of NoteCraft itself, made by `cargo xtask screenshots` from sample diff --git a/SKILLS/nc-devx-docs/SKILL.md b/SKILLS/nc-devx-docs/SKILL.md new file mode 100644 index 000000000..53d7e8e10 --- /dev/null +++ b/SKILLS/nc-devx-docs/SKILL.md @@ -0,0 +1,107 @@ +--- +name: nc-devx-docs +description: Owns NoteCraft's developer documentation: accurate, MSDN-level reference for the repo, its crates, commands and formats, kept in step with the code. Knows where every architecture and design skill and document lives, and routes questions to them. +license: MIT +metadata: + version: "0.1.20261205" + related_skills: [nc-arch, nc-arch-x-plat, nc-design-editor, nc-dom-ser, nc-hl-design, nc-devx, nc-code-rust, nc-release-signoff] +--- + +# nc-devx-docs: NoteCraft developer documentation + +## Job to be done + +Keep NoteCraft's developer documentation exact. A reader who has never seen the repo should be able to +find a fact, check it against the code, and act on it without asking anyone. Documentation that +disagrees with the code is a defect, the same as a failing test. + +## The standard: MSDN level + +Write reference documentation the way Microsoft Learn documents an API: + +- **Summary first.** One or two sentences: what it is, and what it is for. +- **Remarks.** Behaviour, limits, ordering, and the reasons for non-obvious choices. +- **Parameters, fields and outputs.** Every one, with its type, unit and valid range. +- **Errors.** Every error a caller can see, and what the caller should do. +- **Examples.** At least one example that runs, with its expected output. +- **See also.** Links to the related page, skill or RFC, by relative path. + +Every factual claim must point at its source: a file and line (`crates/onenote/src/one.rs:409`), a +command, or a test name. A claim with no source is not allowed to stay in the document. + +## Accuracy rules + +1. **Verify before writing.** Read the code the document describes. Do not copy claims from older + documents, from memory, or from a PR description. +2. **Name what is not built.** Say "planned", "proposed" or "not yet implemented" in the text itself. A + proposal written in the present tense reads as a fact. +3. **Date the status.** Put "Status as of YYYY-MM-DD" on any document that describes progress. +4. **Keep one source of truth.** If two documents describe the same thing, one links to the other and + does not repeat the facts. +5. **Relative links only.** `cargo xtask docs` checks relative links; a broken link fails the gate. +6. **No personal data.** Use generic notebook names in examples. Never copy a real notebook's content. +7. **Re-check after each change.** When code changes a documented behaviour, update the document in the + same pull request. + +## Where documents live + +See `references/doc-map.md` for the full map. In short: + +| Kind | Location | +|---|---| +| Product and user documentation | `docs/` (`page-model.md`, `folder-format.md`, `how-to/`) | +| Engineering reference | `docs/architecture.md`, `docs/testing.md`, `docs/coverage.json`, `docs/feature-parity.md` | +| Decisions | `docs/rfc/uiux/` and `docs/rfc/release/` (short records of a single decision, ADRs) | +| Proposals | `docs/rfc/` (versioned by product line) and `SKILLS/nc-dom-ser/references/rfc-*.md` | +| Research | `docs/research/` | +| Status of work in progress | `docs/onenote-migration-status.md`, `docs/onenote-reader-replacement.md` | +| Skills (design and architecture contracts) | `SKILLS/*/SKILL.md` | + +## Architecture and design skills: when to use which + +| Question | Skill | Read first | +|---|---|---| +| How are the crates layered, and who owns what? | `nc-arch` | `SKILLS/nc-arch/SKILL.md` | +| How do we branch the code per platform, without shrinking the app? | `nc-arch-x-plat` | `SKILLS/nc-arch-x-plat/SKILL.md`, `references/` | +| How does an edit reach the editor, and can it be undone? | `nc-design-editor` | `SKILLS/nc-design-editor/SKILL.md` | +| How is a page written to HTML and CommonMark, and kept in parity? | `nc-dom-ser` | `SKILLS/nc-dom-ser/SKILL.md`, `references/`, RFC 0001 to 0003 | +| How is a new feature or refactor designed (scope, data flow, acceptance)? | `nc-hl-design` | `SKILLS/nc-hl-design/SKILL.md`, `references/` | +| How is a user action made MVC-aligned? | `nc-design-controller` | `SKILLS/nc-design-controller/SKILL.md` | +| How do we integrate with ArtCraft's suite conventions? | `nc-design-artcraft-integration` | `SKILLS/nc-design-artcraft-integration/SKILL.md` | +| How do the egui boundaries, input and clipboard work? | `nc-design-egui-integration` | `SKILLS/nc-design-egui-integration/SKILL.md` | +| How is search designed, now and planned? | `nc-info-search` | `SKILLS/nc-info-search/SKILL.md` | +| Does a feature meet product requirements? | `nc-prod` | `SKILLS/nc-prod/SKILL.md` | +| What must pass before a release? | `nc-release-signoff` | `SKILLS/nc-release-signoff/SKILL.md` | +| How are themes and contrast handled? | `nc-themes` | `SKILLS/nc-themes/SKILL.md` | +| How is the user-facing product kept complete (demo, coverage, versions)? | `nc-ua` | `SKILLS/nc-ua/SKILL.md` | +| How do we diagnose a runtime failure from logs? | `nc-runtime-diagnostics` | `SKILLS/nc-runtime-diagnostics/SKILL.md` | +| How is Rust code written and reviewed here? | `nc-code-rust` | `SKILLS/nc-code-rust/SKILL.md` | +| How do I set up, lint, test and run locally? | `nc-devx` | `SKILLS/nc-devx/SKILL.md` | +| Dialogs, controls, keys, icons, drawing, bidi, i18n, z-order, testing | `nc-uiux-*` | `SKILLS/nc-uiux-*/SKILL.md` | + +### Important: the architecture is changing + +The target architecture for 0.1.x is **Model-View-Editor (MVE)**, proposed in +`docs/rfc/ver.0.1.x/rfc-mve-v1-branching.md`. The Editor coordinates change and plays the controller's role. +That RFC is a **draft for review**, not yet adopted. + +Until it is accepted: + +- `nc-design-controller` and `nc-hl-design` still describe MVC-aligned design. Read them as current, and + check the RFC before recommending a new boundary. +- Name the Editor only as the proposal says, and do not describe MVE as the current design. +- Record the proposed three-branch model (`main` hot, `release/*` cold, `_v1x` hot) as a proposal too. + +## Workflow + +1. Identify the reader's question, and pick the document that owns the answer (table above). +2. Read the code it describes; list each claim you will write. +3. Write the document in the MSDN shape, with a source for every claim. +4. Run `cargo xtask docs` for the links, and `cargo xtask text` for the text rules. +5. If the document describes progress, add the status date and the open items. +6. Link the document from the nearest index (`docs/README.md`, a skill, or the RFC index). + +## Related + +- `references/doc-map.md`: the full map of documents and skills. +- `references/writing-standard.md`: the template for a reference page, and a checklist. diff --git a/SKILLS/nc-devx-docs/references/doc-map.md b/SKILLS/nc-devx-docs/references/doc-map.md new file mode 100644 index 000000000..5e405c5a8 --- /dev/null +++ b/SKILLS/nc-devx-docs/references/doc-map.md @@ -0,0 +1,94 @@ +# Documentation map + +Status as of 2026-12-05. Paths are relative to the repo root. Check a document's own status line before +relying on it: a status older than the code means the document needs checking. + +## Engineering reference (`docs/`) + +| Document | Owns | Status note | +|---|---|---| +| `docs/architecture.md` | Crate layers (L0 to L6), what each crate does | Layer table enforced by `cargo xtask layers` | +| `docs/page-model.md` | The page model: blocks, containers, metadata | Check against `crates/model` | +| `docs/folder-format.md` | How notebooks, sections and pages are stored on disk | Check against `crates/store` | +| `docs/testing.md` | Test layers, UI tests, gates | Check against `xtask/` | +| `docs/coverage.json` | Coverage baseline per platform | Measured on the commit shown inside it | +| `docs/feature-parity.md` | Feature parity with OneNote | Check each row against the code | +| `docs/gaps.md` | Known gaps | Review at each release | +| `docs/control-protocol.md` | The control protocol | Check against `crates/engine` | +| `docs/mcp.md` | MCP server | Check against the MCP crate | +| `docs/prioritization.md` | How work is prioritised (S/F/U scoring) | Owner's framework | +| `docs/releasing.md` | How a release is cut | Pair with `nc-release-signoff` | +| `docs/ink-and-pressure.md` | Ink thickness, pressure and edges | Paired with `nc-uiux-drawing` | +| `docs/onenote-migration-status.md` | Open items of the OneNote migration | Status 2026-12-04 | +| `docs/onenote-reader-replacement.md` | What replaced the bridge, and what is left | Status 2026-12-04 | +| `docs/rtl-in-word-and-onenote.md` | Right-to-left behaviour | Check against `nc-uiux-bidi` | +| `docs/printout-behavior.md` | Printing | Check against the print code | +| `docs/portable-export.md` | Export | Check against the export code | +| `docs/themes.md` | Themes | Pair with `nc-themes` | +| `docs/keyboard-shortcuts.md` | Keyboard shortcuts | Check against `crates/ui-egui` | +| `docs/note-windows.md` | Note windows | Check against the UI code | +| `docs/devx-performance.md` | Build and test timing | Check against `xtask` | +| `docs/testing-literal-text.md` | Literal text in tests | Pair with the text gate | +| `docs/v0.0.7-rc-plan.md` | Old release plan | Historical; do not extend | + +## Product and user documentation + +| Location | Owns | +|---|---| +| `docs/how-to/` | Task guides for users (`write-a-page.md`, `sync-a-notebook.md`, `draw-with-a-pen.md`, and others) | +| `docs/how-to/README.md` | Index of the guides | +| `docs/welcome-to-notecraft/` | The Welcome notebook | +| `docs/demo/` | Demo notebook sources and generator (`docs/demo/scripts`) | +| `docs/brand/` | Brand assets | +| `docs/screenshots/` | Screenshot set | + +## Decisions and proposals + +| Location | Owns | Status | +|---|---|---| +| `docs/rfc/uiux/` | UI and interaction decisions (ADRs: `0001-clipboard-boundary.md`) | Accepted records | +| `docs/rfc/release/` | Release and update decisions (`0002-release-detection.md`) | Accepted records | +| `docs/rfc/README.md` | RFC index | | +| `docs/rfc/ver.0.1.x/rfc-mve-v1-branching.md` | MVE architecture and the three-branch model for 0.1.x | **Draft for review; not adopted** | +| `docs/rfc/dom-ser/` | DOM serialization RFCs | | +| `SKILLS/nc-dom-ser/references/rfc-0001-notecraft-dom.md` | DOM model (RFC 0001) | Draft or accepted: check its status line | +| `SKILLS/nc-dom-ser/references/rfc-0002-edit-render-modes.md` | Edit and render modes (RFC 0002) | Interim draft; superseded by 0001 on acceptance | +| `SKILLS/nc-dom-ser/references/rfc-0003-ink-drawing-block.md` | Ink drawings as a block (RFC 0003) | Accepted by owner; implementation in progress | + +## Research + +| Location | Owns | +|---|---| +| `docs/research/README.md` | Index of research notes | +| `docs/research/onenote-file-format/` | Notes on the OneNote file format (ink, pages, properties) | + +## Skills (design and architecture contracts) + +| Skill | Scope | +|---|---| +| `SKILLS/nc-arch` | System architecture: crate relationships, ownership, data flow | +| `SKILLS/nc-arch-x-plat` | Cross-platform rule: branch per platform, never reduce to the common set | +| `SKILLS/nc-design-editor` | Editing, undo and redo for every change to page content | +| `SKILLS/nc-dom-ser` | HTML and CommonMark parity, with its RFCs and fidelity matrix | +| `SKILLS/nc-hl-design` | Feature and refactor design; has `references/` | +| `SKILLS/nc-design-controller` | MVC-aligned user actions (review against the MVE RFC) | +| `SKILLS/nc-design-artcraft-integration` | ArtCraft suite conventions | +| `SKILLS/nc-design-egui-integration` | egui boundaries, input, clipboard | +| `SKILLS/nc-info-search` | Search: today's scan and the planned hybrid search | +| `SKILLS/nc-prod` | Product requirements: local files, format parity, OneNote behaviour, import | +| `SKILLS/nc-release-signoff` | Pre-release checks, including the OneNote matrix | +| `SKILLS/nc-ua` | User-facing product coverage and demo notebook | +| `SKILLS/nc-themes` | Theme tokens, contrast and states | +| `SKILLS/nc-runtime-diagnostics` | Runtime failures from logs, with privacy | +| `SKILLS/nc-code-rust` | Rust conventions | +| `SKILLS/nc-devx` | Local setup, lint, test, run | +| `SKILLS/nc-devx-docs` | This skill: documentation standard and the map | +| `SKILLS/nc-uiux-*` | Dialogs, controls, keys, icons, drawing, bidi, i18n, z-order, testing, features | + +## Where a new document goes + +- A decision that is settled and small: `docs/rfc/architecture/NNNN-title.md`. +- A proposal for review: `docs/rfc//rfc-.md`, with a status line that says "Draft". +- A design contract that code must follow: a skill under `SKILLS/`. +- A how-to for users: `docs/how-to/`, and link it from `docs/how-to/README.md`. +- Work in progress: a dated status document, linked from the index. diff --git a/SKILLS/nc-devx-docs/references/writing-standard.md b/SKILLS/nc-devx-docs/references/writing-standard.md new file mode 100644 index 000000000..d5352801d --- /dev/null +++ b/SKILLS/nc-devx-docs/references/writing-standard.md @@ -0,0 +1,62 @@ +# Writing standard and template + +## Template for a reference page + +```markdown +# : + +Status as of YYYY-MM-DD. Source: , checked at . + +## Summary +What it is and what it is for, in one or two sentences. + +## Remarks +Behaviour, limits, ordering, and the reasons for non-obvious choices. +Each claim: (`path/to/file.rs:123`) or (`cargo xtask `) or (test `name`). + +## Parameters +| Name | Type | Unit or range | Meaning | +|---|---|---|---| + +## Results and outputs +What the caller gets back, and what is written to disk. + +## Errors +| Error or condition | Caller should | +|---|---| + +## Example +A command or code block that runs, and its expected output. + +## Not yet implemented +Anything planned but absent. Say "planned" or "proposed" here, not in the sections above. + +## See also +Relative links to the related page, skill, ADR or RFC. +``` + +## Checklist before a document is merged + +- [ ] Every claim has a source (file and line, command, or test name). +- [ ] The status line has today's date, and names the commit that was checked. +- [ ] Planned or proposed items are marked as such in the text. +- [ ] No personal data, real notebook content, or private names appear. +- [ ] Every relative link resolves (`cargo xtask docs`). +- [ ] The text follows the project's text rules (`cargo xtask text`): no curly quotes, no em dashes. +- [ ] The document is linked from its nearest index. +- [ ] If it describes a command, the command was run and its output checked. + +## Style + +- Short sentences. One idea per sentence. +- Present tense for what the code does today. Future tense or "proposed" for anything else. +- Name things the way the code names them (`Block::Drawing`, `ink-original.json`), so a reader can grep. +- Use tables for parameters, errors and file lists. +- Do not describe a feature from a pull request title. Check the code. + +## When code and a document disagree + +1. Find out which one is right, from the code and its tests. +2. If the code is right, fix the document in the same change. +3. If the document records a decision the code does not follow, open an issue or a note in the owning + skill. Do not quietly change either one. diff --git a/SKILLS/nc-devx/scripts/setup.ps1 b/SKILLS/nc-devx/scripts/setup.ps1 index 403b82171..3958ae4da 100644 --- a/SKILLS/nc-devx/scripts/setup.ps1 +++ b/SKILLS/nc-devx/scripts/setup.ps1 @@ -5,7 +5,7 @@ # What is missing is installed: # - the MSVC C++ build tools (the Rust linker on Windows), through winget # - rustup, and the Rust named in rust-toolchain.toml with clippy and rustfmt -# - with -Packaging: a .NET 8 or later SDK and WiX 5 with its UI and Util extensions +# - with -Packaging: a .NET 8 or later SDK for WiX 5, with its UI and Util extensions # Then it turns the git hooks on and builds xtask. # # -SkipRust leave Rust alone @@ -126,7 +126,7 @@ if (-not $SkipRust) { } if ($Packaging) { - Step ".NET SDK (for the OfficeIMO bridge and WiX)" + Step ".NET SDK (for WiX)" $major = DotNet-SdkMajor if ($major -ge 8) { Ok ".NET SDK $major" diff --git a/SKILLS/nc-dom-ser/SKILL.md b/SKILLS/nc-dom-ser/SKILL.md index 473aa3282..3cda3dfac 100644 --- a/SKILLS/nc-dom-ser/SKILL.md +++ b/SKILLS/nc-dom-ser/SKILL.md @@ -175,4 +175,4 @@ See `references/object-types.md` for the object identifiers, Rust names, WordCra See `references/naming-convention.md` for the rules that the identifiers, Rust names, HTML classes and data attributes follow. -RFC 0001, the proposed NoteCraft document model with its integration appendix: `references/rfc-0001-notecraft-dom.md`. +RFC 0001, the proposed NoteCraft document model with its integration appendix: `docs/rfc/dom-ser/0001-notecraft-dom.md` in the repository (the old `references/rfc-0001-notecraft-dom.md` is a pointer to it). diff --git a/SKILLS/nc-dom-ser/references/rfc-0001-notecraft-dom.md b/SKILLS/nc-dom-ser/references/rfc-0001-notecraft-dom.md index 26e051383..2011884d1 100644 --- a/SKILLS/nc-dom-ser/references/rfc-0001-notecraft-dom.md +++ b/SKILLS/nc-dom-ser/references/rfc-0001-notecraft-dom.md @@ -1,3 +1,6 @@ +> **Moved.** This RFC now lives at `docs/rfc/dom-ser/0001-notecraft-dom.md` in the repository. +> This file is kept only as a pointer and will be removed once every reference is updated. + # RFC 0001: The NoteCraft document object model (DOM) | Field | Value | diff --git a/SKILLS/nc-dom-ser/references/rfc-0002-edit-render-modes.md b/SKILLS/nc-dom-ser/references/rfc-0002-edit-render-modes.md index 8f7c59f6c..3c1fb3177 100644 --- a/SKILLS/nc-dom-ser/references/rfc-0002-edit-render-modes.md +++ b/SKILLS/nc-dom-ser/references/rfc-0002-edit-render-modes.md @@ -1,3 +1,6 @@ +> **Moved.** This RFC now lives at `docs/rfc/dom-ser/0002-edit-render-modes.md` in the repository. +> This file is kept only as a pointer and will be removed once every reference is updated. + # RFC 0002: Edit and render modes for page objects (interim) | Field | Value | diff --git a/SKILLS/nc-dom-ser/references/rfc-0003-ink-drawing-block.md b/SKILLS/nc-dom-ser/references/rfc-0003-ink-drawing-block.md index c16b3c419..17e67b80a 100644 --- a/SKILLS/nc-dom-ser/references/rfc-0003-ink-drawing-block.md +++ b/SKILLS/nc-dom-ser/references/rfc-0003-ink-drawing-block.md @@ -1,3 +1,6 @@ +> **Moved.** This RFC now lives at `docs/rfc/dom-ser/0003-ink-drawing-block.md` in the repository. +> This file is kept only as a pointer and will be removed once every reference is updated. + # RFC 0003: Ink drawings as a model block that keeps the original stroke data | Field | Value | diff --git a/SKILLS/nc-ua/product-coverage.json b/SKILLS/nc-ua/product-coverage.json index 6bf199e6a..6651dabc5 100644 --- a/SKILLS/nc-ua/product-coverage.json +++ b/SKILLS/nc-ua/product-coverage.json @@ -31,16 +31,16 @@ "notes": "Windows semantic tests cover keyboard focus, dismissal, result selection, Android Back routing and unchanged page content. Light and dark captures were inspected. This transient flow is verified through tests instead of authored demo content." }, { - "id": "onenote-bridge-import", - "name": "Import OneNote folders, sections and packages through the installed bridge", + "id": "onenote-import", + "name": "Import OneNote folders, sections and packages with the native reader", "product_status": "partial", "discoverability": "file-open-and-docs/how-to/move-your-notes.md", "demo": "not_covered", "redmesa": "unknown", "online": "unknown", - "verification_path": "cargo test -p notecraft-import --lib officeimo::tests", - "limitation": "Flat bridge exports remain one combined page per section. Original page boundaries cannot be reconstructed; unsupported HTML remains read-only.", - "notes": "Windows local smoke tests use the installed bridge and public OneNote fixtures in both formats. Test data covers actual destination reporting, page-owned assets, cancellation and metadata-only ID updates. Network-share behavior and other delivery targets remain unverified." + "verification_path": "cargo test -p notecraft-import --lib notebook::tests", + "limitation": "Sections the native reader cannot read, including password-protected sections, are reported and not imported. There is no external converter fallback.", + "notes": "Focused tests cover native attachment extraction, partial-import reporting, unsupported-section recovery guidance, source validation and empty-import behavior. Manual attachment and printout imports were reported by the owner; they were not independently smoke-tested here. Network-share behavior and other delivery targets remain unverified." }, { "id": "layered-embedded-objects", diff --git a/SKILLS/nc-ua/screenshot-audit.md b/SKILLS/nc-ua/screenshot-audit.md index cb166a449..48beed9fd 100644 --- a/SKILLS/nc-ua/screenshot-audit.md +++ b/SKILLS/nc-ua/screenshot-audit.md @@ -36,18 +36,15 @@ Generated by `cargo xtask screenshots`, which runs `scripts/readme-screens.jsonl Fixed in this audit: the stale `markdown-page.png` row was removed from `ATTRIBUTION.md`. The file never existed in this repo and nothing used it. -## B. Demo pictures made by the OfficeIMO bridge (`assets/demo/`) +## B. OneNote import UI pictures (`assets/demo/`) -Generated by hand, not by `cargo xtask`. Scripts are in `tools/officeimo/`. +Rendered headlessly with `ui_shot`. Scripts live in `SKILLS/nc-ua/scripts/`. | Picture | Script | Notes | |---|---|---| -| `assets/demo/imported-notebook.png` | `tools/officeimo/demo-imported-shot.jsonl` | The shipped picture was made from a notebook in the private host repo, so it cannot be reproduced here. The script now opens `docs/demo/DemoNotebook/html` instead; a run gives a different picture, so review it before replacing the shipped one. | -| `assets/demo/import-open.png` | `tools/officeimo/demo-open-shot.jsonl` | Runs from this repo; uses the Open backstage | -| `assets/demo/import-progress.png` | `tools/officeimo/demo-progress-shot.jsonl` | Uses the demo notebook in `docs/demo/DemoNotebook/html` | - -Fixed in this audit: `demo-imported-shot.jsonl` no longer names a private host path. Its run was -checked into scratch: it produces a picture and writes nothing into the repo. +| `assets/demo/imported-notebook.png` | `SKILLS/nc-ua/scripts/demo-imported-shot.jsonl` | Shows the synthetic Welcome notebook data | +| `assets/demo/import-open.png` | `SKILLS/nc-ua/scripts/demo-open-shot.jsonl` | Uses the Open backstage | +| `assets/demo/import-progress.png` | `SKILLS/nc-ua/scripts/demo-progress-shot.jsonl` | Shows import progress over the importing guide | ## C. Generators and their outputs diff --git a/tools/officeimo/demo-imported-shot.jsonl b/SKILLS/nc-ua/scripts/demo-imported-shot.jsonl similarity index 100% rename from tools/officeimo/demo-imported-shot.jsonl rename to SKILLS/nc-ua/scripts/demo-imported-shot.jsonl diff --git a/tools/officeimo/demo-open-shot.jsonl b/SKILLS/nc-ua/scripts/demo-open-shot.jsonl similarity index 100% rename from tools/officeimo/demo-open-shot.jsonl rename to SKILLS/nc-ua/scripts/demo-open-shot.jsonl diff --git a/tools/officeimo/demo-progress-shot.jsonl b/SKILLS/nc-ua/scripts/demo-progress-shot.jsonl similarity index 100% rename from tools/officeimo/demo-progress-shot.jsonl rename to SKILLS/nc-ua/scripts/demo-progress-shot.jsonl diff --git a/apps/notecraft-cli/src/main.rs b/apps/notecraft-cli/src/main.rs index f479b7ed7..5731eec16 100644 --- a/apps/notecraft-cli/src/main.rs +++ b/apps/notecraft-cli/src/main.rs @@ -10,7 +10,6 @@ //! notecraft-cli sample create the sample notebooks (for trying the app) //! notecraft-cli open PATH [--connect PORT] show a notebook, section or page in the window //! notecraft-cli import onenote [SOURCE] import OneNote section files (see `import onenote --help`) -//! notecraft-cli import officeimo SOURCE import through the optional OfficeIMO bridge //! ``` //! Add `--notebooks FOLDER` to use another notebooks folder (default: `NOTECRAFT_NOTEBOOKS`, //! then `Documents/NoteCraft`). Exit status: 0 on success, 1 on an error or a failed check. @@ -116,16 +115,6 @@ page's assets folder. SOURCE is only read. --only WORD only notebooks, groups or sections whose name contains WORD (repeatable) --dry-run show what would be imported and write nothing"; -const OFFICEIMO_HELP: &str = r"notecraft-cli import officeimo SOURCE [options] - -SOURCE is one .one file, a OneNote package (.onepkg) or a folder tree. A folder, or a package's -contents, becomes a notebook, nested folders become section groups, and .one files become -sections. OneNote_RecycleBin is skipped. -The bridge is selected by NOTECRAFT_OFFICEIMO_BRIDGE or the platform cache. - - --to FOLDER write the generated notebook under this folder - --format html|cmgfm page format to write (default: html)"; - /// `import onenote`: the command line over `notecraft-import`. fn import_onenote(root: &Path, mut args: Vec) -> Result<(String, bool), String> { if args.iter().any(|a| a == "--help" || a == "-h") { @@ -179,22 +168,6 @@ fn import_onenote(root: &Path, mut args: Vec) -> Result<(String, bool), Ok((report.to_string(), ok)) } -fn import_officeimo(root: &Path, mut args: Vec) -> Result<(String, bool), String> { - if args.iter().any(|a| a == "--help" || a == "-h") { - return Ok((OFFICEIMO_HELP.to_string(), true)); - } - let to = take_flag_value(&mut args, "--to").map(PathBuf::from).unwrap_or_else(|| root.to_path_buf()); - let format = match take_flag_value(&mut args, "--format") { - Some(value) => notecraft_import::officeimo::Format::parse(&value)?, - None => notecraft_import::officeimo::Format::Html, - }; - if args.len() != 1 || args[0].starts_with("--") { - return Err("usage: import officeimo SOURCE [--to FOLDER] [--format html|cmgfm]".to_string()); - } - let output = notecraft_import::officeimo::run(Path::new(&args[0]), &to, format)?; - Ok((if output.trim().is_empty() { format!("OfficeIMO import written to {}", display_path(&to)) } else { output }, true)) -} - fn describe(o: &Output) -> String { match o { Output::Voice(_) => notecraft_engine::output_json(o).to_string(), @@ -272,8 +245,7 @@ fn run(mut args: Vec) -> Result<(String, bool), String> { if cmd == "import" { return match rest.first().map(String::as_str) { Some("onenote") => import_onenote(&root, rest[1..].to_vec()), - Some("officeimo") => import_officeimo(&root, rest[1..].to_vec()), - _ => Err("usage: import onenote [SOURCE] or import officeimo SOURCE. Try --help".to_string()), + _ => Err("usage: import onenote [SOURCE]. Try --help".to_string()), }; } if cmd == "mcp" { @@ -311,7 +283,7 @@ fn run(mut args: Vec) -> Result<(String, bool), String> { } } -const HELP: &str = "notecraft-cli commands | run ID key=value ... | tree | check NOTEBOOK | search TEXT | sample | open PATH [--connect PORT] | import onenote [SOURCE] | import officeimo SOURCE | mcp [--connect PORT] (add --notebooks FOLDER)"; +const HELP: &str = "notecraft-cli commands | run ID key=value ... | tree | check NOTEBOOK | search TEXT | sample | open PATH [--connect PORT] | import onenote [SOURCE] | mcp [--connect PORT] (add --notebooks FOLDER)"; fn main() -> ExitCode { if std::env::args().nth(1).as_deref() == Some("--version") { diff --git a/apps/notecraft-cli/tests/officeimo_bridge.rs b/apps/notecraft-cli/tests/officeimo_bridge.rs deleted file mode 100644 index 0158266b1..000000000 --- a/apps/notecraft-cli/tests/officeimo_bridge.rs +++ /dev/null @@ -1,56 +0,0 @@ -//! Opt-in acceptance test with the installed bridge, never a replacement executable. - -use notecraft_store::testing::TempDir; -use std::process::Command; - -#[test] -#[ignore = "requires a real installed OfficeIMO bridge in NOTECRAFT_OFFICEIMO_BRIDGE"] -fn sections_and_folders_import_under_the_requested_parent_without_overwriting_notes() { - let bridge = std::env::var_os("NOTECRAFT_OFFICEIMO_BRIDGE").expect("set the real bridge path"); - let source = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../crates/import/tests/fixtures/3p/officeimo/testOneNote2016.one"); - let original = std::fs::read(&source).expect("public fixture"); - for (format, folder) in [("html", false), ("cmgfm", false), ("html", true), ("cmgfm", true)] { - let t = TempDir::new("cli-real-officeimo"); - let input = if folder { - let folder = t.path().join("Notebook.v2"); - std::fs::create_dir(&folder).expect("source folder"); - std::fs::copy(&source, folder.join("Section.one")).expect("public section fixture"); - folder - } else { - source.clone() - }; - let parent = t.path().join("notebooks"); - std::fs::create_dir(&parent).expect("output parent"); - std::fs::write(parent.join("keep.txt"), "existing notes").expect("existing notes"); - for expected in 1..=2 { - let result = Command::new(env!("CARGO_BIN_EXE_notecraft-cli")) - .env("NOTECRAFT_SETTINGS", t.path().join("settings.toml")) - .env("NOTECRAFT_OFFICEIMO_BRIDGE", &bridge) - .args([ - "--notebooks", - &parent.to_string_lossy(), - "import", - "officeimo", - &input.to_string_lossy(), - "--to", - &parent.to_string_lossy(), - "--format", - format, - ]) - .output() - .expect("run importer with the real bridge"); - assert!(result.status.success(), "{}", String::from_utf8_lossy(&result.stderr)); - let notebooks = notecraft_store::tree::load_notebooks(&parent); - assert_eq!(notebooks.len(), expected, "each import creates its own notebook under the parent"); - for notebook in notebooks { - let page = ¬ebook.children[0].children[0]; - let loaded = notecraft_store::page::load_page(&page.path).expect("open imported page"); - assert!(loaded.body.contains("This is one note 2016"), "the real section content is accessible"); - assert!(!page.info.id.is_empty()); - } - assert_eq!(std::fs::read_to_string(parent.join("keep.txt")).expect("existing notes"), "existing notes"); - assert!(!parent.join("index.html").exists() && !parent.join("index.md").exists(), "the parent must not become a page"); - } - } - assert_eq!(std::fs::read(source).expect("source preserved"), original); -} diff --git a/assets/demo/import-open.png b/assets/demo/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/assets/demo/import-open.png and b/assets/demo/import-open.png differ diff --git a/assets/demo/import-progress.png b/assets/demo/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/assets/demo/import-progress.png and b/assets/demo/import-progress.png differ diff --git a/assets/demo/imported-notebook.png b/assets/demo/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/assets/demo/imported-notebook.png and b/assets/demo/imported-notebook.png differ diff --git a/crates/import/src/ink.rs b/crates/import/src/ink.rs index c1a927898..ad5564039 100644 --- a/crates/import/src/ink.rs +++ b/crates/import/src/ink.rs @@ -144,6 +144,96 @@ mod tests { assert!((first.x - 0.0).abs() < 0.01 && (first.y - 48.0).abs() < 0.01 && (first.pressure - 0.5).abs() < 0.01, "{first:?}"); } + #[test] + fn width_units_and_neutral_pressure_are_converted() { + let points = vec![InkPoint { x: 0.0, y: 0.0, pressure: None }, InkPoint { x: 0.5, y: 0.5, pressure: None }]; + let ink = Ink { strokes: vec![InkStroke { points, colour: None, width: 50.0, highlighter: false }], unread: 0, ..Ink::default() }; + let written = drawing(&ink).expect("ink"); + let drawing = read(&written); + let [stroke] = drawing.strokes.as_slice() else { panic!("{drawing:?}") }; + assert!((stroke.width - 80.0).abs() < 0.01, "{}", stroke.width); + let first = stroke.dabs.first().expect("first dab"); + assert!((first.pressure - 1.0).abs() < 0.01, "{}", first.pressure); + } + + #[test] + fn variable_pressure_low_to_high_is_preserved() { + let points = vec![ + InkPoint { x: 0.0, y: 0.0, pressure: Some(0.2) }, + InkPoint { x: 0.5, y: 0.5, pressure: Some(0.5) }, + InkPoint { x: 1.0, y: 0.0, pressure: Some(0.9) }, + ]; + let ink = Ink { strokes: vec![InkStroke { points, colour: None, width: 0.1, highlighter: false }], unread: 0, ..Ink::default() }; + let drawing = read(&drawing(&ink).expect("ink")); + let [stroke] = drawing.strokes.as_slice() else { panic!("{drawing:?}") }; + assert!(stroke.dabs.len() >= 2, "expected multiple dabs: {:?}", stroke.dabs); + let first = stroke.dabs.first().expect("first"); + let last = stroke.dabs.last().expect("last"); + assert!(first.pressure < last.pressure, "expected low-to-high pressure: {first:?} -> {last:?}"); + } + + #[test] + fn single_dot_preserves_varying_pressures() { + for p in [0.2_f32, 0.85_f32] { + let ink = Ink { + strokes: vec![InkStroke { + points: vec![InkPoint { x: 0.25, y: 0.25, pressure: Some(p) }], + colour: None, + width: 0.1, + highlighter: false, + }], + unread: 0, + ..Ink::default() + }; + let drawing = read(&drawing(&ink).expect("ink")); + let [stroke] = drawing.strokes.as_slice() else { panic!("{drawing:?}") }; + assert_eq!(stroke.dabs.len(), 1); + assert!((stroke.dabs[0].pressure - p).abs() < 0.01, "expected {p}, got {}", stroke.dabs[0].pressure); + } + } + + #[test] + fn open_closed_and_intersecting_shapes_are_preserved() { + let open = InkStroke { + points: vec![ + InkPoint { x: 0.0, y: 0.0, pressure: Some(0.5) }, + InkPoint { x: 1.0, y: 0.0, pressure: Some(0.5) }, + InkPoint { x: 1.0, y: 1.0, pressure: Some(0.5) }, + ], + colour: None, + width: 0.1, + highlighter: false, + }; + let closed = InkStroke { + points: vec![ + InkPoint { x: 2.0, y: 0.0, pressure: Some(0.5) }, + InkPoint { x: 3.0, y: 0.0, pressure: Some(0.5) }, + InkPoint { x: 3.0, y: 1.0, pressure: Some(0.5) }, + InkPoint { x: 2.0, y: 0.0, pressure: Some(0.5) }, + ], + colour: None, + width: 0.1, + highlighter: false, + }; + let cross_a = InkStroke { + points: vec![InkPoint { x: 0.0, y: 2.0, pressure: Some(0.5) }, InkPoint { x: 1.0, y: 3.0, pressure: Some(0.5) }], + colour: None, + width: 0.1, + highlighter: false, + }; + let cross_b = InkStroke { + points: vec![InkPoint { x: 0.0, y: 3.0, pressure: Some(0.5) }, InkPoint { x: 1.0, y: 2.0, pressure: Some(0.5) }], + colour: None, + width: 0.1, + highlighter: false, + }; + let ink = Ink { strokes: vec![open, closed, cross_a, cross_b], unread: 0, ..Ink::default() }; + let written = drawing(&ink).expect("ink"); + assert_eq!((written.strokes, written.left_out), (4, 0)); + let drawing = read(&written); + assert_eq!(drawing.strokes.len(), 4); + } + #[test] fn a_page_without_ink_has_no_ink_file() { assert!(drawing(&Ink::default()).is_none()); diff --git a/crates/import/src/lib.rs b/crates/import/src/lib.rs index 8fe2f0054..cec66919e 100644 --- a/crates/import/src/lib.rs +++ b/crates/import/src/lib.rs @@ -15,7 +15,6 @@ pub mod discover; mod file_data; mod ink; pub mod notebook; -pub mod officeimo; pub mod package; #[cfg(not(target_arch = "wasm32"))] mod tagged; @@ -348,31 +347,6 @@ fn loose_notebook_name(source: &Path) -> String { if name.trim().is_empty() || name.eq_ignore_ascii_case("backup") { "OneNote import".to_string() } else { name } } -/// The notebook folder a section reaches, made the first time one does, and the section -/// group folders under it. Nothing is made for a section that is never written, so a -/// notebook or group that holds nothing never appears (issue #19). -pub(crate) fn notebook_and_groups( - dest: &Path, - notebook_title: &str, - groups: &[String], - format: PageFormat, - settings: &Settings, -) -> Result<(PathBuf, PathBuf), String> { - let notebook = match child_by_title(dest, notebook_title, NodeKind::Notebook) { - Some(p) => p, - None => ops::create_notebook(dest, notebook_title, Some(format), settings).map_err(|e| e.to_string())?, - }; - let mut parent = notebook.clone(); - for group in groups { - let title = clean_title(group, "Section group"); - parent = match child_by_title(&parent, &title, NodeKind::SectionGroup) { - Some(p) => p, - None => ops::create_node(&parent, &title, NodeKind::SectionGroup, None, settings).map_err(|e| e.to_string())?, - }; - } - Ok((notebook, parent)) -} - fn label_of(p: &Planned, fallback: &str) -> String { let mut parts: Vec<&str> = if p.file.folders.is_empty() { vec![fallback] } else { p.file.folders.iter().map(String::as_str).collect() }; parts.push(&p.file.name); diff --git a/crates/import/src/notebook.rs b/crates/import/src/notebook.rs index bc9850f0d..cdd98453c 100644 --- a/crates/import/src/notebook.rs +++ b/crates/import/src/notebook.rs @@ -1,24 +1,39 @@ //! One OneNote notebook into the notebooks folder: what the window's Import does (issue #19). //! -//! NoteCraft's own reader comes first, so a section arrives with its pages, sub-pages, -//! pictures and attached files. A section it cannot read is given to the OfficeIMO bridge -//! when one is installed. Nothing is made until a section arrives: a notebook or a section -//! group that would hold nothing never appears, and whatever could not be brought over is -//! named in the result and in `import-errors.txt` beside the notebook. +//! NoteCraft's native reader brings over supported sections with their pages, sub-pages, +//! pictures and attached files. A section it cannot read is reported with a recovery step. +//! Nothing is made until a section arrives: a notebook or a section group that would hold +//! nothing never appears, and whatever could not be brought over is named in the result and in +//! `import-errors.txt` beside the notebook. -use crate::officeimo::{self, Format, Progress}; use crate::package::Scratch; -use crate::{Event, Options, Report, Skipped, child_by_title, clean_title, discover, notebook_and_groups, run}; +use crate::{Event, Options, Report, Skipped, child_by_title, clean_title, discover, run}; use notecraft_model::{NodeKind, PageFormat}; -use notecraft_store::{Settings, ops}; use std::fs; -use std::path::Path; +use std::path::{Path, PathBuf}; use std::sync::Arc; -use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::atomic::AtomicBool; + +/// Progress reported while a notebook import is being materialized. +#[derive(Clone, Debug)] +pub enum Progress { + Found { + total: usize, + }, + /// The actual notebook folder chosen by the importer, including collision suffixes. + Destination { + path: PathBuf, + }, + Section { + index: usize, + total: usize, + label: String, + }, +} /// Imports `source` (a notebook folder, a `.one` section, a notebook's `.onetoc2` or a -/// `.onepkg` package) as one new notebook under `notebooks`. Any other file is handed to the -/// OfficeIMO bridge whole, as before. The notebook's folder is reported through +/// `.onepkg` package) as one new notebook under `notebooks`. Unsupported source types fail +/// before any destination is created. The notebook's folder is reported through /// [`Progress::Destination`] once it exists. pub fn import( source: &Path, @@ -27,42 +42,32 @@ pub fn import( cancelled: &Arc, progress: &mut impl FnMut(Progress), ) -> Result { - if !is_onenote(source) { - // Not a OneNote file: only the bridge knows what to do with it. - return officeimo::run_with_progress(source, notebooks, bridge_format(format), cancelled, progress); - } - let bridge = officeimo::locate().ok(); - import_with(source, notebooks, format, cancelled, progress, &Settings::default_location(), bridge.as_deref()) + import_inner(source, notebooks, format, cancelled, progress) } -fn bridge_format(format: PageFormat) -> Format { - match format { - PageFormat::Html => Format::Html, - PageFormat::Cmgfm => Format::Cmgfm, - } -} - -/// A folder, or a file NoteCraft's reader knows. -fn is_onenote(source: &Path) -> bool { +/// A folder, or a OneNote file type this importer understands. +fn is_supported_source(source: &Path) -> bool { source.is_dir() || crate::package::is_package(source) || source.extension().is_some_and(|e| ["one", "onetoc2", "onepkg"].iter().any(|x| e.eq_ignore_ascii_case(x))) } -/// [`import`], with the settings and the OfficeIMO bridge to use given (`None` when there is -/// no bridge). -pub fn import_with( +fn import_inner( source: &Path, notebooks: &Path, format: PageFormat, cancelled: &Arc, progress: &mut impl FnMut(Progress), - settings: &Settings, - bridge: Option<&Path>, ) -> Result { if !source.exists() { return Err(format!("{} does not exist", source.display())); } + if !is_supported_source(source) { + return Err(format!( + "unsupported OneNote import source {}: choose a folder of .one sections, one .one section, a .onetoc2 table of contents, or a .onepkg package", + source.display() + )); + } // What is read, and what the notebook is called. let mut _unpacked: Option = None; let (folder, name) = if crate::package::is_package(source) { @@ -85,13 +90,12 @@ pub fn import_with( (source.to_path_buf(), source.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default()) }; let title = unique_title(notebooks, &clean_title(&name, "OneNote import")); - let base = if folder.is_file() { folder.parent().unwrap_or(&folder).to_path_buf() } else { folder.clone() }; let mut options = Options::new(&folder, notebooks); options.format = format; options.notebook = Some(title.clone()); options.cancelled = Some(Arc::clone(cancelled)); - let mut report = { + let report = { let mut relay = |event: &Event| match event { Event::Found { sections, .. } => progress(Progress::Found { total: *sections }), Event::Section { index, total, label } => progress(Progress::Section { index: *index, total: *total, label: (*label).to_string() }), @@ -100,37 +104,6 @@ pub fn import_with( run(&options, &mut relay)? }; - // The sections NoteCraft could not read go to the bridge, one at a time. - let mut bridged = 0; - let mut combined = 0; - if let Some(bridge) = bridge { - let retry: Vec = report.skipped.iter().filter(|s| worth_the_bridge(s)).cloned().collect(); - for (i, skipped) in retry.iter().enumerate() { - if cancelled.load(Ordering::Relaxed) { - report.cancelled = true; - break; - } - let Some(file) = skipped.file.as_deref() else { continue }; - progress(Progress::Section { index: i + 1, total: retry.len(), label: format!("{} (OfficeIMO)", skipped.label) }); - match bridge_one(bridge, cancelled, file, &base, notebooks, &title, format, settings) { - Ok(whole) => { - bridged += 1; - combined += usize::from(whole); - report.skipped.retain(|s| s.file.as_deref() != Some(file)); - } - Err(error) => { - if let Some(s) = report.skipped.iter_mut().find(|s| s.file.as_deref() == Some(file)) { - s.reason = format!("{}; OfficeIMO could not convert it either: {error}", s.reason); - } - } - } - } - } else if report.skipped.iter().any(worth_the_bridge) { - for s in report.skipped.iter_mut().filter(|s| worth_the_bridge(s)) { - s.reason = format!("{} (the OfficeIMO bridge, which may read it, is not installed)", s.reason); - } - } - let Some(notebook) = child_by_title(notebooks, &title, NodeKind::Notebook) else { // Nothing arrived, so nothing was made. if report.cancelled { @@ -139,49 +112,25 @@ pub fn import_with( if report.sections_planned == 0 { return Err(format!("no OneNote sections (.one files) were found in {}", source.display())); } - return Err(format!("no section could be imported from {}: {}", source.display(), not_imported(&report.skipped))); + return Err(format!( + "no section could be imported from {}: {}. NoteCraft's native reader could not read the listed sections. \ + Open each unreadable section in OneNote and save it as a .one section, then retry. \ + Unlock password-protected sections first. No empty notebook was created.", + source.display(), + not_imported(&report.skipped) + )); }; progress(Progress::Destination { path: notebook.clone() }); if !report.skipped.is_empty() { let lines: Vec = report.skipped.iter().map(|s| format!("{}: {}", s.label, s.reason)).collect(); - let text = format!("Not imported from {}\n{}\n", source.display(), lines.join("\n")); + let text = format!( + "Not imported from {}\n{}\n\nResolve each listed reason and retry. Open unreadable sections in OneNote and save them as .one sections; unlock password-protected sections first.\n", + source.display(), + lines.join("\n") + ); fs::write(notebook.join("import-errors.txt"), text).map_err(|e| format!("cannot write the import error report: {e}"))?; } - Ok(summary(&title, &report, bridged, combined)) -} - -/// Whether a section NoteCraft left out may be read by the bridge instead. A password, or a -/// section already there, is not something the bridge changes. -fn worth_the_bridge(s: &Skipped) -> bool { - s.file.is_some() && s.reason != "password protected" && s.reason != "already in the destination" -} - -#[allow(clippy::too_many_arguments)] -fn bridge_one( - bridge: &Path, - cancelled: &AtomicBool, - file: &Path, - base: &Path, - notebooks: &Path, - title: &str, - format: PageFormat, - settings: &Settings, -) -> Result { - let (_scratch, converted, whole) = officeimo::convert_section(bridge, file, bridge_format(format), cancelled)?; - let groups: Vec = file - .parent() - .and_then(|p| p.strip_prefix(base).ok()) - .map(|rel| rel.components().map(|c| c.as_os_str().to_string_lossy().into_owned()).collect()) - .unwrap_or_default(); - let (_, parent) = notebook_and_groups(notebooks, title, &groups, format, settings)?; - let file_name = file.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default(); - let section_title = clean_title(&discover::parse_file_name(&file_name).0, "Section"); - let dir = ops::create_node(&parent, §ion_title, NodeKind::Section, None, settings).map_err(|e| e.to_string())?; - if let Err(error) = officeimo::place_section(&converted, &dir, §ion_title, bridge_format(format)) { - let _ = fs::remove_dir_all(&dir); - return Err(error); - } - Ok(whole) + Ok(summary(&title, &report)) } /// `title`, or `title (2)`, `title (3)` …: the first no notebook in `notebooks` is called. @@ -201,22 +150,19 @@ fn not_imported(skipped: &[Skipped]) -> String { if more > 0 { format!("{}; and {more} more", shown.join("; ")) } else { shown.join("; ") } } -fn summary(title: &str, report: &Report, bridged: usize, combined: usize) -> String { - let sections = report.sections_imported + bridged; +fn summary(title: &str, report: &Report) -> String { + let sections = report.sections_imported; let mut text = format!( "Imported {sections} {} with {} {} into the notebook {title}.", if sections == 1 { "section" } else { "sections" }, report.pages, if report.pages == 1 { "page" } else { "pages" }, ); - if bridged > 0 { - text.push_str(&format!(" OfficeIMO converted {bridged} of them that NoteCraft could not read.")); - } - if combined > 0 { - text.push_str(&format!(" {combined} of those came as one combined page each; their own page boundaries are unavailable.")); - } if !report.skipped.is_empty() { - text.push_str(&format!(" Not imported: {} (listed in import-errors.txt).", not_imported(&report.skipped))); + text.push_str(&format!( + " Not imported: {} (listed in import-errors.txt). Resolve each listed reason and retry.", + not_imported(&report.skipped) + )); } if report.cancelled { text.push_str(" The import was cancelled before every section was read."); @@ -248,9 +194,9 @@ mod tests { fs::write(dir.join(file), vec![7u8; 4096]).expect("write"); } - fn import_here(source: &Path, notebooks: &Path, bridge: Option<&Path>) -> Result { + fn import_here(source: &Path, notebooks: &Path) -> Result { let cancelled = Arc::new(AtomicBool::new(false)); - import_with(source, notebooks, PageFormat::Html, &cancelled, &mut |_| {}, &Settings::at(notebooks.with_file_name("settings.toml")), bridge) + import_inner(source, notebooks, PageFormat::Html, &cancelled, &mut |_| {}) } /// The titles of the nodes under `dir`, with their kinds, depth first. @@ -280,7 +226,7 @@ mod tests { section(&src, "Recipes.one", &[("Soup", "onion and leek"), ("Bread", "flour and water")]); section(&src.join("Work"), "Plans.one", &[("Monday", "the plan")]); section(&src.join("OneNote_RecycleBin"), "Deleted.one", &[("Gone", "deleted page")]); - let message = import_here(&src, ¬ebooks, None).expect("import"); + let message = import_here(&src, ¬ebooks).expect("import"); assert!(message.contains("2 sections with 3 pages"), "{message}"); let nb = notebook_dir(¬ebooks, "Life"); let shape = tree(&nb).join("\n"); @@ -301,33 +247,37 @@ mod tests { let notebooks = t.path().join("notebooks"); section(&src, "Recipes.one", &[("Soup", "onion")]); unreadable(&src.join("Archive"), "Old.one"); - let message = import_here(&src, ¬ebooks, None).expect("the readable part comes in"); + let message = import_here(&src, ¬ebooks).expect("the readable part comes in"); let nb = notebook_dir(¬ebooks, "Life"); let shape = tree(&nb).join("\n"); assert!(shape.contains("Page Soup"), "{shape}"); assert!(!shape.contains("Archive"), "no group is made for a section that never arrived:\n{shape}"); assert!(message.contains("Not imported") && message.contains("Old"), "{message}"); - assert!(message.contains("not installed"), "says the bridge could have been tried: {message}"); let errors = fs::read_to_string(nb.join("import-errors.txt")).expect("the report"); - assert!(errors.contains("Old"), "{errors}"); + assert!(errors.contains("Old") && errors.contains("save them as .one sections"), "{errors}"); } - /// With a bridge given, a section NoteCraft cannot read is offered to it. One that fails - /// there too is reported with both reasons and still leaves no empty group. (The bridge - /// converting a section is covered by the opt-in test with a real installed bridge.) #[test] - fn a_section_notecraft_cannot_read_is_offered_to_the_bridge() { - let t = TempDir::new("nb-import-bridge"); - let src = t.path().join("Life"); + fn a_native_supported_attachment_imports_without_a_converter() { + let t = TempDir::new("nb-import-native-attachment"); + let source = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/synthetic/attachment-formats.one"); let notebooks = t.path().join("notebooks"); - section(&src, "Recipes.one", &[("Soup", "onion")]); - unreadable(&src.join("Archive"), "Old.one"); - let no_such_bridge = t.path().join("no-such-bridge"); - let message = import_here(&src, ¬ebooks, Some(&no_such_bridge)).expect("the readable part comes in"); - assert!(message.contains("OfficeIMO could not convert it either") && message.contains("Old"), "{message}"); - let nb = notebook_dir(¬ebooks, "Life"); - let shape = tree(&nb).join("\n"); - assert!(shape.contains("Page Soup") && !shape.contains("Archive"), "{shape}"); + let message = import_here(&source, ¬ebooks).expect("the native reader imports attachments"); + assert!(message.contains("Imported 1 section"), "{message}"); + + let notebook = notebook_dir(¬ebooks, "attachment-formats"); + let section = child_dirs(¬ebook) + .into_iter() + .find(|path| read_node(path).is_some_and(|node| node.kind == NodeKind::Section)) + .expect("the imported section"); + let page = + child_dirs(§ion).into_iter().find(|path| read_node(path).is_some_and(|node| node.kind == NodeKind::Page)).expect("the imported page"); + let assets = fs::read_dir(page.join("assets")) + .expect("page assets") + .flatten() + .map(|entry| fs::read(entry.path()).expect("asset bytes")) + .collect::>(); + assert!(assets.iter().any(|bytes| bytes == b"Synthetic attachment text.\n"), "{assets:?}"); } /// A section in OneNote's OneDrive packaging is named as such, not as "not a section". @@ -340,7 +290,7 @@ mod tests { let mut packaged = OneNote::new().with_page("Cloud", &[OneNote::line("x")]).finish(); packaged.splice(48..64, notecraft_onenote::FILE_FORMAT_PACKAGED.0); fs::write(src.join("Cloud.one"), packaged).expect("write"); - let message = import_here(&src, ¬ebooks, None).expect("import"); + let message = import_here(&src, ¬ebooks).expect("import"); assert!(message.contains("Cloud") && message.contains("OneDrive format"), "{message}"); } @@ -350,23 +300,37 @@ mod tests { let src = t.path().join("Life"); let notebooks = t.path().join("notebooks"); unreadable(&src.join("Archive"), "Old.one"); - let error = import_here(&src, ¬ebooks, None).expect_err("nothing to import"); + let error = import_here(&src, ¬ebooks).expect_err("nothing to import"); assert!(error.contains("Old"), "{error}"); + assert!(error.contains("native reader") && error.contains("save it as a .one section"), "{error}"); assert!(tree(¬ebooks).is_empty(), "no notebook was left behind: {:?}", tree(¬ebooks)); let empty = t.path().join("Empty"); fs::create_dir_all(&empty).unwrap(); - let error = import_here(&empty, ¬ebooks, None).expect_err("no sections"); + let error = import_here(&empty, ¬ebooks).expect_err("no sections"); assert!(error.contains("no OneNote sections"), "{error}"); } + #[test] + fn unsupported_source_type_is_rejected_with_supported_choices() { + let t = TempDir::new("nb-import-unsupported"); + let source = t.path().join("notes.pdf"); + let notebooks = t.path().join("notebooks"); + fs::write(&source, b"not a OneNote file").unwrap(); + + let error = import_here(&source, ¬ebooks).expect_err("unsupported source"); + assert!(error.contains("unsupported OneNote import source"), "{error}"); + assert!(error.contains(".onepkg"), "{error}"); + assert!(tree(¬ebooks).is_empty(), "no notebook was created: {:?}", tree(¬ebooks)); + } + #[test] fn a_second_import_of_the_same_folder_is_a_new_notebook() { let t = TempDir::new("nb-import-twice"); let src = t.path().join("Life"); let notebooks = t.path().join("notebooks"); section(&src, "Recipes.one", &[("Soup", "onion")]); - import_here(&src, ¬ebooks, None).expect("first"); - import_here(&src, ¬ebooks, None).expect("second"); + import_here(&src, ¬ebooks).expect("first"); + import_here(&src, ¬ebooks).expect("second"); notebook_dir(¬ebooks, "Life"); let again = notebook_dir(¬ebooks, "Life (2)"); assert!(tree(&again).join("\n").contains("Page Soup")); @@ -379,12 +343,12 @@ mod tests { let notebooks = t.path().join("notebooks"); section(&src, "Recipes (On 1-2-2024).one", &[("Soup", "onion")]); section(&src, "Garden.one", &[("Beans", "water")]); - import_here(&src.join("Recipes (On 1-2-2024).one"), ¬ebooks, None).expect("a section"); + import_here(&src.join("Recipes (On 1-2-2024).one"), ¬ebooks).expect("a section"); let one = notebook_dir(¬ebooks, "Recipes"); let shape = tree(&one).join("\n"); assert!(shape.contains("Section Recipes") && shape.contains("Page Soup") && !shape.contains("Garden"), "{shape}"); fs::write(src.join("Open Notebook.onetoc2"), b"toc").unwrap(); - import_here(&src.join("Open Notebook.onetoc2"), ¬ebooks, None).expect("the whole notebook"); + import_here(&src.join("Open Notebook.onetoc2"), ¬ebooks).expect("the whole notebook"); let whole = tree(¬ebook_dir(¬ebooks, "Life")).join("\n"); assert!(whole.contains("Page Soup") && whole.contains("Page Beans"), "{whole}"); } diff --git a/crates/import/src/officeimo.rs b/crates/import/src/officeimo.rs deleted file mode 100644 index 900b449aa..000000000 --- a/crates/import/src/officeimo.rs +++ /dev/null @@ -1,923 +0,0 @@ -//! Optional OfficeIMO bridge discovery and invocation. -//! -//! The bridge is deliberately an external process. This keeps the NoteCraft core Rust-only, -//! lets releases carry a platform-specific OfficeIMO build, and gives us a stable replacement -//! point if the importer implementation changes later. - -use notecraft_formats::{frontmatter, html, templates}; -use std::ffi::OsString; -use std::fs; -#[cfg(windows)] -use std::os::windows::process::CommandExt; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; -use std::sync::atomic::{AtomicBool, Ordering}; - -/// The page serialization requested from the bridge. -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum Format { - Html, - Cmgfm, -} - -/// Progress reported while a folder import is being materialized. -#[derive(Clone, Debug)] -pub enum Progress { - Found { - total: usize, - }, - /// The actual notebook folder chosen by the importer, including collision suffixes. - Destination { - path: PathBuf, - }, - Section { - index: usize, - total: usize, - label: String, - }, -} - -impl Format { - /// Parses the public page format names used by the CLI and bridge contract. - pub fn parse(value: &str) -> Result { - match value { - "html" => Ok(Self::Html), - "cmgfm" => Ok(Self::Cmgfm), - other => Err(format!("unknown OfficeIMO format '{other}'; use html or cmgfm")), - } - } -} - -impl Format { - fn argument(self) -> &'static str { - match self { - Self::Html => "html", - Self::Cmgfm => "cmgfm", - } - } -} - -/// Locates an explicitly installed or bundled OfficeIMO bridge. -pub fn locate() -> Result { - if let Some(path) = std::env::var_os("NOTECRAFT_OFFICEIMO_BRIDGE") { - let path = PathBuf::from(path); - return executable_or_error(path, "NOTECRAFT_OFFICEIMO_BRIDGE"); - } - - let relative = Path::new("importers").join("officeimo").join(target_name()).join(executable_name()); - let mut candidates = Vec::new(); - if let Some(root) = std::env::var_os("NOTECRAFT_DATA_DIR").map(PathBuf::from).or_else(data_dir) { - candidates.push(root.join(&relative)); - } - // Windows MSI installs the bridge beside the application under Program Files, while - // portable/dev installs may use the data directory above. Check both layouts. - if let Ok(executable) = std::env::current_exe() - && let Some(app_dir) = executable.parent() - { - candidates.push(app_dir.join(&relative)); - } - if let Some(path) = candidates.iter().find(|path| path.is_file()) { - return Ok(path.clone()); - } - let searched = candidates.iter().map(|path| path.display().to_string()).collect::>().join("; "); - Err(format!("the installed OfficeIMO bridge was not found; searched: {searched}")) -} - -/// Invokes the bridge using the stable command-line contract. -pub fn run(source: &Path, output: &Path, format: Format) -> Result { - let cancelled = AtomicBool::new(false); - run_with_progress(source, output, format, &cancelled, &mut |_| {}) -} - -/// Runs the bridge while reporting folder progress and allowing the caller to cancel. -pub fn run_with_progress( - source: &Path, - output: &Path, - format: Format, - cancelled: &AtomicBool, - progress: &mut impl FnMut(Progress), -) -> Result { - if !source.exists() { - return Err(format!("the OfficeIMO source {} does not exist", source.display())); - } - if source.is_dir() { - return run_folder(source, output, format, cancelled, progress); - } - // A OneNote package (issue #17): unpacked into a folder named after it, which is then - // imported as a notebook folder. The unpacked copy is removed when the import ends. - if crate::package::is_package(source) { - let scratch = crate::package::Scratch::new()?; - let name = source.file_stem().map(|s| s.to_string_lossy().into_owned()).unwrap_or_default(); - let folder = scratch.path.join(crate::package::safe_name(&safe_name(&name)).unwrap_or_else(|| PathBuf::from("OneNote package"))); - crate::package::unpack(source, &folder)?; - return run_folder(&folder, output, format, cancelled, progress); - } - if cancelled.load(Ordering::Relaxed) { - return Err("OfficeIMO import cancelled".to_string()); - } - run_section(source, output, format, cancelled, progress) -} - -/// A single section still needs a notebook boundary. Run the bridge in owned scratch space -/// so a flat export cannot turn the destination itself into a page or overwrite other notes. -fn run_section(source: &Path, output: &Path, format: Format, cancelled: &AtomicBool, progress: &mut impl FnMut(Progress)) -> Result { - let scratch = crate::package::Scratch::new()?; - let title = section_name(source); - progress(Progress::Found { total: 1 }); - progress(Progress::Section { index: 1, total: 1, label: title.clone() }); - if cancelled.load(Ordering::Relaxed) { - return Err("OfficeIMO import cancelled".to_string()); - } - run_one(source, &scratch.path, format, cancelled)?; - let (section, combined) = bridge_section(&scratch.path, format, &title)?; - if cancelled.load(Ordering::Relaxed) { - return Err("OfficeIMO import cancelled".to_string()); - } - let (notebook_title, notebook) = unique_notebook_path(output, &title); - // A folder this run creates is the only one it may remove when conversion fails (#347). - fs::create_dir(¬ebook).map_err(|e| format!("cannot create imported notebook: {e}"))?; - let result = (|| -> Result { - write_node(¬ebook, "notebook", ¬ebook_title, format)?; - let destination = notebook.join("imported-section"); - copy_tree(§ion, &destination)?; - write_node(&destination, "section", &title, format)?; - normalize_ids(¬ebook)?; - progress(Progress::Destination { path: notebook.clone() }); - let summary = format!("Imported {} into {}", source.display(), notebook.display()); - // The bridge's own message names scratch space, not the delivered notebook. - Ok(if combined { - format!("{summary}\nThis bridge exported the section as one combined page. Original page boundaries are unavailable.") - } else { - summary - }) - })(); - if result.is_err() { - // Nothing readable reached this new folder; do not leave it in navigation (issue #347). - let _ = fs::remove_dir_all(¬ebook); - } - result -} - -fn run_one(source: &Path, output: &Path, format: Format, cancelled: &AtomicBool) -> Result { - run_bridge(&locate()?, source, output, format, cancelled) -} - -fn run_bridge(bridge: &Path, source: &Path, output: &Path, format: Format, cancelled: &AtomicBool) -> Result { - let mut command = Command::new(bridge); - command - .arg("--source") - .arg(source) - .arg("--out") - .arg(output) - .arg("--format") - .arg(format.argument()) - .stdin(Stdio::null()) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()); - suppress_console(&mut command); - let mut child = command.spawn().map_err(|e| format!("cannot start OfficeIMO bridge {}: {e}", bridge.display()))?; - loop { - if cancelled.load(Ordering::Relaxed) { - let _ = child.kill(); - let _ = child.wait(); - return Err("OfficeIMO import cancelled".to_string()); - } - if child.try_wait().map_err(|e| format!("cannot wait for OfficeIMO bridge: {e}"))?.is_some() { - break; - } - std::thread::sleep(std::time::Duration::from_millis(40)); - } - let result = child.wait_with_output().map_err(|e| format!("cannot collect OfficeIMO bridge output: {e}"))?; - let stdout = String::from_utf8_lossy(&result.stdout).into_owned(); - if !result.status.success() { - let stderr = String::from_utf8_lossy(&result.stderr); - return Err(format!("OfficeIMO bridge failed with {}: {}", result.status, stderr.trim())); - } - Ok(stdout) -} - -fn run_folder( - source: &Path, - notebooks: &Path, - format: Format, - cancelled: &AtomicBool, - progress: &mut impl FnMut(Progress), -) -> Result { - if cancelled.load(Ordering::Relaxed) { - return Err("OfficeIMO import cancelled".to_string()); - } - let mut files = Vec::new(); - collect_sections(source, source, &mut files)?; - files.sort(); - if files.is_empty() { - return Err(format!("no .one section files were found under {}", source.display())); - } - progress(Progress::Found { total: files.len() }); - if cancelled.load(Ordering::Relaxed) { - return Err("OfficeIMO import cancelled".to_string()); - } - - let notebook_name = safe_name(source.file_name().and_then(|v| v.to_str()).unwrap_or("Imported notebook")); - let (notebook_name, notebook) = unique_notebook_path(notebooks, ¬ebook_name); - // Claim a new folder rather than adopt one that appeared since the name was chosen: this - // run may remove the folder if no section arrives, and it must only ever remove its own. - fs::create_dir(¬ebook).map_err(|e| format!("cannot create {}: {e}", notebook.display()))?; - write_node(¬ebook, "notebook", ¬ebook_name, format)?; - progress(Progress::Destination { path: notebook.clone() }); - - let staging = notebook.join(format!(".officeimo-staging-{}", std::process::id())); - let mut combined_sections = 0; - // Sections whose page files reached the notebook. A run that ends with none of them has - // nothing to show and must not leave its empty folder behind (issue #347). - let mut imported_sections = 0; - let result = (|| { - let mut failures = Vec::new(); - for (index, file) in files.iter().enumerate() { - if cancelled.load(Ordering::Relaxed) { - return Err("OfficeIMO import cancelled".to_string()); - } - let label = file.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_else(|| "section".to_string()); - progress(Progress::Section { index: index + 1, total: files.len(), label }); - let relative_parent = file.parent().and_then(|p| p.strip_prefix(source).ok()).unwrap_or(Path::new("")); - let section_name = section_name(file); - let stage = staging.join(format!("{index}")); - fs::create_dir_all(&stage).map_err(|e| format!("cannot create {}: {e}", stage.display()))?; - if let Err(error) = run_one(file, &stage, format, cancelled) { - failures.push(format!("{}: {}", file.display(), error)); - continue; - } - let generated = match bridge_section(&stage, format, §ion_name) { - Ok((generated, combined)) => { - combined_sections += usize::from(combined); - generated - } - Err(error) => { - failures.push(format!("{}: {error}", file.display())); - continue; - } - }; - // The section groups are made only now that a section has arrived for them, so a - // section that failed leaves no empty group behind (issue #19). - let mut destination = notebook.clone(); - for component in relative_parent.components() { - let group_name = safe_name(&component.as_os_str().to_string_lossy()); - destination.push(&group_name); - if !destination.join("_node.toml").is_file() { - fs::create_dir_all(&destination).map_err(|e| format!("cannot create {}: {e}", destination.display()))?; - write_node(&destination, "group", &group_name, format)?; - } - } - destination.push(section_name.clone()); - copy_tree(&generated, &destination)?; - write_node(&destination, "section", §ion_name, format)?; - imported_sections += 1; - } - normalize_ids(¬ebook)?; - if !failures.is_empty() { - let report = format!( - "OfficeIMO imported {} of {} sections into {}\n{}", - files.len() - failures.len(), - files.len(), - notebook.display(), - failures.join("\n") - ); - fs::write(notebook.join("import-errors.txt"), &report).map_err(|e| format!("cannot write import error report: {e}"))?; - if failures.len() == files.len() { - return Err(report); - } - Ok(report) - } else { - Ok(format!("OfficeIMO imported {} sections into {}", files.len(), notebook.display())) - } - })(); - let _ = fs::remove_dir_all(&staging); - if result.is_err() && imported_sections == 0 { - // A notebook that holds no readable section would appear in navigation with nothing - // to open (issue #347). The error already carries the report for every failed file. - let _ = fs::remove_dir_all(¬ebook); - } - result.map(|message| { - if combined_sections == 0 { - message - } else { - format!( - "{message}\nThis bridge exported {combined_sections} section(s) as one combined page each. Original page boundaries are unavailable." - ) - } - }) -} - -/// Converts one section file with the bridge, for a section NoteCraft's own reader could not -/// read (issue #19). The converted section is in the returned scratch folder, which is removed -/// when it is dropped; `true` means the bridge gave one combined page for the whole section. -pub(crate) fn convert_section( - bridge: &Path, - file: &Path, - format: Format, - cancelled: &AtomicBool, -) -> Result<(crate::package::Scratch, PathBuf, bool), String> { - let scratch = crate::package::Scratch::new()?; - run_bridge(bridge, file, &scratch.path, format, cancelled)?; - let (section, combined) = bridge_section(&scratch.path, format, §ion_name(file))?; - Ok((scratch, section, combined)) -} - -/// Puts a section `convert_section` made into `destination`, an empty section folder the -/// caller made, with fresh ids for it and every page in it. -pub(crate) fn place_section(converted: &Path, destination: &Path, title: &str, format: Format) -> Result<(), String> { - copy_tree(converted, destination)?; - write_node(destination, "section", title, format)?; - normalize_ids(destination) -} - -/// Older bundled bridges export a section as one document instead of a native tree. Keep -/// that document and its relative assets together, and disclose the combined-page fallback. -fn bridge_section(stage: &Path, format: Format, title: &str) -> Result<(PathBuf, bool), String> { - let section = stage.join("Imported section"); - if section.is_dir() { - return Ok((section, false)); - } - let file_name = match format { - Format::Html => "index.html", - Format::Cmgfm => "index.md", - }; - if !stage.join(file_name).is_file() { - return Err("OfficeIMO produced no section or page document".to_string()); - } - // Enumerate before creating the destination; never recursively copy a directory into itself. - let entries = fs::read_dir(stage) - .map_err(|e| format!("cannot read bridge output: {e}"))? - .collect::, _>>() - .map_err(|e| format!("cannot read bridge output entry: {e}"))?; - let page = section.join("imported-page"); - fs::create_dir_all(&page).map_err(|e| format!("cannot create imported page: {e}"))?; - for entry in entries { - fs::rename(entry.path(), page.join(entry.file_name())).map_err(|e| format!("cannot arrange bridge output: {e}"))?; - } - let file = page.join(file_name); - let text = fs::read_to_string(&file).map_err(|e| format!("cannot read imported page: {e}"))?; - let text = if format == Format::Html { unwrap_exporter_containers(&text) } else { text }; - let text = page_metadata(&text, format, "pending", Some(title)); - fs::write(&file, text).map_err(|e| format!("cannot write imported page metadata: {e}"))?; - write_node(§ion, "section", title, format)?; - Ok((section, true)) -} - -/// The semantic bridge adds these transparent containers around supported page blocks. -/// Remove only exact known wrappers. Attributes or containers we do not understand keep -/// the original document intact, so the normal read-only protection still applies. -fn unwrap_exporter_containers(text: &str) -> String { - let mut body = html::inner(text); - for wrapper in [ - "
", - "
", - "
", - "
", - ] { - body = body.replace(wrapper, ""); - } - if body.contains("", "").replace("
", ""); - html::replace_inner(text, &body) -} - -/// Edit only the metadata boundary. A matching line in the body is page content, and HTML -/// can put its metadata and all its content on the same line. -fn page_metadata(text: &str, format: Format, id: &str, title: Option<&str>) -> String { - match format { - Format::Html => { - let mut text = if text.contains("") { - text.to_string() - } else { - html::replace_inner( - &templates::html_page(title.or(Some("Imported page")), id, 0, ¬ecraft_model::time::iso_now()), - &html::inner(text), - ) - }; - if let Some(title) = title { - let escaped = html::escape(title); - text = if html::title(&text).is_some() { - html::replace_between(&text, "", "", &escaped) - } else { - text.replacen("", &format!("{escaped}\n"), 1) - }; - } - html::set_meta(&text, "notecraft:id", id) - } - Format::Cmgfm => { - let (mut front, body) = frontmatter::split_front(text); - if front.is_empty() { - front = - frontmatter::split_front(&templates::markdown_page(title.or(Some("Imported page")), id, 0, ¬ecraft_model::time::iso_now())).0; - } else if let Some(title) = title { - front = frontmatter::set_value(&front, "title", ¬ecraft_model::kv::quote(title)); - } - format!("{}{body}", frontmatter::set_value(&front, "id", id)) - } - } -} - -#[cfg(windows)] -fn suppress_console(command: &mut Command) { - const CREATE_NO_WINDOW: u32 = 0x0800_0000; - command.creation_flags(CREATE_NO_WINDOW); -} - -#[cfg(not(windows))] -fn suppress_console(_command: &mut Command) {} - -fn unique_notebook_path(parent: &Path, name: &str) -> (String, PathBuf) { - let candidate = parent.join(name); - if !candidate.exists() { - return (name.to_string(), candidate); - } - for number in 1..=u32::MAX { - let candidate_name = format!("{name} ({number})"); - let candidate = parent.join(&candidate_name); - if !candidate.exists() { - return (candidate_name, candidate); - } - } - let fallback = format!("{name} ({})", u64::from(u32::MAX) + 1); - (fallback.clone(), parent.join(fallback)) -} - -fn collect_sections(root: &Path, dir: &Path, files: &mut Vec) -> Result<(), String> { - let entries = fs::read_dir(dir).map_err(|e| format!("cannot read {}: {e}", dir.display()))?; - for entry in entries { - let entry = entry.map_err(|e| format!("cannot read an entry under {}: {e}", dir.display()))?; - let path = entry.path(); - let kind = entry.file_type().map_err(|e| format!("cannot inspect {}: {e}", path.display()))?; - if kind.is_symlink() { - continue; - } - if kind.is_dir() { - if entry.file_name().to_string_lossy().eq_ignore_ascii_case("OneNote_RecycleBin") { - continue; - } - collect_sections(root, &path, files)?; - } else if path.extension().is_some_and(|e| e.eq_ignore_ascii_case("one")) && path.strip_prefix(root).is_ok() { - files.push(path); - } - } - Ok(()) -} - -/// Copies a file's bytes into a new file that the owner can write. `fs::copy` would also copy the -/// source's read-only flag, so an imported notebook built from read-only files would come out -/// read-only. The copy keeps the source's permission bits, so an owner-only file stays owner-only, -/// and only the owner's write bit is added. -#[allow(clippy::permissions_set_readonly_false, reason = "Windows has only the read-only flag; clearing it is the owner-write bit")] -fn copy_writable(from: &Path, to: &Path) -> std::io::Result<()> { - let mut input = fs::File::open(from)?; - let meta = input.metadata()?; - let mut output = fs::File::create(to)?; - std::io::copy(&mut input, &mut output)?; - drop(output); - let mut permissions = meta.permissions(); - #[cfg(unix)] - { - use std::os::unix::fs::PermissionsExt; - permissions.set_mode(meta.permissions().mode() | 0o200); - } - #[cfg(not(unix))] - permissions.set_readonly(false); - fs::set_permissions(to, permissions) -} - -fn copy_tree(source: &Path, destination: &Path) -> Result<(), String> { - fs::create_dir_all(destination).map_err(|e| format!("cannot create {}: {e}", destination.display()))?; - for entry in fs::read_dir(source).map_err(|e| format!("cannot read {}: {e}", source.display()))? { - let entry = entry.map_err(|e| format!("cannot read an entry under {}: {e}", source.display()))?; - let from = entry.path(); - let to = destination.join(entry.file_name()); - if entry.file_type().map_err(|e| format!("cannot inspect {}: {e}", from.display()))?.is_dir() { - copy_tree(&from, &to)?; - } else { - copy_writable(&from, &to).map_err(|e| format!("cannot copy {} to {}: {e}", from.display(), to.display()))?; - } - } - Ok(()) -} - -fn write_node(path: &Path, kind: &str, title: &str, format: Format) -> Result<(), String> { - let title = title.replace(['\\', '"'], "_"); - let content = if kind == "notebook" { - format!("kind = \"notebook\"\ntitle = \"{title}\"\nid = \"00000000000000000001\"\nformat = \"{}\"\n", format.argument()) - } else { - format!("kind = \"{kind}\"\ntitle = \"{title}\"\nid = \"00000000000000000002\"\n") - }; - fs::write(path.join("_node.toml"), content).map_err(|e| format!("cannot write {}: {e}", path.display())) -} - -fn normalize_ids(root: &Path) -> Result<(), String> { - let mut nodes = Vec::new(); - collect_nodes(root, &mut nodes)?; - nodes.sort(); - for node in &nodes { - let text = fs::read_to_string(node).map_err(|e| format!("cannot read {}: {e}", node.display()))?; - let id = notecraft_model::id::new_id(); - let updated = text - .lines() - .map(|line| if line.starts_with("id = ") { format!("id = \"{id}\"") } else { line.to_string() }) - .collect::>() - .join("\n") - + "\n"; - fs::write(node, updated).map_err(|e| format!("cannot rewrite {}: {e}", node.display()))?; - } - let mut pages = Vec::new(); - collect_pages(root, &mut pages)?; - pages.sort(); - for page in &pages { - let text = fs::read_to_string(page).map_err(|e| format!("cannot read {}: {e}", page.display()))?; - let id = notecraft_model::id::new_id(); - let format = if page.file_name().is_some_and(|name| name == "index.html") { Format::Html } else { Format::Cmgfm }; - let updated = page_metadata(&text, format, &id, None); - fs::write(page, updated).map_err(|e| format!("cannot rewrite {}: {e}", page.display()))?; - } - Ok(()) -} - -fn collect_nodes(dir: &Path, nodes: &mut Vec) -> Result<(), String> { - for entry in fs::read_dir(dir).map_err(|e| format!("cannot read {}: {e}", dir.display()))? { - let entry = entry.map_err(|e| format!("cannot read an entry under {}: {e}", dir.display()))?; - let path = entry.path(); - if entry.file_type().map_err(|e| format!("cannot inspect {}: {e}", path.display()))?.is_dir() { - let name = entry.file_name(); - if name == "assets" || name.to_string_lossy().starts_with('.') { - continue; - } - collect_nodes(&path, nodes)?; - } else if path.file_name().is_some_and(|name| name == "_node.toml") { - nodes.push(path); - } - } - Ok(()) -} - -fn collect_pages(dir: &Path, pages: &mut Vec) -> Result<(), String> { - for entry in fs::read_dir(dir).map_err(|e| format!("cannot read {}: {e}", dir.display()))? { - let entry = entry.map_err(|e| format!("cannot read an entry under {}: {e}", dir.display()))?; - let path = entry.path(); - if entry.file_type().map_err(|e| format!("cannot inspect {}: {e}", path.display()))?.is_dir() { - let name = entry.file_name(); - if name == "assets" || name.to_string_lossy().starts_with('.') { - continue; - } - collect_pages(&path, pages)?; - } else if path.file_name().is_some_and(|name| name == "index.html" || name == "index.md") { - pages.push(path); - } - } - Ok(()) -} - -fn section_name(path: &Path) -> String { - let mut name = path.file_stem().and_then(|v| v.to_str()).unwrap_or("Untitled section").to_string(); - if let Some((prefix, _)) = name.rsplit_once(" (On ") { - name = prefix.to_string(); - } - safe_name(&name) -} - -fn safe_name(value: &str) -> String { - let name: String = value.chars().map(|c| if c.is_control() || "<>:\"/\\|?*".contains(c) { '_' } else { c }).collect(); - let name = name.trim().trim_end_matches('.'); - if name.is_empty() { "Imported notebook".to_string() } else { name.to_string() } -} - -fn executable_or_error(path: PathBuf, source: &str) -> Result { - if path.is_file() { Ok(path) } else { Err(format!("{source} was not found at {}", path.display())) } -} - -fn data_dir() -> Option { - if cfg!(windows) { - std::env::var_os("LOCALAPPDATA").map(PathBuf::from).map(|p| p.join("NoteCraft")) - } else { - std::env::var_os("XDG_DATA_HOME") - .map(PathBuf::from) - .or_else(|| std::env::var_os("HOME").map(|p| PathBuf::from(p).join(".local").join("share"))) - .map(|p| p.join("NoteCraft")) - } -} - -fn target_name() -> &'static str { - if cfg!(all(target_os = "windows", target_arch = "x86_64")) { - "win-x64" - } else if cfg!(all(target_os = "linux", target_arch = "x86_64")) { - "linux-x64" - } else if cfg!(all(target_os = "macos", target_arch = "x86_64")) { - "osx-x64" - } else if cfg!(all(target_os = "macos", target_arch = "aarch64")) { - "osx-arm64" - } else { - "unsupported" - } -} - -fn executable_name() -> OsString { - if cfg!(windows) { OsString::from("officeimo-notecraft.exe") } else { OsString::from("officeimo-notecraft") } -} - -#[cfg(test)] -mod tests { - use super::*; - - /// A read-only file in the bridge's output must not make the imported copy read-only: an - /// imported notebook is an ordinary, editable notebook. - #[test] - fn copied_bridge_output_is_writable_even_when_the_source_is_read_only() { - let t = notecraft_store::testing::TempDir::new("officeimo-readonly-source"); - let source = t.path().join("source"); - let destination = t.path().join("destination"); - fs::create_dir(&source).expect("source"); - fs::write(source.join("index.md"), "# Title\n").expect("recorded output"); - let mut readonly = fs::metadata(source.join("index.md")).expect("metadata").permissions(); - readonly.set_readonly(true); - fs::set_permissions(source.join("index.md"), readonly).expect("read only source"); - - copy_tree(&source, &destination).expect("copy"); - - let copied = fs::metadata(destination.join("index.md")).expect("copied file"); - assert!(!copied.permissions().readonly(), "the imported copy is editable"); - assert_eq!(fs::read_to_string(destination.join("index.md")).expect("read"), "# Title\n"); - } - - /// A copy of an owner-only file stays owner-only: the copy adds the owner's write bit and - /// nothing for the group or others. - #[cfg(unix)] - #[test] - fn a_copy_keeps_owner_only_permissions_and_stays_writable() { - use std::os::unix::fs::PermissionsExt; - let t = notecraft_store::testing::TempDir::new("officeimo-private-source"); - let source = t.path().join("private.md"); - fs::write(&source, "secret\n").expect("source"); - fs::set_permissions(&source, fs::Permissions::from_mode(0o400)).expect("owner read only"); - let copy = t.path().join("copy.md"); - - copy_writable(&source, ©).expect("copy"); - - let mode = fs::metadata(©).expect("copy").permissions().mode() & 0o777; - assert_eq!(mode, 0o600, "owner can read and write, nobody else gets access"); - assert_eq!(fs::read_to_string(©).expect("read"), "secret\n"); - } - - #[test] - fn a_flat_bridge_export_becomes_a_readable_section_with_its_assets() { - for format in [Format::Html, Format::Cmgfm] { - let t = notecraft_store::testing::TempDir::new("officeimo-flat-output"); - let file = if format == Format::Html { "index.html" } else { "index.md" }; - let text = if format == Format::Html { - "Document

So good

This is one note 2016

" - } else { - "# So good\n\nThis is one note 2016\n\n![pixel](assets/pixel.png)\n" - }; - fs::write(t.path().join(file), text).expect("recorded flat bridge output"); - fs::create_dir(t.path().join("assets")).expect("assets"); - fs::write(t.path().join("assets/pixel.png"), include_bytes!("../tests/fixtures/synthetic-pixel.png")).expect("picture"); - let (section, combined) = bridge_section(t.path(), format, "Section").expect("flat output is supported"); - assert!(combined, "the caller can disclose combined-page output"); - normalize_ids(§ion).expect("metadata"); - let tree = notecraft_store::tree::load_tree(§ion).expect("section tree"); - assert_eq!(tree.info.kind, notecraft_model::NodeKind::Section); - assert_eq!(tree.children.len(), 1, "the flat bridge's document is one explicit page"); - let page = &tree.children[0]; - assert_eq!(page.info.kind, notecraft_model::NodeKind::Page); - assert!(!page.info.id.is_empty()); - let loaded = notecraft_store::page::load_page(&page.path).expect("read imported page"); - assert!(loaded.body.contains("This is one note 2016")); - assert!(loaded.body.contains("assets/pixel.png")); - assert_eq!( - fs::read(page.path.join("assets/pixel.png")).expect("page-owned picture"), - include_bytes!("../tests/fixtures/synthetic-pixel.png") - ); - } - } - - #[test] - fn flat_html_unwraps_only_known_exporter_containers() { - for known in [true, false] { - let t = notecraft_store::testing::TempDir::new("officeimo-flat-wrappers"); - let wrapper = if known { "officeimo-onenote-semantic" } else { "user-container" }; - let body = format!( - "

Section

Keep every word.

" - ); - fs::write(t.path().join("index.html"), format!("Document{body}")) - .expect("bridge document"); - let (section, _) = bridge_section(t.path(), Format::Html, "Section").expect("section"); - let loaded = notecraft_store::page::load_page(§ion.join("imported-page")).expect("imported page"); - assert!(loaded.body.contains("

Keep every word.

")); - if known { - assert_eq!( - html::unsupported_tag(&loaded.body), - None, - "exporter-only wrappers must not make ordinary text read-only or duplicate its title" - ); - } else { - assert_eq!(loaded.body, body, "unrecognized containers remain intact and read-only"); - } - } - } - - #[test] - fn normalizing_import_ids_preserves_inline_html_and_markdown_body_text() { - let t = notecraft_store::testing::TempDir::new("officeimo-id-content"); - let html = t.path().join("HTML"); - let md = t.path().join("Markdown"); - fs::create_dir(&html).expect("HTML page"); - fs::create_dir(&md).expect("Markdown page"); - let html_body = "

Keep every word and mark.

"; - let html_text = - format!("Inline{html_body}"); - let md_body = "\n```text\nid: this is page content\n```\n"; - fs::write(html.join("index.html"), &html_text).expect("HTML output"); - fs::write(md.join("index.md"), format!("---\nid: old\ntitle: Markdown\n---\n{md_body}")).expect("Markdown output"); - normalize_ids(t.path()).expect("normalize"); - assert_eq!(notecraft_store::page::load_page(&html).expect("HTML page").body, html_body); - assert_eq!(notecraft_store::page::load_page(&md).expect("Markdown page").body, md_body.trim_start_matches('\n')); - assert_eq!( - frontmatter::split_front(&fs::read_to_string(md.join("index.md")).expect("saved Markdown")).1, - md_body, - "the stored body is byte-for-byte unchanged" - ); - assert_ne!(notecraft_store::tree::read_node(&html).expect("HTML metadata").id, "old"); - } - - #[test] - fn independent_imports_do_not_reuse_notebook_section_or_page_ids() { - let t = notecraft_store::testing::TempDir::new("officeimo-independent-ids"); - let mut seen = std::collections::HashSet::new(); - for name in ["First", "Second"] { - let notebook = t.path().join(name); - let section = notebook.join("Section"); - let page = section.join("Page"); - fs::create_dir_all(&page).expect("notebook tree"); - write_node(¬ebook, "notebook", name, Format::Html).expect("notebook metadata"); - write_node(§ion, "section", "Section", Format::Html).expect("section metadata"); - fs::write(page.join("index.html"), "Page

Content

").expect("page"); - normalize_ids(¬ebook).expect("normalize import"); - for path in [¬ebook, §ion, &page] { - let id = notecraft_store::tree::read_node(path).expect("node").id; - assert!(!id.is_empty()); - assert!(seen.insert(id), "a second import must not reuse an existing node's identity"); - } - } - } - - #[test] - fn normalizing_import_metadata_does_not_rewrite_owned_assets_or_staging_copies() { - let t = notecraft_store::testing::TempDir::new("officeimo-owned-file-ids"); - let page = t.path().join("Page"); - fs::create_dir(&page).expect("page"); - fs::write(page.join("index.html"), "Page

Words

").expect("page file"); - let contents = "---\nid: attachment-identity\n---\nOriginal attachment bytes\n"; - let node_contents = "kind = \"section\"\nid = \"attachment-identity\"\n"; - for directory in [page.join("assets"), t.path().join(".officeimo-staging-test")] { - fs::create_dir(&directory).expect("owned files"); - fs::write(directory.join("index.md"), contents).expect("attached document"); - fs::write(directory.join("_node.toml"), node_contents).expect("attached metadata document"); - } - normalize_ids(t.path()).expect("normalize notebook pages only"); - for directory in [page.join("assets"), t.path().join(".officeimo-staging-test")] { - assert_eq!(fs::read_to_string(directory.join("index.md")).expect("attached document"), contents); - assert_eq!(fs::read_to_string(directory.join("_node.toml")).expect("attached metadata document"), node_contents); - } - assert!(!notecraft_store::tree::read_node(&page).expect("page metadata").id.is_empty()); - } - - /// Issue #17: a package is unpacked and imported as a folder of sections named after it. - /// The test machine may or may not have the optional bridge installed. - #[test] - fn a_package_is_unpacked_and_its_sections_imported_as_a_folder() { - let source = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/3p/officeimo/makecab-lzx-notebook.onepkg"); - let out = notecraft_store::testing::TempDir::new("officeimo-onepkg"); - let bridge_available = locate().is_ok(); - let mut seen = Vec::new(); - let mut destination = None; - let result = run_with_progress(&source, out.path(), Format::Html, &AtomicBool::new(false), &mut |p| { - if let Progress::Destination { path } = &p { - destination = Some(path.clone()); - } - seen.push(format!("{p:?}")); - }); - assert_eq!(result.is_ok(), bridge_available, "package import outcome should match bridge availability: {result:?}"); - assert!(seen.first().is_some_and(|p| p.contains("Found { total: 1 }")), "the package's one section was found: {seen:?}"); - assert!(seen.iter().any(|p| p.contains("Compressed section.one")), "{seen:?}"); - assert_eq!(destination, Some(out.path().join("makecab-lzx-notebook")), "the notebook is named after the package"); - assert_eq!(out.path().join("makecab-lzx-notebook").exists(), bridge_available, "only a successful import leaves the notebook folder"); - } - - /// Issue #347: a folder of sections that all fail to convert must not leave a notebook with - /// nothing to show, because navigation would present it as though the source had been read. - #[test] - fn a_folder_whose_sections_all_fail_leaves_no_phantom_notebook() { - let t = notecraft_store::testing::TempDir::new("officeimo-total-failure"); - let source = t.path().join("Journal"); - let output = t.path().join("Output"); - fs::create_dir(&source).expect("source"); - fs::create_dir(&output).expect("output"); - fs::write(source.join("Notes.one"), b"not a OneNote section").expect("source section"); - let mut destination = None; - let result = run_with_progress(&source, &output, Format::Html, &AtomicBool::new(false), &mut |event| { - if let Progress::Destination { path } = event { - destination = Some(path); - } - }); - assert!(result.is_err(), "the bridge cannot convert this section"); - assert_eq!(destination, Some(output.join("Journal")), "the run still reports where it meant to write"); - assert_eq!(fs::read_dir(&output).expect("output entries").count(), 0, "a failed import leaves no empty notebook"); - assert_eq!(fs::read(source.join("Notes.one")).expect("source preserved"), b"not a OneNote section"); - } - - #[test] - fn folder_names_and_backup_dates_become_safe_container_names() { - assert_eq!(safe_name("2026"), "2026"); - assert_eq!(section_name(Path::new("Work (On 9-29-2026).one")), "Work"); - assert_eq!(safe_name("A:B"), "A_B"); - } - - #[test] - fn a_folder_without_sections_does_not_leave_an_empty_imported_notebook() { - let t = notecraft_store::testing::TempDir::new("officeimo-empty-source"); - let source = t.path().join("Source"); - let output = t.path().join("Output"); - fs::create_dir(&source).expect("source"); - fs::create_dir(&output).expect("output"); - fs::write(source.join("readme.txt"), "not a OneNote section").expect("source content"); - assert!(run_with_progress(&source, &output, Format::Html, &AtomicBool::new(false), &mut |_| {}).is_err()); - assert_eq!(fs::read_dir(&output).expect("output entries").count(), 0, "an invalid source must not create a phantom notebook"); - assert_eq!(fs::read_to_string(source.join("readme.txt")).expect("source preserved"), "not a OneNote section"); - } - - #[test] - fn an_already_cancelled_folder_import_does_not_create_output() { - let t = notecraft_store::testing::TempDir::new("officeimo-cancelled-folder"); - let source = t.path().join("Source"); - let output = t.path().join("Output"); - fs::create_dir(&source).expect("source"); - fs::create_dir(&output).expect("output"); - fs::write(source.join("Notes.one"), b"section fixture").expect("source section"); - let result = run_with_progress(&source, &output, Format::Html, &AtomicBool::new(true), &mut |_| {}); - assert!(result.is_err()); - assert_eq!(fs::read_dir(&output).expect("output entries").count(), 0, "cancellation before starting must leave no output"); - } - - #[test] - fn folder_progress_reports_the_actual_notebook_destination() { - for name in ["Notebook.v2", "Notes (On 1-2-2026)", "Folder with spaces"] { - let t = notecraft_store::testing::TempDir::new("officeimo-reported-destination"); - let source = t.path().join(name); - let output = t.path().join("Output"); - fs::create_dir(&source).expect("source"); - fs::create_dir(&output).expect("output"); - fs::create_dir(output.join(name)).expect("existing notebook stays intact"); - fs::write(source.join("Notes.one"), []).expect("section"); - let cancel = AtomicBool::new(false); - let mut reported = None; - let _ = run_with_progress(&source, &output, Format::Html, &cancel, &mut |event| { - if let Progress::Destination { path } = event { - reported = Some(path); - // Exercise real discovery and destination creation without needing a bridge. - cancel.store(true, Ordering::Relaxed); - } - }); - let expected = output.join(format!("{name} (1)")); - assert_eq!(reported, Some(expected.clone()), "the UI receives the importer's path for {name}"); - assert!(!expected.exists(), "the cancelled import leaves no empty notebook for the UI to open"); - assert_eq!(fs::read(source.join("Notes.one")).expect("source retained"), b""); - } - } - - #[test] - fn section_discovery_is_recursive_and_skips_recycle_bin() { - let root = std::env::temp_dir().join(format!("notecraft-officeimo-{}", std::process::id())); - let nested = root.join("2026").join("MBA"); - let recycle = root.join("2026").join("OneNote_RecycleBin"); - let _ = fs::remove_dir_all(&root); - fs::create_dir_all(&nested).expect("test directory"); - fs::create_dir_all(&recycle).expect("test directory"); - fs::write(nested.join("Work.one"), []).expect("test file"); - fs::write(recycle.join("Deleted.one"), []).expect("test file"); - let mut files = Vec::new(); - collect_sections(&root, &root, &mut files).expect("scan"); - assert_eq!(files, vec![nested.join("Work.one")]); - let _ = fs::remove_dir_all(&root); - } - - #[test] - fn repeated_folder_imports_get_windows_style_names() { - let root = std::env::temp_dir().join(format!("notecraft-officeimo-names-{}", std::process::id())); - let _ = fs::remove_dir_all(&root); - fs::create_dir_all(root.join("2026")).expect("test directory"); - fs::create_dir_all(root.join("2026 (1)")).expect("test directory"); - assert_eq!(unique_notebook_path(&root, "2026"), ("2026 (2)".to_string(), root.join("2026 (2)"))); - let _ = fs::remove_dir_all(&root); - } - - #[test] - fn target_names_are_release_rids() { - assert!(matches!(target_name(), "win-x64" | "linux-x64" | "osx-x64" | "osx-arm64" | "unsupported")); - } -} diff --git a/crates/import/src/tagged.rs b/crates/import/src/tagged.rs index d560094c3..a2fd1b1a7 100644 --- a/crates/import/src/tagged.rs +++ b/crates/import/src/tagged.rs @@ -1,8 +1,8 @@ //! Sections that carry OneNote tags, read with `onenote_parser` (MPL-2.0, see ATTRIBUTION.md). //! -//! NoteCraft's own reader and the OfficeIMO bridge both lose a tag: the To Do box and the -//! star or question mark beside a line come out as plain words. So a section with a tag in it -//! is read here instead, and a tag becomes what a person writes in NoteCraft: a To Do is a task +//! The ordinary OneNote reader loses a tag: the To Do box and the star or question mark beside +//! a line come out as plain words. So a section with a tag in it is read here instead, and a +//! tag becomes what a person writes in NoteCraft: a To Do is a task //! item, and every other tag that NoteCraft knows is its marker word at the start of the line //! (see `notecraft_model::tag`). A tag NoteCraft does not know keeps its name as words in front //! of the line, so nothing is lost. diff --git a/crates/import/tests/fixtures/synthetic/asset-pack.one b/crates/import/tests/fixtures/synthetic/asset-pack.one index 0d8aa68ea..2e094d87d 100644 Binary files a/crates/import/tests/fixtures/synthetic/asset-pack.one and b/crates/import/tests/fixtures/synthetic/asset-pack.one differ diff --git a/crates/import/tests/fixtures/synthetic/attachment-formats.one b/crates/import/tests/fixtures/synthetic/attachment-formats.one index f35b54555..05b300c54 100644 Binary files a/crates/import/tests/fixtures/synthetic/attachment-formats.one and b/crates/import/tests/fixtures/synthetic/attachment-formats.one differ diff --git a/crates/import/tests/fixtures/synthetic/colors/Work/.onetoc2 b/crates/import/tests/fixtures/synthetic/colors/Work/.onetoc2 index 292c2b304..a01e98bd4 100644 Binary files a/crates/import/tests/fixtures/synthetic/colors/Work/.onetoc2 and b/crates/import/tests/fixtures/synthetic/colors/Work/.onetoc2 differ diff --git a/crates/import/tests/fixtures/synthetic/colors/Work/Archive.one b/crates/import/tests/fixtures/synthetic/colors/Work/Archive.one index de60c314b..5ddbc0191 100644 Binary files a/crates/import/tests/fixtures/synthetic/colors/Work/Archive.one and b/crates/import/tests/fixtures/synthetic/colors/Work/Archive.one differ diff --git a/crates/import/tests/fixtures/synthetic/colors/Work/Planning.one b/crates/import/tests/fixtures/synthetic/colors/Work/Planning.one index d0ace6467..75cd48a4b 100644 Binary files a/crates/import/tests/fixtures/synthetic/colors/Work/Planning.one and b/crates/import/tests/fixtures/synthetic/colors/Work/Planning.one differ diff --git a/crates/import/tests/fixtures/synthetic/formatted-text.one b/crates/import/tests/fixtures/synthetic/formatted-text.one index 4f8c952d0..be06a2a7f 100644 Binary files a/crates/import/tests/fixtures/synthetic/formatted-text.one and b/crates/import/tests/fixtures/synthetic/formatted-text.one differ diff --git a/crates/import/tests/fixtures/synthetic/groups/Loose.one b/crates/import/tests/fixtures/synthetic/groups/Loose.one index 9374b3b52..05c6fecfb 100644 Binary files a/crates/import/tests/fixtures/synthetic/groups/Loose.one and b/crates/import/tests/fixtures/synthetic/groups/Loose.one differ diff --git a/crates/import/tests/fixtures/synthetic/groups/Outer/Inner/Inner section.one b/crates/import/tests/fixtures/synthetic/groups/Outer/Inner/Inner section.one index fe2a04e95..66b63d3b2 100644 Binary files a/crates/import/tests/fixtures/synthetic/groups/Outer/Inner/Inner section.one and b/crates/import/tests/fixtures/synthetic/groups/Outer/Inner/Inner section.one differ diff --git a/crates/import/tests/fixtures/synthetic/groups/Outer/Outer section.one b/crates/import/tests/fixtures/synthetic/groups/Outer/Outer section.one index 0686c4467..44eddf4cc 100644 Binary files a/crates/import/tests/fixtures/synthetic/groups/Outer/Outer section.one and b/crates/import/tests/fixtures/synthetic/groups/Outer/Outer section.one differ diff --git a/crates/import/tests/fixtures/synthetic/issue-416-shape.one b/crates/import/tests/fixtures/synthetic/issue-416-shape.one index 7b0eb4111..c94ece98f 100644 Binary files a/crates/import/tests/fixtures/synthetic/issue-416-shape.one and b/crates/import/tests/fixtures/synthetic/issue-416-shape.one differ diff --git a/crates/import/tests/fixtures/synthetic/nested-levels.one b/crates/import/tests/fixtures/synthetic/nested-levels.one index ed53daa5f..f75edea07 100644 Binary files a/crates/import/tests/fixtures/synthetic/nested-levels.one and b/crates/import/tests/fixtures/synthetic/nested-levels.one differ diff --git a/crates/import/tests/fixtures/synthetic/page-hierarchy.one b/crates/import/tests/fixtures/synthetic/page-hierarchy.one index 016462596..72c9d9dc5 100644 Binary files a/crates/import/tests/fixtures/synthetic/page-hierarchy.one and b/crates/import/tests/fixtures/synthetic/page-hierarchy.one differ diff --git a/crates/import/tests/fixtures/synthetic/rich-content.one b/crates/import/tests/fixtures/synthetic/rich-content.one index 245e8c25f..bed51bb00 100644 Binary files a/crates/import/tests/fixtures/synthetic/rich-content.one and b/crates/import/tests/fixtures/synthetic/rich-content.one differ diff --git a/crates/import/tests/fixtures/synthetic/versions (On 1-2-2025).one b/crates/import/tests/fixtures/synthetic/versions (On 1-2-2025).one index a16965870..6fb3ebd3f 100644 Binary files a/crates/import/tests/fixtures/synthetic/versions (On 1-2-2025).one and b/crates/import/tests/fixtures/synthetic/versions (On 1-2-2025).one differ diff --git a/crates/import/tests/fixtures/synthetic/versions (On 1-2-2026).one b/crates/import/tests/fixtures/synthetic/versions (On 1-2-2026).one index 85a8ce6aa..65ef17433 100644 Binary files a/crates/import/tests/fixtures/synthetic/versions (On 1-2-2026).one and b/crates/import/tests/fixtures/synthetic/versions (On 1-2-2026).one differ diff --git a/crates/import/tests/synthetic_corpus.rs b/crates/import/tests/synthetic_corpus.rs index 8a59a0c15..b1b2c1ea3 100644 --- a/crates/import/tests/synthetic_corpus.rs +++ b/crates/import/tests/synthetic_corpus.rs @@ -7,6 +7,8 @@ use notecraft_model::PageFormat; use notecraft_onenote::testing::OneNote; use notecraft_store::testing::TempDir; use notecraft_store::tree::{child_dirs, read_node}; +use onenote_parser::Parser; +use typed_path::TypedPath; #[path = "support/synthetic_corpus.rs"] mod synthetic_corpus; @@ -103,6 +105,18 @@ fn package_import_keeps_current_text_links_and_images_in_both_formats() { } } +#[test] +fn revision_history_section_has_the_metadata_root_required_by_onenote_parser() { + let temp = TempDir::new("revision-history-parser"); + let mut source = OneNote::new().with_page_history(); + source.page("Current", 1, &[OneNote::line("current revision")]); + let path = temp.path().join("revision-history.one"); + fs::write(&path, source.finish()).expect("write revision-history section"); + + let text = path.to_string_lossy(); + Parser::new().parse_section(TypedPath::derive(text.as_bytes())).expect("the generated section has the required metadata root"); +} + const SIDECAR_NAME: &str = "9f6cfb04-7ceb-4995-872d-6b7585b4bd3e.onebin"; const PIXEL: &[u8] = include_bytes!("fixtures/synthetic-pixel.png"); diff --git a/crates/import/tests/synthetic_notebook_media.rs b/crates/import/tests/synthetic_notebook_media.rs new file mode 100644 index 000000000..89104f69b --- /dev/null +++ b/crates/import/tests/synthetic_notebook_media.rs @@ -0,0 +1,111 @@ +//! Synthetic notebook tests covering each embedded image (`png`, `gif`, `tiff`, `svg`) +//! and file attachment (`docx`, `pdf`, `pptx`, `xlsx`, `csv`, `rtf`) in its own test, +//! in both page formats. + +use std::fs; +use std::path::{Path, PathBuf}; + +use notecraft_import::{Options, run}; +use notecraft_model::PageFormat; +use notecraft_onenote::testing::OneNote; +use notecraft_store::testing::TempDir; + +fn quiet(_: ¬ecraft_import::Event<'_>) {} + +fn page_folders(root: &Path, out: &mut Vec) { + for entry in fs::read_dir(root).expect("dir").flatten() { + let path = entry.path(); + if !path.is_dir() || path.file_name().is_some_and(|n| n == ".notecraft") { + continue; + } + if path.join("index.md").exists() || path.join("index.html").exists() { + out.push(path.clone()); + } + page_folders(&path, out); + } +} + +fn assert_single_asset_imports(is_picture: bool, name: &str, ext: &str, expected: &[u8]) { + let attachment = if is_picture { OneNote::picture(name, name, ext, expected) } else { OneNote::file(name, ext, expected) }; + let mut section = OneNote::new(); + section.page_with_attachments(name, 1, &[OneNote::line(name)], &[attachment]); + + let src = TempDir::new("synthetic-media-src"); + let one_path = src.path().join(format!("{name}.one")); + fs::write(&one_path, section.finish()).expect("write synthetic .one"); + + for format in [PageFormat::Html, PageFormat::Cmgfm] { + let temp = TempDir::new("synthetic-media-dest"); + let dest = temp.path().join("notebooks"); + let options = Options { format, ..Options::new(&one_path, &dest) }; + let report = run(&options, &mut quiet).expect("import synthetic section"); + assert_eq!(report.pages, 1, "{name} {format:?}"); + assert_eq!(report.images, usize::from(is_picture), "{name} {format:?}"); + assert_eq!(report.files, usize::from(!is_picture), "{name} {format:?}"); + + let mut pages = Vec::new(); + page_folders(&dest, &mut pages); + assert_eq!(pages.len(), 1, "{name} {format:?}"); + + let matched = fs::read_dir(pages[0].join("assets")) + .expect("assets dir") + .flatten() + .any(|e| e.file_name().to_string_lossy().ends_with(ext) && fs::read(e.path()).expect("asset").as_slice() == expected); + assert!(matched, "{name} ({ext}) missing or altered in {format:?}"); + } +} + +#[test] +fn imports_embedded_png() { + assert_single_asset_imports(true, "sample.png", ".png", include_bytes!("fixtures/synthetic-pixel.png")); +} + +#[test] +fn imports_embedded_gif() { + assert_single_asset_imports( + true, + "sample.gif", + ".gif", + b"GIF89a\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\xff\xff\xff!\xf9\x04\x01\x00\x00\x00\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02D\x01\x00;", + ); +} + +#[test] +fn imports_embedded_tiff() { + assert_single_asset_imports(true, "sample.tiff", ".tiff", b"II*\x00\x08\x00\x00\x00\x00\x00"); +} + +#[test] +fn imports_embedded_svg() { + assert_single_asset_imports(true, "sample.svg", ".svg", b""); +} + +#[test] +fn imports_attachment_docx() { + assert_single_asset_imports(false, "doc.docx", ".docx", b"PK\x03\x04synthetic-docx"); +} + +#[test] +fn imports_attachment_pdf() { + assert_single_asset_imports(false, "doc.pdf", ".pdf", b"%PDF-1.4\n1 0 obj<<>>endobj\ntrailer<<>>\n%%EOF\n"); +} + +#[test] +fn imports_attachment_pptx() { + assert_single_asset_imports(false, "deck.pptx", ".pptx", b"PK\x03\x04synthetic-pptx"); +} + +#[test] +fn imports_attachment_xlsx() { + assert_single_asset_imports(false, "sheet.xlsx", ".xlsx", b"PK\x03\x04synthetic-xlsx"); +} + +#[test] +fn imports_attachment_csv() { + assert_single_asset_imports(false, "data.csv", ".csv", b"col1,col2\n1,2\n"); +} + +#[test] +fn imports_attachment_rtf() { + assert_single_asset_imports(false, "note.rtf", ".rtf", b"{\\rtf1\\ansi synthetic rtf}"); +} diff --git a/crates/onenote/src/store.rs b/crates/onenote/src/store.rs index 2ffd46a6f..57d4d9c59 100644 --- a/crates/onenote/src/store.rs +++ b/crates/onenote/src/store.rs @@ -725,6 +725,17 @@ pub mod build { use super::*; use crate::props::tests_support::Build; + fn onestore_crc32(bytes: &[u8]) -> u32 { + let mut crc = u32::MAX; + for byte in bytes { + crc ^= u32::from(*byte); + for _ in 0..8 { + crc = (crc >> 1) ^ (0xEDB8_8320 & 0u32.wrapping_sub(crc & 1)); + } + } + !crc + } + /// The JCID flag that says an object holds a property set ([MS-ONESTORE] 2.6.14). pub const JCID_PROP_SET: u32 = 0x0002_0000; // IsPropertySet @@ -934,7 +945,7 @@ pub mod build { /// A page whose current revision inherits its content and removes the first outline /// element. The last revision in the file is a snapshot from before the removal. - fn page_with_history(&mut self, gosid: u8, base: ChunkRef, root_oid: u32, outline_oid: u32, elements: &[u32]) -> ChunkRef { + fn page_with_history(&mut self, gosid: u8, base: ChunkRef, root_oid: u32, metadata_oid: u32, outline_oid: u32, elements: &[u32]) -> ChunkRef { let start = |id, dependency: Option, role: u32, context: Option| { let mut data = Self::egid(id); data.extend(dependency.map_or_else(|| vec![0; 20], Self::egid)); @@ -945,9 +956,12 @@ pub mod build { } Self::node(if context.is_some() { 0x01F } else { 0x01E }, 0, None, &data) }; - let mut root = Self::guid(root_oid >> 8).0.to_vec(); - root.extend((root_oid & 0xFF).to_le_bytes()); - root.extend(1u32.to_le_bytes()); + let root = |oid: u32, role: u32| { + let mut data = Self::guid(oid >> 8).0.to_vec(); + data.extend((oid & 0xFF).to_le_bytes()); + data.extend(role.to_le_bytes()); + Self::node(0x05A, 0, None, &data) + }; let (removed, kept) = elements.split_at(elements.len().min(1)); let mut outline_group = |children: &[u32]| { @@ -970,7 +984,8 @@ pub mod build { Self::node(0x014, 0, None, &Self::revision_list_start(gosid)), start(0x90, None, 1, None), Self::node(0x0B0, 2, Some(base), &Self::egid(9)), - Self::node(0x05A, 0, None, &root), + root(root_oid, 1), + root(metadata_oid, 2), Self::node(0x01C, 0, None, &[]), start(0x91, Some(0x90), 4, None), Self::node(0x0B0, 2, Some(current), &Self::egid(10)), @@ -1015,8 +1030,9 @@ pub mod build { log.extend_from_slice(&id.to_le_bytes()); log.extend_from_slice(&count.to_le_bytes()); } + let checksum = onestore_crc32(&log); log.extend_from_slice(&1u32.to_le_bytes()); - log.extend_from_slice(&0u32.to_le_bytes()); + log.extend_from_slice(&checksum.to_le_bytes()); log.extend_from_slice(&[0xFF; 8]); // nextFragment: nil log.extend_from_slice(&0u32.to_le_bytes()); let log_ref = self.put(&log); @@ -1456,8 +1472,15 @@ pub mod build { let group = one.group_with_files(&decls, &file_decls, &[]); one.space_from_group(gosid, group, &[(manifest_oid, 1), (meta_oid, 2)], false) } else if self.page_history { + let meta_oid = ((0x8000 + gosid as u32) << 8) | 1; + let mut meta = Build::default(); + meta.text(P_CACHED_TITLE, title); + meta.u32(P_PAGE_LEVEL, u32::from(*level)); + meta.u64(P_CREATED, SYNTHETIC_TIME); + meta.data(0x1C00_1C30, &One::guid(u32::from(gosid)).0); + decls.push(Decl { oid: meta_oid, jcid: J_PAGE_META, props: meta.finish() }); let base = one.group_with_files(&decls, &file_decls, &[]); - one.page_with_history(gosid, base, manifest_oid, outline_oid, &element_oids) + one.page_with_history(gosid, base, manifest_oid, meta_oid, outline_oid, &element_oids) } else { // Every page space has its own metadata root (role 2), as OneNote writes one. let meta_oid = ((0x8000 + gosid as u32) << 8) | 1; // far from the line ids @@ -1501,7 +1524,8 @@ pub mod build { // The page spaces are named by compact id, so their identities join the table. let extra: Vec = (0..self.pages.len()).map(|i| (10 + i) as u32).collect(); // Every section has a metadata root (role 2), as OneNote writes one; the colour is optional. - let metadata_oid = 0x0000_0301; + // Keep the section metadata root outside the page metadata identity range. + let metadata_oid = ((3 + self.pages.len()) as u32) << 8 | 1; let mut metadata = Build::default(); // SchemaRevisionInOrderToRead and ...ToWrite ([MS-ONE] 2.2.x): required on a section. metadata.u32(0x1400_1D82, 1); @@ -1509,16 +1533,8 @@ pub mod build { if let Some(color) = self.color { metadata.u32(crate::toc::NOTEBOOK_COLOR_COMPATIBILITY_ID, color); } - if !self.page_history { - decls.push(Decl { oid: metadata_oid, jcid: JCID_PROP_SET | 0x0031, props: metadata.finish() }); - } - // The revision-history case keeps the layout NoteCraft's own tests were written against: - // it has no section metadata root. Every other section has one, as OneNote writes it. - let section_list = if self.page_history { - one.space_ids(1, &decls, section_oid, &extra) - } else { - one.space_with_metadata(1, &decls, section_oid, metadata_oid, &extra) - }; + decls.push(Decl { oid: metadata_oid, jcid: JCID_PROP_SET | 0x0031, props: metadata.finish() }); + let section_list = one.space_with_metadata(1, &decls, section_oid, metadata_oid, &extra); spaces.insert(0, (1, section_list)); one.finish(&spaces, 1, file_data) } @@ -1645,6 +1661,33 @@ mod tests { assert_eq!(h.expected_length, data.len() as u64, "the header's length matches the file"); } + fn onestore_crc32(bytes: &[u8]) -> u32 { + let mut crc = u32::MAX; + for byte in bytes { + crc ^= u32::from(*byte); + for _ in 0..8 { + crc = (crc >> 1) ^ (0xEDB8_8320 & 0u32.wrapping_sub(crc & 1)); + } + } + !crc + } + + #[test] + fn transaction_log_sentinel_checksums_the_prior_entries() { + assert_eq!(onestore_crc32(b"123456789"), 0xCBF4_3926); + + let data = simple(); + let header = read_header(&data).expect("header"); + let log = slice(&data, header.transaction_log.stp, header.transaction_log.cb, "test transaction log").expect("log"); + let entries_end = log.len() - 12; + let sentinel_start = entries_end - 8; + assert_eq!(u32::from_le_bytes(log[sentinel_start..sentinel_start + 4].try_into().expect("sentinel srcID")), 1); + + let expected = onestore_crc32(&log[..sentinel_start]); + let actual = u32::from_le_bytes(log[sentinel_start + 4..entries_end].try_into().expect("sentinel checksum")); + assert_eq!(actual, expected, "the sentinel stores the CRC of earlier transaction entries"); + } + #[test] fn a_table_of_contents_file_is_named_as_such() { let mut data = simple(); diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 8c6971d1b..45edaf359 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -7651,9 +7651,8 @@ impl NoteCraftApp { } /// Imports a OneNote notebook folder, section, table of contents or package as a new - /// notebook (issue #19). NoteCraft's own reader brings the pages over, and a section it - /// cannot read goes to the OfficeIMO bridge when one is installed; any other file goes to - /// the bridge as before. Runs on a thread, so the window stays usable. + /// notebook (issue #19). NoteCraft's native reader brings the pages over and reports + /// sections it cannot read with a recovery step. Runs on a thread, so the window stays usable. fn import_onenote_source(&mut self, source: PathBuf) { let format = self .session @@ -7673,9 +7672,9 @@ impl NoteCraftApp { std::thread::spawn(move || { let mut progress = |event| { let message = match event { - notecraft_import::officeimo::Progress::Found { total } => ImportMessage::Found(total), - notecraft_import::officeimo::Progress::Destination { path } => ImportMessage::Destination(path), - notecraft_import::officeimo::Progress::Section { index, total, label } => { + notecraft_import::notebook::Progress::Found { total } => ImportMessage::Found(total), + notecraft_import::notebook::Progress::Destination { path } => ImportMessage::Destination(path), + notecraft_import::notebook::Progress::Section { index, total, label } => { ImportMessage::Section { index, total, label: label.to_string() } } }; diff --git a/crates/ui-egui/src/backstage.rs b/crates/ui-egui/src/backstage.rs index 24beeb0ac..847fea05a 100644 --- a/crates/ui-egui/src/backstage.rs +++ b/crates/ui-egui/src/backstage.rs @@ -70,9 +70,9 @@ pub enum Act { OpenNotebooksFolder, /// Ask the system for a folder, and work from the notebooks in it. ChooseFolder, - /// Choose a OneNote notebook folder and pass it to the OfficeIMO bridge. + /// Choose a OneNote notebook folder for the native importer. ImportNotebookFolder, - /// Choose one importable file and pass it to the OfficeIMO bridge. + /// Choose one file for the native OneNote importer. ImportFile, /// Cloud import is intentionally visible but unavailable. ImportCloud, @@ -740,15 +740,6 @@ fn about_page( ui.hyperlink_to(crate::tl_id!("ui.egui_and_eframe"), "https://github.com/emilk/egui"); ui.label(egui::RichText::new(crate::tl_id!("ui.the_window_drawn_on_the_gpu_the_icons_are_drawn_in_c_27f197a70f")).size(11.5).color(t.muted)); ui.add_space(14.0); - ui.label(egui::RichText::new(crate::tl_id!("ui.onenote_import")).size(14.0).color(t.strong)); - ui.horizontal_wrapped(|ui| { - ui.label(egui::RichText::new(crate::tl_id!("ui.powered_by")).size(11.5).color(t.muted)); - ui.hyperlink_to(crate::tl_id!("ui.officeimo"), "https://github.com/EvotecIT/OfficeIMO"); - ui.label(egui::RichText::new(crate::tl_id!("ui.under_the")).size(11.5).color(t.muted)); - ui.hyperlink_to(crate::tl_id!("ui.mit_license"), "https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE"); - ui.label(egui::RichText::new(crate::tl_id!("ui.many_thanks_to_its_authors_and_contributors")).size(11.5).color(t.muted)); - }); - ui.add_space(14.0); ui.label(egui::RichText::new(crate::tl_id!("ui.local_diagnostics")).strong().size(14.0).color(t.strong)); ui.label(egui::RichText::new(crate::tl_id!("ui.logs_and_telemetry_stay_on_this_device_notecraft_doe_87b8387dee")).size(11.5).color(t.muted)); if let Some(id) = session_id { diff --git a/crates/ui-egui/src/customtags.rs b/crates/ui-egui/src/customtags.rs index bfa23c7f8..57ff015c7 100644 --- a/crates/ui-egui/src/customtags.rs +++ b/crates/ui-egui/src/customtags.rs @@ -1,21 +1,57 @@ //! Home > More tags > Customize Tags (issue #259): the dialog where a person makes tags of their //! own, each with a name, a symbol and a colour, puts them in order and removes them. //! -//! Every change is kept at once; the dialog has no Save button to forget. What a rename or a -//! removal does to the lines that carry a tag is decided in the model -//! ([`notecraft_model::tag`]): a rename keeps the tag on every line, a removal leaves the -//! marker word as ordinary words. +//! Includes three modal dialogs: +//! - **Customize Tags**: selectable tag list, Up/Down/Delete, New Tag..., Modify Tag..., OK/Cancel. +//! - **New Tag**: Display name, Symbol popup, Font Color popup, Highlight Color popup, Preview, OK/Cancel. +//! - **Modify Tag**: same fields pre-populated for the selected tag. use crate::theme::Tokens; use egui::{Align2, Context, Sense, Ui, vec2}; use notecraft_model::tag::SYMBOLS; use notecraft_model::{CustomTag, NodeColor}; -/// The dialog while it is open: the tags as they stand and the name being typed for a new one. +/// Sub-dialog state for New Tag / Modify Tag. +#[derive(Clone, Debug)] +pub enum SubDialog { + New(TagEditor), + Modify(usize, TagEditor), +} + +/// Editable fields for a tag in New Tag / Modify Tag. +#[derive(Clone, Debug)] +pub struct TagEditor { + pub name: String, + pub symbol: String, + pub color: NodeColor, + pub highlight: Option, +} + +impl Default for TagEditor { + fn default() -> Self { + Self { name: String::new(), symbol: SYMBOLS.first().copied().unwrap_or("★").to_string(), color: NodeColor::ALL[0], highlight: None } + } +} + +impl TagEditor { + fn from_tag(tag: &CustomTag) -> Self { + Self { name: tag.name.clone(), symbol: tag.symbol.clone(), color: tag.color, highlight: None } + } +} + +/// Which row is selected in Customize Tags. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Selected { + BuiltIn(usize), + Custom(usize), +} + +/// The dialog while it is open: the tags as they stand, selection, and optional sub-dialog. #[derive(Clone, Debug, Default)] pub struct Dialog { pub list: Vec, - pub new_name: String, + pub selected: Option, + pub sub: Option, } /// What a frame of the dialog did. @@ -31,147 +67,311 @@ pub struct Outcome { impl Dialog { pub fn new(list: Vec) -> Dialog { - Dialog { list, new_name: String::new() } + let selected = if list.is_empty() { Some(Selected::BuiltIn(0)) } else { Some(Selected::Custom(0)) }; + Dialog { list, selected, sub: None } } pub fn show(&mut self, ctx: &Context, t: &Tokens) -> Outcome { let mut out = Outcome::default(); let mut open = true; - let before = self.list.clone(); + let sub_open = self.sub.is_some(); + + const BUILT_IN_TAGS: &[(&str, &str)] = &[ + ("✅", "To Do (Ctrl+1)"), + ("⭐", "Important (Ctrl+2)"), + ("❓", "Question (Ctrl+3)"), + ("🟨", "Remember for later (Ctrl+4)"), + ("🟩", "Definition (Ctrl+5)"), + ("🖍️", "Highlight (Ctrl+6)"), + ("👤", "Contact (Ctrl+7)"), + ("🏠", "Address (Ctrl+8)"), + ("📞", "Phone number (Ctrl+9)"), + ("🔗", "Web site to visit"), + ("💡", "Idea"), + ("❗", "Critical"), + ]; + egui::Window::new(crate::tl_id!("ui.customize_tags_title")) + .frame(egui::Frame::window(&ctx.global_style()).fill(t.panel)) .collapsible(false) .resizable(false) - .fixed_size(vec2(540.0, 0.0)) .open(&mut open) + .enabled(!sub_open) .anchor(Align2::CENTER_CENTER, vec2(0.0, 0.0)) .show(ctx, |ui| { - // A fixed width: rows coming and going must not move the buttons under the pointer. - ui.set_width(540.0); - if self.list.is_empty() { - ui.weak(crate::tl_id!("ui.custom_tags_none_yet")); - } - let mut action: Option<(usize, Change)> = None; - let count = self.list.len(); - for (i, tag) in self.list.iter_mut().enumerate() { - if let Some(change) = row(ui, i, count, tag, t) { - action = Some((i, change)); - } - } - if let Some((i, change)) = action { - match change { - Change::Up if i > 0 => self.list.swap(i, i - 1), - Change::Down if i + 1 < self.list.len() => self.list.swap(i, i + 1), - Change::Remove => { + ui.set_width(420.0); + ui.horizontal_top(|ui| { + // Left: selectable tag list (built-in + custom) + egui::Frame::NONE.stroke(egui::Stroke::new(1.0, t.faint)).inner_margin(4.0).show(ui, |ui| { + ui.set_width(370.0); + ui.set_min_height(220.0); + egui::ScrollArea::vertical().max_height(240.0).show(ui, |ui| { + ui.vertical(|ui| { + for (bi, (sym, label)) in BUILT_IN_TAGS.iter().enumerate() { + let is_sel = self.selected == Some(Selected::BuiltIn(bi)); + if ui.selectable_label(is_sel, format!("{sym} {label}")).clicked() { + self.selected = Some(Selected::BuiltIn(bi)); + } + } + for (i, tag) in self.list.iter().enumerate() { + let is_sel = self.selected == Some(Selected::Custom(i)); + let resp = ui.selectable_label(is_sel, format!("{} {}", tag.symbol, tag.name)); + if resp.clicked() { + self.selected = Some(Selected::Custom(i)); + } + } + }); + }); + }); + + // Right: Up / Down / Remove buttons (for custom tags) + ui.vertical(|ui| { + let sel = match self.selected { + Some(Selected::Custom(i)) if i < self.list.len() => Some(i), + _ => None, + }; + let can_up = sel.is_some_and(|i| i > 0); + let can_down = sel.is_some_and(|i| i + 1 < self.list.len()); + let can_remove = sel.is_some(); + + // i18n-exempt: directional glyph for the reorder control. + if ui.add_enabled(can_up, egui::Button::new("↑")).clicked() + && let Some(i) = sel + { + self.list.swap(i, i - 1); + self.selected = Some(Selected::Custom(i - 1)); + } + // i18n-exempt: directional glyph for the reorder control. + if ui.add_enabled(can_down, egui::Button::new("↓")).clicked() + && let Some(i) = sel + { + self.list.swap(i, i + 1); + self.selected = Some(Selected::Custom(i + 1)); + } + let remove_label = + sel.and_then(|i| self.list.get(i)).map(|tag| format!("Remove {}", tag.name)).unwrap_or_else(|| "Remove tag".to_string()); + // i18n-exempt: icon glyph; the accessible name is assigned below. + let remove = ui.add_enabled(can_remove, egui::Button::new("×")); + remove.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, can_remove, remove_label.clone())); + if remove.clicked() + && let Some(i) = sel + { let gone = self.list.remove(i); out.said = Some(crate::i18n::format_message_id("ui.tag_name_removed", &[("name", &gone.name)])); + self.selected = + if self.list.is_empty() { Some(Selected::BuiltIn(0)) } else { Some(Selected::Custom(i.min(self.list.len() - 1))) }; } - _ => {} - } - } - ui.separator(); + }); + }); + + ui.add_space(6.0); ui.horizontal(|ui| { - let label = ui.label(crate::tl_id!("ui.new_tag_name")); - let edit = ui.add(egui::TextEdit::singleline(&mut self.new_name).desired_width(200.0)).labelled_by(label.id); - let typed = !self.new_name.trim().is_empty(); - let enter = edit.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)); - if (ui.add_enabled(typed, egui::Button::new(crate::tl_id!("ui.add_tag"))).clicked() || enter) && typed { - let tag = CustomTag::named(&self.new_name, &self.list); - out.said = Some(crate::i18n::format_message_id("ui.tag_name_added", &[("name", &tag.name)])); - self.list.push(tag); - self.new_name.clear(); + // i18n-exempt: temporary English labels pending catalog entries for this new dialog. + if ui.button("New Tag...").clicked() { + self.sub = Some(SubDialog::New(TagEditor::default())); + } + let can_modify = match self.selected { + Some(Selected::BuiltIn(bi)) => bi < BUILT_IN_TAGS.len(), + Some(Selected::Custom(i)) => i < self.list.len(), + None => false, + }; + // i18n-exempt: temporary English labels pending catalog entries for this new dialog. + if ui.add_enabled(can_modify, egui::Button::new("Modify Tag...")).clicked() { + match self.selected { + Some(Selected::Custom(i)) if i < self.list.len() => { + self.sub = Some(SubDialog::Modify(i, TagEditor::from_tag(&self.list[i]))); + } + Some(Selected::BuiltIn(bi)) if bi < BUILT_IN_TAGS.len() => { + let (sym, label) = BUILT_IN_TAGS[bi]; + self.sub = Some(SubDialog::New(TagEditor { + name: label.to_string(), + symbol: sym.to_string(), + color: NodeColor::ALL[0], + highlight: None, + })); + } + _ => {} + } } }); - ui.add_space(4.0); - ui.label(egui::RichText::new(crate::tl_id!("ui.custom_tags_explained")).color(t.muted).size(11.5)); - ui.add_space(4.0); + + ui.separator(); ui.allocate_ui_with_layout(vec2(ui.available_width(), 24.0), egui::Layout::right_to_left(egui::Align::Center), |ui| { if ui.button(crate::tl_id!("ui.close")).clicked() { out.closed = true; } + // i18n-exempt: temporary English labels pending catalog entries for this new dialog. + if ui.button("OK").clicked() { + let keep: Vec = self + .list + .iter() + .map(|c| if c.name.trim().is_empty() { CustomTag { name: c.id.clone(), ..c.clone() } } else { c.clone() }) + .collect(); + out.changed = Some(keep); + out.closed = true; + } }); }); + if !open { out.closed = true; } - if self.list != before { - // A name cleared while it is being retyped is kept as the marker word meanwhile, so - // the tag never drops off the lines that carry it. - let keep: Vec = - self.list.iter().map(|c| if c.name.trim().is_empty() { CustomTag { name: c.id.clone(), ..c.clone() } } else { c.clone() }).collect(); - out.changed = Some(keep); - } - out - } -} -enum Change { - Up, - Down, - Remove, -} + if let Some(mut sub) = self.sub.take() { + let mut keep_sub = true; + let (title, editor, edit_idx) = match &mut sub { + SubDialog::New(ed) => ("New Tag", ed, None), + SubDialog::Modify(idx, ed) => ("Modify Tag", ed, Some(*idx)), + }; + let mut sub_win_open = true; + egui::Window::new(title) + .frame(egui::Frame::window(&ctx.global_style()).fill(t.panel)) + .collapsible(false) + .resizable(false) + .fixed_size(vec2(340.0, 0.0)) + .open(&mut sub_win_open) + .anchor(Align2::CENTER_CENTER, vec2(20.0, 20.0)) + .show(ctx, |ui| { + // i18n-exempt: temporary English labels pending catalog entries for this new dialog. + let name_label = ui.label("Display name:"); + ui.add(egui::TextEdit::singleline(&mut editor.name).desired_width(f32::INFINITY)).labelled_by(name_label.id); + ui.add_space(6.0); -/// One tag: its symbol and colour, its name, and the buttons that move and remove it. -fn row(ui: &mut Ui, i: usize, count: usize, tag: &mut CustomTag, t: &Tokens) -> Option { - let mut change = None; - ui.horizontal(|ui| { - let name = tag.name.clone(); - // The symbol, drawn as the page draws it, with the list of symbols under it. - let symbol_label = crate::i18n::format_message_id("ui.tag_symbol_for_name", &[("name", &name)]); - let resp = picker(ui, 40.0, &symbol_label, t, |painter, rect| { - crate::ribbon::paint_symbol( - painter, - egui::Rect::from_center_size(rect.center() - vec2(5.0, 0.0), vec2(18.0, 18.0)), - &tag.symbol, - tag.color, - ) - }); - egui::Popup::menu(&resp).show(|ui| { - egui::Grid::new(("custom-tag-symbols", i)).spacing(vec2(2.0, 2.0)).show(ui, |ui| { - for (n, s) in SYMBOLS.iter().enumerate() { - if ui.selectable_label(tag.symbol == *s, egui::RichText::new(*s).size(16.0)).clicked() { - tag.symbol = s.to_string(); - } - if n % 8 == 7 { - ui.end_row(); - } - } - }); - }); - let colour_label = crate::i18n::format_message_id("ui.tag_colour_for_name", &[("name", &name)]); - let colour_name = crate::tl!(tag.color.label()).to_string(); - let resp = picker(ui, 96.0, &colour_label, t, |painter, rect| { - let swatch = egui::Rect::from_min_size(rect.left_center() + vec2(6.0, -6.0), vec2(12.0, 12.0)); - painter.rect_filled(swatch, 2.0, colour_of(painter.ctx(), tag.color)); - painter.text(swatch.right_center() + vec2(6.0, 0.0), Align2::LEFT_CENTER, &colour_name, egui::FontId::proportional(12.5), t.text); - }); - egui::Popup::menu(&resp).show(|ui| { - for c in NodeColor::ALL { - ui.horizontal(|ui| { - let (rect, _) = ui.allocate_exact_size(vec2(12.0, 12.0), Sense::hover()); - ui.painter().rect_filled(rect, 2.0, colour_of(ui.ctx(), c)); - ui.selectable_value(&mut tag.color, c, crate::tl!(c.label())); + ui.horizontal(|ui| { + // Symbol popup button + ui.vertical(|ui| { + // i18n-exempt: temporary English labels pending catalog entries for this new dialog. + ui.label("Symbol:"); + let resp = picker(ui, 64.0, "Symbol", t, |painter, rect| { + crate::ribbon::paint_symbol( + painter, + egui::Rect::from_center_size(rect.center() - vec2(5.0, 0.0), vec2(18.0, 18.0)), + &editor.symbol, + editor.color, + ); + }); + egui::Popup::menu(&resp).show(|ui| { + egui::Grid::new("tag-editor-symbols").spacing(vec2(2.0, 2.0)).show(ui, |ui| { + for (n, s) in SYMBOLS.iter().enumerate() { + if ui.selectable_label(editor.symbol == *s, egui::RichText::new(*s).size(16.0)).clicked() { + editor.symbol = s.to_string(); + } + if n % 8 == 7 { + ui.end_row(); + } + } + }); + }); + }); + + // Font Color popup button + ui.vertical(|ui| { + // i18n-exempt: temporary English labels pending catalog entries for this new dialog. + ui.label("Font Color:"); + let colour_name = crate::tl!(editor.color.label()).to_string(); + let resp = picker(ui, 108.0, "Font Color", t, |painter, rect| { + let swatch = egui::Rect::from_min_size(rect.left_center() + vec2(6.0, -6.0), vec2(12.0, 12.0)); + painter.rect_filled(swatch, 2.0, colour_of(painter.ctx(), editor.color)); + painter.text( + swatch.right_center() + vec2(6.0, 0.0), + Align2::LEFT_CENTER, + &colour_name, + egui::FontId::proportional(12.0), + t.text, + ); + }); + egui::Popup::menu(&resp).show(|ui| { + for c in NodeColor::ALL { + ui.horizontal(|ui| { + let (rect, _) = ui.allocate_exact_size(vec2(12.0, 12.0), Sense::hover()); + ui.painter().rect_filled(rect, 2.0, colour_of(ui.ctx(), c)); + ui.selectable_value(&mut editor.color, c, crate::tl!(c.label())); + }); + } + }); + }); + + // Highlight Color popup button + ui.vertical(|ui| { + // i18n-exempt: temporary English labels pending catalog entries for this new dialog. + ui.label("Highlight Color:"); + let hl_name = editor.highlight.map_or_else(|| "None".to_string(), |c| crate::tl!(c.label()).to_string()); + let resp = picker(ui, 108.0, "Highlight Color", t, |painter, rect| { + let swatch = egui::Rect::from_min_size(rect.left_center() + vec2(6.0, -6.0), vec2(12.0, 12.0)); + if let Some(hl) = editor.highlight { + painter.rect_filled(swatch, 2.0, colour_of(painter.ctx(), hl)); + } else { + painter.rect_stroke(swatch, 2.0, egui::Stroke::new(1.0, t.faint), egui::StrokeKind::Inside); + } + painter.text( + swatch.right_center() + vec2(6.0, 0.0), + Align2::LEFT_CENTER, + &hl_name, + egui::FontId::proportional(12.0), + t.text, + ); + }); + egui::Popup::menu(&resp).show(|ui| { + ui.selectable_value(&mut editor.highlight, None, "None"); + for c in NodeColor::ALL { + ui.horizontal(|ui| { + let (rect, _) = ui.allocate_exact_size(vec2(12.0, 12.0), Sense::hover()); + ui.painter().rect_filled(rect, 2.0, colour_of(ui.ctx(), c)); + ui.selectable_value(&mut editor.highlight, Some(c), crate::tl!(c.label())); + }); + } + }); + }); + }); + + ui.add_space(6.0); + // i18n-exempt: temporary English labels pending catalog entries for this new dialog. + ui.label("Preview:"); + egui::Frame::group(ui.style()).show(ui, |ui| { + ui.set_width(ui.available_width()); + let preview_name = if editor.name.trim().is_empty() { "Undefined" } else { editor.name.trim() }; + let mut text = egui::RichText::new(format!("{} {}", editor.symbol, preview_name)).color(colour_of(ui.ctx(), editor.color)); + if let Some(hl) = editor.highlight { + text = text.background_color(colour_of(ui.ctx(), hl)); + } + ui.label(text); + }); + + ui.add_space(6.0); + ui.allocate_ui_with_layout(vec2(ui.available_width(), 24.0), egui::Layout::right_to_left(egui::Align::Center), |ui| { + // i18n-exempt: temporary English labels pending catalog entries for this new dialog. + if ui.button("Cancel").clicked() { + keep_sub = false; + } + let valid = !editor.name.trim().is_empty(); + // i18n-exempt: temporary English labels pending catalog entries for this new dialog. + if ui.add_enabled(valid, egui::Button::new("OK")).clicked() { + if let Some(idx) = edit_idx { + if let Some(tag) = self.list.get_mut(idx) { + tag.name = editor.name.trim().to_string(); + tag.symbol = editor.symbol.clone(); + tag.color = editor.color; + } + } else { + let mut tag = CustomTag::named(&editor.name, &self.list); + tag.symbol = editor.symbol.clone(); + tag.color = editor.color; + out.said = Some(crate::i18n::format_message_id("ui.tag_name_added", &[("name", &tag.name)])); + self.list.push(tag); + self.selected = Some(Selected::Custom(self.list.len() - 1)); + } + keep_sub = false; + } + }); }); + + if sub_win_open && keep_sub { + self.sub = Some(sub); } - }); - let label = ui.label(egui::RichText::new(crate::tl_id!("ui.tag_name")).color(t.muted).size(11.5)); - ui.add(egui::TextEdit::singleline(&mut tag.name).desired_width(140.0)).labelled_by(label.id); - ui.weak(format!("#{}", tag.id)).on_hover_text(crate::tl_id!("ui.the_word_written_in_the_page")); - let small = |ui: &mut Ui, enabled: bool, glyph: &str, label: String| { - let resp = ui.add_enabled(enabled, egui::Button::new(glyph)).on_hover_text(&label); - resp.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, enabled, &label)); - resp.clicked() - }; - if small(ui, i > 0, "↑", crate::i18n::format_message_id("ui.move_name_up", &[("name", &name)])) { - change = Some(Change::Up); } - if small(ui, i + 1 < count, "↓", crate::i18n::format_message_id("ui.move_name_down", &[("name", &name)])) { - change = Some(Change::Down); - } - if small(ui, true, "×", crate::i18n::format_message_id("ui.remove_name", &[("name", &name)])) { - change = Some(Change::Remove); - } - }); - change + + out + } } fn colour_of(ctx: &Context, c: NodeColor) -> egui::Color32 { @@ -196,6 +396,8 @@ fn picker(ui: &mut Ui, width: f32, label: &str, t: &Tokens, paint: impl FnOnce(& #[cfg(test)] mod tests { + use super::*; + /// Every symbol a custom tag can take draws in the app's own fonts, not as an empty box. #[test] fn every_tag_symbol_draws() { @@ -207,4 +409,26 @@ mod tests { assert!(ctx.fonts_mut(|f| f.has_glyphs(&egui::FontId::proportional(14.0), s)), "{s} would draw as a box"); } } + + #[test] + fn dialog_renders_customize_tags_and_subdialogs() { + let ctx = egui::Context::default(); + crate::fonts::install_once(&ctx); + let t = Tokens::for_theme(crate::theme::Theme { mode: crate::theme::Mode::Light, accent: crate::theme::Accent::Default }); + let mut dlg = Dialog::new(vec![CustomTag::named("Project A", &[])]); + let mut out = ctx.run_ui(egui::RawInput::default(), |ui| { + let _ = dlg.show(ui.ctx(), &t); + }); + out.textures_delta.clear(); + dlg.sub = Some(SubDialog::New(TagEditor::default())); + let mut out = ctx.run_ui(egui::RawInput::default(), |ui| { + let _ = dlg.show(ui.ctx(), &t); + }); + out.textures_delta.clear(); + dlg.sub = Some(SubDialog::Modify(0, TagEditor::from_tag(&dlg.list[0]))); + let mut out = ctx.run_ui(egui::RawInput::default(), |ui| { + let _ = dlg.show(ui.ctx(), &t); + }); + out.textures_delta.clear(); + } } diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index 6cdfd9ba8..d2aac3220 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -1782,7 +1782,11 @@ fn big_inner(ui: &mut Ui, icon: Icon, label: &str, tip: &str, menu: bool, on: bo _ => t.accent, } }; - icons::paint_ribbon(ui, Rect::from_center_size(egui::pos2(rect.center().x, rect.min.y + ICON_Y), vec2(28.0, 28.0)), icon, colour); + if icon == Icon::Todo { + painter.text(egui::pos2(rect.center().x, rect.min.y + ICON_Y), Align2::CENTER_CENTER, "✅", egui::FontId::proportional(24.0), t.text); + } else { + icons::paint_ribbon(ui, Rect::from_center_size(egui::pos2(rect.center().x, rect.min.y + ICON_Y), vec2(28.0, 28.0)), icon, colour); + } for (i, line) in lines.iter().enumerate() { #[allow(clippy::cast_precision_loss)] let y = rect.min.y + LABEL_Y + i as f32 * LINE_H; @@ -2926,7 +2930,22 @@ fn tag_row(ui: &mut Ui, tag: Tag, height: f32, t: &Tokens) -> egui::Response { if resp.has_focus() { painter.rect_stroke(rect.shrink(0.5), 3.0, egui::Stroke::new(1.5, t.accent), egui::StrokeKind::Inside); } - paint_tag(&painter, Rect::from_min_size(egui::pos2(rect.min.x + 2.0, rect.center().y - 9.0), vec2(18.0, 18.0)), tag, t.text, t.accent); + let emoji = match tag { + Tag::ToDo => "✅", + Tag::Important => "⭐", + Tag::Question => "❓", + Tag::Remember => "🟨", + Tag::Definition => "🟩", + Tag::Highlight => "🖍️", + Tag::Contact => "👤", + Tag::Address => "🏠", + Tag::Phone => "📞", + Tag::Website => "🔗", + Tag::Idea => "💡", + Tag::Critical => "❗", + Tag::Custom(_) => "🏷️", + }; + painter.text(egui::pos2(rect.min.x + 11.0, rect.center().y), Align2::CENTER_CENTER, emoji, egui::FontId::proportional(14.0), t.text); // Issue #373: icon, name and shortcut in three columns, the shortcut right-aligned in the quiet // colour as a menu draws it, so the names line up and the keys can be scanned on their own. // A screen reader still hears the name with its keys. diff --git a/crates/ui-egui/tests/ui.rs b/crates/ui-egui/tests/ui.rs index c09961380..12000c9ea 100644 --- a/crates/ui-egui/tests/ui.rs +++ b/crates/ui-egui/tests/ui.rs @@ -776,6 +776,73 @@ fn drawing_over_text_keeps_ink_above_the_page_without_editing_words() { review(&mut h, "canvas_draw_over_text"); } +#[test] +fn imported_ink_loads_into_the_editable_page_layer() { + let t = TempDir::new("ui-imported-ink-layer"); + let mut s = session(&t); + let notebooks = t.path().join("notebooks"); + let source = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .join("..") + .join("import") + .join("tests") + .join("fixtures") + .join("3p") + .join("onenote.rs") + .join("samples") + .join("joplin") + .join("desktop_missing_ink.one"); + let options = notecraft_import::Options::new(source, ¬ebooks); + let mut quiet = |_: ¬ecraft_import::Event<'_>| {}; + let report = notecraft_import::run(&options, &mut quiet).expect("import the public ink sample"); + assert_eq!((report.ink_pages, report.ink_strokes), (1, 14)); + s.refresh(); + + fn find_ink_page(root: &std::path::Path) -> Option { + for entry in std::fs::read_dir(root).ok()? { + let path = entry.ok()?.path(); + if !path.is_dir() { + continue; + } + if path.join("ink.svg").is_file() { + return Some(path); + } + if let Some(page) = find_ink_page(&path) { + return Some(page); + } + } + None + } + + let page = find_ink_page(¬ebooks).expect("the imported drawing page"); + let mut app = NoteCraftApp::new(s); + app.set_redact_paths(true); + app.open_path(&page.to_string_lossy()); + let mut h = harness(app, LIGHT); + settle(&mut h); + let before = ask(&mut h, "ui.inspect", json!({})).expect("inspect imported ink"); + assert_eq!(before["ink"]["strokes"], json!(14), "the imported strokes load into the page layer"); + + h.get_by_label("Draw").click(); + settle(&mut h); + h.get_by_label("Pen red").click(); + settle(&mut h); + let page_state = ask(&mut h, "ui.inspect", json!({})).expect("inspect page origin"); + let origin = page_state["page"]["origin"].as_array().expect("page origin"); + let (x, y) = (origin[0].as_f64().unwrap_or_default() + 700.0, origin[1].as_f64().unwrap_or_default() + 100.0); + ask(&mut h, "ui.press", json!({"x": x, "y": y})).expect("start a new layer stroke"); + pump(&mut h); + ask(&mut h, "ui.move", json!({"x": x + 30.0, "y": y + 10.0})).expect("continue the layer stroke"); + pump(&mut h); + ask(&mut h, "ui.release", json!({"x": x + 30.0, "y": y + 10.0})).expect("finish the layer stroke"); + settle(&mut h); + + let after = ask(&mut h, "ui.inspect", json!({})).expect("inspect edited imported ink"); + assert_eq!(after["ink"]["strokes"], json!(15), "the layer keeps all imported strokes and accepts new ink"); + let (drawing, lost) = + notecraft_ink::svg::read(&std::fs::read_to_string(page.join("ink.svg")).expect("saved layer")).expect("read the edited layer"); + assert_eq!((drawing.strokes.len(), lost), (15, 0), "the edited layer remains fully readable"); +} + #[test] fn pen_palette_owns_pointer_input_over_the_page_canvas() { let _pixel_test = support::gui::pixel_test(); @@ -2191,7 +2258,7 @@ fn insert_table_dialog_makes_a_table_of_the_typed_size() { assert_eq!(tables(&h), before, "html={html}: zero rows is refused"); h.state_mut().set_insert_table_size("25", "12"); settle(&mut h); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); let blocks = h.state().editor_blocks(); let made = blocks.iter().find_map(|b| match b { @@ -4120,28 +4187,30 @@ fn customize_tags_makes_a_tag_that_goes_on_a_line() { h.run_steps(2); h.get_by_label("Customize Tags...").click(); h.run_steps(2); - h.get_by_role_and_label(egui::accesskit::Role::TextInput, "New tag name").click(); + h.get_by_label("New Tag...").click(); + h.run_steps(2); + h.get_by_role_and_label(egui::accesskit::Role::TextInput, "Display name:").click(); pump(&mut h); - h.get_by_role_and_label(egui::accesskit::Role::TextInput, "New tag name").type_text("Ask legal"); + h.get_by_role_and_label(egui::accesskit::Role::TextInput, "Display name:").type_text("Ask legal"); h.run_steps(2); - h.get_by_label("Add tag").click(); - settle(&mut h); - h.get_by_label("Symbol for Ask legal").click(); + h.get_by_label("Symbol").click(); h.run_steps(2); h.get_by_label("♣").click(); h.run_steps(2); - h.get_by_label("Colour for Ask legal").click(); + h.get_by_label("Font Color").click(); h.run_steps(2); h.get_by_label("Red").click(); h.run_steps(2); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); + h.run_steps(2); review(&mut h, "customize_tags"); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); + h.run_steps(2); let mine = notecraft_model::tag::custom(); assert!( mine.iter().any(|c| c.id == "asklegal" && c.name == "Ask legal" && c.symbol == "♣" && c.color == notecraft_model::NodeColor::Red), "the tag is defined: {mine:?}" ); - h.get_by_label("Close").click(); - h.run_steps(2); // The tag is in the gallery and goes on the line the caret is in. ask(&mut h, "ui.caret", json!({"block": 1})).expect("caret"); @@ -4159,25 +4228,35 @@ fn customize_tags_makes_a_tag_that_goes_on_a_line() { h.run_steps(2); h.get_by_label("Customize Tags...").click(); h.run_steps(2); - h.get_by_role_and_label(egui::accesskit::Role::TextInput, "Tag name").click(); + h.get_by_label("Modify Tag...").click(); + h.run_steps(2); + h.get_by_role_and_label(egui::accesskit::Role::TextInput, "Display name:").click(); pump(&mut h); h.key_press_modifiers(egui::Modifiers::COMMAND, egui::Key::A); pump(&mut h); - h.get_by_role_and_label(egui::accesskit::Role::TextInput, "Tag name").type_text("Legal review"); + h.get_by_role_and_label(egui::accesskit::Role::TextInput, "Display name:").type_text("Legal review"); + h.run_steps(2); + h.get_all_by_label("OK").last().expect("Modify Tag OK").click(); + h.run_steps(2); + h.get_all_by_label("OK").last().expect("Customize Tags OK").click(); h.run_steps(2); assert_eq!(notecraft_model::Tag::parse("asklegal").map(|t| t.label()), Some("Legal review"), "renamed"); let body = h.state().body().unwrap_or_default().to_string(); assert!(body.contains("#asklegal NoteCraft pages"), "the line keeps its tag:\n{body}"); // Removed, the line keeps its words. + h.get_by_label("More tags").click(); + h.run_steps(2); + h.get_by_label("Customize Tags...").click(); + h.run_steps(2); h.get_by_label("Remove Legal review").click(); h.run_steps(2); + h.get_all_by_label("OK").last().expect("Customize Tags OK").click(); + h.run_steps(2); assert!(notecraft_model::tag::custom().iter().all(|c| c.id != "asklegal"), "removed"); assert_eq!(notecraft_model::Tag::split("#asklegal NoteCraft").0, None); let body = h.state().body().unwrap_or_default().to_string(); assert!(body.contains("#asklegal NoteCraft pages"), "nothing is taken out of the page:\n{body}"); - h.get_by_label("Close").click(); - h.run_steps(2); } /// Issue #290: the pen settings' Eyedropper was "not built". It is a pointer mode started from @@ -7996,7 +8075,7 @@ fn the_link_dialog_puts_in_edits_and_removes_a_link() { ask(&mut h, "ui.text", json!({"text": "https://example.test/plan"})).expect("type the address"); settle(&mut h); review(&mut h, "link_dialog"); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); h.state_mut().save(); let body = notecraft_store::page::load_page(page).expect("load").body; @@ -11800,7 +11879,7 @@ fn paragraph_spacing_opens_room_around_a_paragraph_saves_and_undoes() { h.run_steps(3); h.state_mut().set_paragraph_spacing_values(before, after, line); h.run_steps(2); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(h); }; caret(&mut h, 2); @@ -11886,7 +11965,7 @@ fn paragraph_spacing_opens_room_around_a_paragraph_saves_and_undoes() { h.run_steps(3); h.get_by_label("Reset").click(); h.run_steps(2); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); assert_eq!(saved(0), None, "{format:?}: Reset takes the room off"); assert!(notecraft_store::page::justified(page).expect("read").is_empty(), "{format:?}"); @@ -11936,7 +12015,7 @@ fn a_least_line_height_opens_up_right_to_left_and_inline_math_paragraphs() { h.run_steps(3); h.state_mut().set_paragraph_spacing_values("0", "0", "60"); h.run_steps(2); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); assert_eq!( notecraft_store::page::justified(page).expect("read").spacing_of(0).map(|s| s.line), @@ -11959,7 +12038,7 @@ fn a_least_line_height_opens_up_right_to_left_and_inline_math_paragraphs() { h.run_steps(3); h.get_by_label("Reset").click(); h.run_steps(2); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); caret(&mut h, 2); assert!((tail_of(&h) - start).abs() < 1.5, "{format:?} {label}: Reset gives the page its own lines back: {start} vs {}", tail_of(&h)); @@ -15271,7 +15350,7 @@ fn online_video_puts_a_link_to_the_video_at_the_caret() { ask(&mut h, "ui.text", json!({"text": "https://youtu.be/dQw4w9WgXcQ"})).expect("type"); settle(&mut h); review(&mut h, "online_video"); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); h.state_mut().save(); let body = notecraft_store::page::load_page(page).expect("load").body; @@ -20567,7 +20646,7 @@ fn the_link_dialog_links_to_a_place_in_the_notebooks() { assert!(h.query_all_by_label_contains("Format ideas \u{b7} Page").next().is_none(), "html={html}: only the places with the words"); h.get_all_by_label_contains("Deep page \u{b7} Page").next().expect("row").click(); settle(&mut h); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); h.state_mut().save(); let body = notecraft_store::page::load_page(page).expect("load").body; @@ -21314,7 +21393,7 @@ fn the_date_and_time_below_the_title_can_be_changed_or_hidden() { open_menu(&mut h, "26 November 2026"); h.get_by_label("Show the time").click(); settle(&mut h); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); let saved = || notecraft_store::page::load_page(page).expect("page").body; h.state_mut().save_page_now(); @@ -21324,7 +21403,7 @@ fn the_date_and_time_below_the_title_can_be_changed_or_hidden() { h.get_by_label("Show the time").click(); h.get_by_label("Show the date").click(); settle(&mut h); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); h.state_mut().save_page_now(); let first = saved().lines().next().unwrap_or_default().to_string(); @@ -21335,7 +21414,7 @@ fn the_date_and_time_below_the_title_can_be_changed_or_hidden() { open_menu(&mut h, &words); h.get_by_label("Show the time").click(); settle(&mut h); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); h.state_mut().save_page_now(); assert!(!saved().contains(&words) && saved().contains("Words here."), "the line is taken off: {}", saved()); @@ -23333,7 +23412,7 @@ fn a_cut_status_message_opens_whole() { let long = "The folder could not be opened because Android did not let NoteCraft read it. The last part of this message is the one that matters: grant access and try again."; h.state_mut().alert("status-test", "NoteCraft", long); settle(&mut h); - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); // The footer keeps the whole line as its name, for a screen reader, but shows it cut short. let shown = |h: &Harness<'_, NoteCraftApp>| h.query_all_by_label_contains("grant access and try again").count(); @@ -23345,7 +23424,7 @@ fn a_cut_status_message_opens_whole() { let r = node.rect(); assert!(r.max.x <= 420.0 + 0.5, "the message is wrapped inside the window: {r:?}"); } - h.get_by_label("OK").click(); + h.get_all_by_label("OK").last().expect("New Tag OK").click(); settle(&mut h); assert_eq!(shown(&h), footer, "OK closes it"); } diff --git a/docs/architecture.md b/docs/architecture.md index 044682b28..3b5311f2a 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -123,18 +123,12 @@ section file at a time, so memory is bounded by the largest file, and a file tha read costs that file and not the run. The tree it writes comes from `store` (notebook, section group, section, page, and sub-pages nested to any depth), and the pages from `formats`, so an imported page is the same as a typed one. The window's Import runs it through -`import::notebook`, which brings one notebook folder in as one notebook and hands only the -sections it cannot read to the OfficeIMO bridge. `crates/onenote` reads both encodings of a section: the desktop -revision store, and the OneDrive packaging ([MS-ONESTORE] 2.8) through -`packaged.rs`, into the same object spaces, so nothing after the reader knows which it was. Run it with `notecraft-cli import onenote`; see +`import::notebook`, which brings one notebook folder in as one notebook. Sections the native +reader cannot read are named in the result and `import-errors.txt`; if none can be read, no +notebook is created and the error gives recovery steps. Run it with +`notecraft-cli import onenote`; see [`how-to/move-your-notes.md`](how-to/move-your-notes.md). -The optional OfficeIMO path is an external bridge, not a Rust dependency. The resolver looks -for `NOTECRAFT_OFFICEIMO_BRIDGE` first, then for a pinned platform artifact under the NoteCraft -data directory. The bridge receives `--source`, `--out` and `--format html|cmgfm`; its output can -then be checked as a normal NoteCraft folder by the existing store checks. Artifact download and -checksum metadata are release tooling, not an implicit network operation during Cargo builds. - ## Equations and diagrams - **Equations** are TeX maths (`crates/math`). RaTeX, a pure Rust typesetter that follows KaTeX, diff --git a/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/index.md index f9ff0a7ed..485d684a2 100644 --- a/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/10-en/how-to/importing-onenote/index.md @@ -7,10 +7,9 @@ updated: 2026-10-18T00:00:00Z tags: [] --- -NoteCraft can import a complete notebook folder or one importable file. The OfficeIMO bridge -converts the source into NoteCraft's plain folder format. The source stays unchanged. - -OneNote parsing is provided by [OfficeIMO](https://github.com/EvotecIT/OfficeIMO), an open-source project distributed under the [MIT license](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). +NoteCraft's native reader imports supported OneNote sections into its plain folder format. The +source stays unchanged. Sections it cannot read are listed with recovery steps; open each in +OneNote and save it as a `.one` section before retrying. Unlock password-protected sections first. On **File > Open**, use the two import actions: @@ -42,7 +41,7 @@ Windows-style suffix: `2026`, `2026 (1)`, `2026 (2)`, and so on. Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/index.md index 71d533e55..1ea4e92e6 100644 --- a/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/11-es/how-to/importing-onenote/index.md @@ -9,8 +9,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -El análisis de OneNote lo proporciona [OfficeIMO](https://github.com/EvotecIT/OfficeIMO), un proyecto de código abierto distribuido bajo la [licencia MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -29,7 +27,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/index.md index 960cae6a2..894525b85 100644 --- a/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/12-fr/how-to/importing-onenote/index.md @@ -9,8 +9,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -L'analyse de OneNote est fournie par [OfficeIMO](https://github.com/EvotecIT/OfficeIMO), un projet open source distribué sous [licence MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -29,7 +27,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/index.md index ac3e04251..b9264dbfe 100644 --- a/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/13-de/how-to/importing-onenote/index.md @@ -9,8 +9,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -Die OneNote-Analyse wird von [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) bereitgestellt, einem Open-Source-Projekt unter der [MIT-Lizenz](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -29,7 +27,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/index.md index cc2ba4692..5b27871d0 100644 --- a/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/14-hi/how-to/importing-onenote/index.md @@ -9,8 +9,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -OneNote पार्सिंग [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) द्वारा प्रदान की जाती है, जो [MIT लाइसेंस](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE) के अंतर्गत वितरित एक ओपन-सोर्स परियोजना है। - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -29,7 +27,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/index.md index 831b0258e..77754f0d4 100644 --- a/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/15-ru/how-to/importing-onenote/index.md @@ -9,8 +9,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -Разбор OneNote выполняет [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) - проект с открытым исходным кодом под [лицензией MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -29,7 +27,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/index.md index 5eef8dace..b913427a1 100644 --- a/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/16-zh/how-to/importing-onenote/index.md @@ -9,8 +9,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -OneNote 解析由 [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) 提供,这是一个采用 [MIT 许可证](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE) 发布的开源项目。 - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -29,7 +27,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/index.md index 91cd83601..dd79a86b5 100644 --- a/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/17-ja/how-to/importing-onenote/index.md @@ -9,8 +9,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -OneNote の解析には、[MIT ライセンス](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE)で配布されるオープンソースの [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) を使用しています。 - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -29,7 +27,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/index.md index 81c98ad65..b7567289d 100644 --- a/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/18-ko/how-to/importing-onenote/index.md @@ -9,8 +9,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -OneNote 분석은 [MIT 라이선스](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE)로 배포되는 오픈 소스 프로젝트 [OfficeIMO](https://github.com/EvotecIT/OfficeIMO)가 제공합니다. - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -29,7 +27,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/index.md index 4abbcf000..fd79145fd 100644 --- a/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/19-tr/how-to/importing-onenote/index.md @@ -7,11 +7,9 @@ updated: 2026-10-18T00:00:00Z tags: [] --- -NoteCraft tam bir defter klasörünü ya da aktarılabilir tek bir dosyayı içe aktarabilir. OfficeIMO köprüsü -kaynağı NoteCraft'ın düz klasör biçimine dönüştürür. Kaynak değişmeden kalır. - -OneNote ayrıştırması, [MIT lisansı](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE) altında -dağıtılan açık kaynaklı bir proje olan [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) tarafından sağlanır. +NoteCraft, OneNote bölümlerini yerel okuyucusuyla düz klasör biçimine aktarır. Kaynak değişmeden +kalır. Okunamayan bölümler, yeniden deneme yönergeleriyle listelenir; her birini OneNote'ta açıp +yeniden denemeden önce `.one` bölümü olarak kaydedin. Parolayla korunan bölümlerin kilidini önce açın. **Dosya > Aç**'ta iki içe aktarma eylemini kullanın: @@ -43,7 +41,7 @@ Aynı adda bir defter zaten varsa, NoteCraft Windows tarzı bir sonek ekleyerek Klasör içe aktarmaları iç içe klasörlerin içinde ilerler. Klasörler bölüm gruplarına, `.one` dosyaları bölümlere dönüşür; sayfalar ve iç içe sayfalar adlarını ve hiyerarşilerini korur. -![İçe aktarılan defter](assets/imported-notebook.png) +![Defter görünümü](assets/imported-notebook.png) Bir içe aktarma çalışırken NoteCraft, geçerli bölümü, ilerleme sayısını ve bir İçe aktarmayı iptal et düğmesini gösteren tek bir temalı ilerleme penceresi gösterir. diff --git a/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/index.md index 4950be071..54f17fa8b 100644 --- a/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/20-ar/how-to/importing-onenote/index.md @@ -10,8 +10,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -يتم توفير تحليل OneNote بواسطة [OfficeIMO](https://github.com/EvotecIT/OfficeIMO)، وهو مشروع مفتوح المصدر موزع بموجب [ترخيص MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -30,7 +28,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/index.md index d33526e7c..c148ba50b 100644 --- a/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/21-fa/how-to/importing-onenote/index.md @@ -10,8 +10,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -تجزیه OneNote توسط [OfficeIMO](https://github.com/EvotecIT/OfficeIMO)، یک پروژه متن‌باز با [مجوز MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE)، انجام می‌شود. - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -30,7 +28,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/index.md index 89b6a9090..62acdead8 100644 --- a/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/22-ur/how-to/importing-onenote/index.md @@ -10,8 +10,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -OneNote کی parsing [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) فراہم کرتی ہے، جو [MIT لائسنس](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE) کے تحت تقسیم ہونے والا اوپن سورس منصوبہ ہے۔ - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -30,7 +28,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/index.md b/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/index.md index 1d509c254..05cf6ecc8 100644 --- a/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/index.md +++ b/docs/demo/DemoNotebook/cmgfm/23-he/how-to/importing-onenote/index.md @@ -10,8 +10,6 @@ tags: [] This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -ניתוח OneNote מסופק על ידי [OfficeIMO](https://github.com/EvotecIT/OfficeIMO), פרויקט קוד פתוח המופץ תחת [רישיון MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -30,7 +28,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/index.html index 8dfb58f44..d4a59a16b 100644 --- a/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/10-en/how-to/importing-onenote/index.html @@ -9,8 +9,7 @@ -

NoteCraft can import a complete notebook folder or one importable file. The OfficeIMO bridge converts the source into NoteCraft's plain folder format. The source stays unchanged.

-

OneNote parsing is provided by OfficeIMO, an open-source project distributed under the MIT license.

+

NoteCraft's native reader imports supported OneNote sections into its plain folder format. The source stays unchanged. Sections it cannot read are listed with recovery steps; open each in OneNote and save it as a .one section before retrying. Unlock password-protected sections first.

On File > Open, use the two import actions:

  • Import notebook folder imports a complete folder tree.
  • @@ -25,7 +24,7 @@

    What happens during import

    NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

    If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

    Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

    -

    Imported notebook

    +

    Notebook view

    While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

    Import progress

    Encrypted or unsupported sections are reported in the imported notebook's import-errors.txt. Readable sections still open when a folder contains a mixture of readable and unsupported files.

    diff --git a/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/index.html index 7ecb95451..877a7a6be 100644 --- a/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/11-es/how-to/importing-onenote/index.html @@ -10,7 +10,6 @@

    This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

    -

    El análisis de OneNote lo proporciona OfficeIMO, un proyecto de código abierto distribuido bajo la licencia MIT.

    Notebook folder import

    Import notebook folder

    Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

    @@ -20,7 +19,7 @@

    What happens during import

    NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

    If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

    Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

    -

    Imported notebook

    +

    Notebook view

    While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

    Import progress

    diff --git a/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/index.html index 41c115489..23976d16e 100644 --- a/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/12-fr/how-to/importing-onenote/index.html @@ -10,7 +10,6 @@

    This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

    -

    L'analyse de OneNote est fournie par OfficeIMO, un projet open source distribué sous licence MIT.

    Notebook folder import

    Import notebook folder

    Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

    @@ -20,7 +19,7 @@

    What happens during import

    NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

    If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

    Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

    -

    Imported notebook

    +

    Notebook view

    While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

    Import progress

    diff --git a/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/index.html index 340399c6e..66b57c142 100644 --- a/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/13-de/how-to/importing-onenote/index.html @@ -10,7 +10,6 @@

    This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

    -

    Die OneNote-Analyse wird von OfficeIMO bereitgestellt, einem Open-Source-Projekt unter der MIT-Lizenz.

    Notebook folder import

    Import notebook folder

    Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

    @@ -20,7 +19,7 @@

    What happens during import

    NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

    If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

    Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

    -

    Imported notebook

    +

    Notebook view

    While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

    Import progress

    diff --git a/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/index.html index ca3eba9c5..3448b55a3 100644 --- a/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/14-hi/how-to/importing-onenote/index.html @@ -10,7 +10,6 @@

    This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

    -

    OneNote पार्सिंग OfficeIMO द्वारा प्रदान की जाती है, जो MIT लाइसेंस के अंतर्गत वितरित एक ओपन-सोर्स परियोजना है।

    Notebook folder import

    Import notebook folder

    Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

    @@ -20,7 +19,7 @@

    What happens during import

    NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

    If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

    Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

    -

    Imported notebook

    +

    Notebook view

    While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

    Import progress

    diff --git a/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/index.html index 297cc789a..f1845cd4b 100644 --- a/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/15-ru/how-to/importing-onenote/index.html @@ -10,7 +10,6 @@

    This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

    -

    Разбор OneNote выполняет OfficeIMO - проект с открытым исходным кодом под лицензией MIT.

    Notebook folder import

    Import notebook folder

    Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

    @@ -20,7 +19,7 @@

    What happens during import

    NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

    If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

    Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

    -

    Imported notebook

    +

    Notebook view

    While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

    Import progress

    diff --git a/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/index.html index 4f7f376d7..30c876153 100644 --- a/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/16-zh/how-to/importing-onenote/index.html @@ -10,7 +10,6 @@

    This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

    -

    OneNote 解析由 OfficeIMO 提供,这是一个采用 MIT 许可证 发布的开源项目。

    Notebook folder import

    Import notebook folder

    Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

    @@ -20,7 +19,7 @@

    What happens during import

    NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

    If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

    Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

    -

    Imported notebook

    +

    Notebook view

    While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

    Import progress

    diff --git a/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/index.html index 40f7ae62f..0febc9400 100644 --- a/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/17-ja/how-to/importing-onenote/index.html @@ -10,7 +10,6 @@

    This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

    -

    OneNote の解析には、MIT ライセンスで配布されるオープンソースの OfficeIMO を使用しています。

    Notebook folder import

    Import notebook folder

    Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

    @@ -20,7 +19,7 @@

    What happens during import

    NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

    If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

    Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

    -

    Imported notebook

    +

    Notebook view

    While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

    Import progress

    diff --git a/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/index.html index 1b793aa88..dad7a00e9 100644 --- a/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/18-ko/how-to/importing-onenote/index.html @@ -10,7 +10,6 @@

    This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

    -

    OneNote 분석은 MIT 라이선스로 배포되는 오픈 소스 프로젝트 OfficeIMO가 제공합니다.

    Notebook folder import

    Import notebook folder

    Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

    @@ -20,7 +19,7 @@

    What happens during import

    NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

    If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

    Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

    -

    Imported notebook

    +

    Notebook view

    While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

    Import progress

    diff --git a/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/index.html index 21b0aabdc..69457669f 100644 --- a/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/19-tr/how-to/importing-onenote/index.html @@ -9,8 +9,7 @@ -

    NoteCraft tam bir defter klasörünü ya da aktarılabilir tek bir dosyayı içe aktarabilir. OfficeIMO köprüsü kaynağı NoteCraft'ın düz klasör biçimine dönüştürür. Kaynak değişmeden kalır.

    -

    OneNote ayrıştırması, MIT lisansı altında dağıtılan açık kaynaklı bir proje olan OfficeIMO tarafından sağlanır.

    +

    NoteCraft, OneNote bölümlerini yerel okuyucusuyla düz klasör biçimine aktarır. Kaynak değişmeden kalır. Okunamayan bölümler, yeniden deneme yönergeleriyle listelenir; her birini OneNote'ta açıp yeniden denemeden önce .one bölümü olarak kaydedin. Parolayla korunan bölümlerin kilidini önce açın.

    Dosya > Aç'ta iki içe aktarma eylemini kullanın:

    • Defter klasörünü içe aktar tam bir klasör ağacını içe aktarır.
    • @@ -25,7 +24,7 @@

      İçe aktarma sırasında olanlar

      NoteCraft, yapılandırılmış defterler klasörünün içinde hedefi oluşturur, başarılı bir içe aktarmadan sonra içe aktarılan defteri açar ve Son açılanlar'a ekler. Özgün OneNote dosyaları asla değiştirilmez. Bir ilerleme penceresi geçerli bölümü gösterir ve güvenle iptal etmenize izin verir.

      Aynı adda bir defter zaten varsa, NoteCraft Windows tarzı bir sonek ekleyerek üzerine yazmaktan kaçınır: 2026, 2026 (1), 2026 (2) ve benzeri.

      Klasör içe aktarmaları iç içe klasörlerin içinde ilerler. Klasörler bölüm gruplarına, .one dosyaları bölümlere dönüşür; sayfalar ve iç içe sayfalar adlarını ve hiyerarşilerini korur.

      -

      İçe aktarılan defter

      +

      Defter görünümü

      Bir içe aktarma çalışırken NoteCraft, geçerli bölümü, ilerleme sayısını ve bir İçe aktarmayı iptal et düğmesini gösteren tek bir temalı ilerleme penceresi gösterir.

      İçe aktarma ilerlemesi

      Şifreli ya da desteklenmeyen bölümler, içe aktarılan defterin import-errors.txt dosyasında bildirilir. Bir klasör okunabilir ve desteklenmeyen dosyaların karışımını içerdiğinde, okunabilir bölümler yine de açılır.

      diff --git a/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/index.html index 0ff53eb27..fe5e95098 100644 --- a/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/20-ar/how-to/importing-onenote/index.html @@ -11,7 +11,6 @@

      This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

      -

      يتم توفير تحليل OneNote بواسطة OfficeIMO، وهو مشروع مفتوح المصدر موزع بموجب ترخيص MIT.

      Notebook folder import

      Import notebook folder

      Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

      @@ -21,7 +20,7 @@

      What happens during import

      NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

      If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

      Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

      -

      Imported notebook

      +

      Notebook view

      While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

      Import progress

      diff --git a/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/index.html index 432e0c60b..624e0f33b 100644 --- a/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/21-fa/how-to/importing-onenote/index.html @@ -11,7 +11,6 @@

      This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

      -

      تجزیه OneNote توسط OfficeIMO، یک پروژه متن‌باز با مجوز MIT، انجام می‌شود.

      Notebook folder import

      Import notebook folder

      Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

      @@ -21,7 +20,7 @@

      What happens during import

      NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

      If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

      Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

      -

      Imported notebook

      +

      Notebook view

      While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

      Import progress

      diff --git a/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/index.html index dc7bdbcab..b1f514c03 100644 --- a/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/22-ur/how-to/importing-onenote/index.html @@ -11,7 +11,6 @@

      This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

      -

      OneNote کی parsing OfficeIMO فراہم کرتی ہے، جو MIT لائسنس کے تحت تقسیم ہونے والا اوپن سورس منصوبہ ہے۔

      Notebook folder import

      Import notebook folder

      Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

      @@ -21,7 +20,7 @@

      What happens during import

      NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

      If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

      Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

      -

      Imported notebook

      +

      Notebook view

      While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

      Import progress

      diff --git a/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/import-open.png b/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/import-open.png index 6d1eb2f12..f88ed53aa 100644 Binary files a/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/import-open.png and b/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/import-open.png differ diff --git a/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/import-progress.png b/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/import-progress.png index 607f22bfa..ad6a68ada 100644 Binary files a/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/import-progress.png and b/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/import-progress.png differ diff --git a/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/imported-notebook.png b/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/imported-notebook.png index 9102cee6d..6d66245c1 100644 Binary files a/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/imported-notebook.png and b/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/assets/imported-notebook.png differ diff --git a/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/index.html b/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/index.html index 64f0d5420..8297d7a59 100644 --- a/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/index.html +++ b/docs/demo/DemoNotebook/html/23-he/how-to/importing-onenote/index.html @@ -11,7 +11,6 @@

      This guide explains importing a complete notebook folder or one importable file. The source stays unchanged.

      -

      ניתוח OneNote מסופק על ידי OfficeIMO, פרויקט קוד פתוח המופץ תחת רישיון MIT.

      Notebook folder import

      Import notebook folder

      Choose Import notebook folder and select a folder such as 2026. Its name becomes the notebook name. Nested folders become section groups and .one files become sections.

      @@ -21,7 +20,7 @@

      What happens during import

      NoteCraft creates the destination inside the configured notebooks folder, opens the imported notebook after a successful import, and adds it to Recently opened. The original OneNote files are never changed. A progress dialog shows the current section and lets you cancel safely.

      If a notebook with the same name already exists, NoteCraft avoids overwriting it by adding a Windows-style suffix: 2026, 2026 (1), 2026 (2), and so on.

      Folder imports recurse through nested folders. Folders become section groups, .one files become sections, and pages and nested pages keep their names and hierarchy.

      -

      Imported notebook

      +

      Notebook view

      While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button.

      Import progress

      diff --git a/docs/demo/scripts/content/ar/95-importing-onenote.md b/docs/demo/scripts/content/ar/95-importing-onenote.md index a54e941a3..57ed8ca2c 100644 --- a/docs/demo/scripts/content/ar/95-importing-onenote.md +++ b/docs/demo/scripts/content/ar/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -يتم توفير تحليل OneNote بواسطة [OfficeIMO](https://github.com/EvotecIT/OfficeIMO)، وهو مشروع مفتوح المصدر موزع بموجب [ترخيص MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/de/95-importing-onenote.md b/docs/demo/scripts/content/de/95-importing-onenote.md index 3a94521d4..57ed8ca2c 100644 --- a/docs/demo/scripts/content/de/95-importing-onenote.md +++ b/docs/demo/scripts/content/de/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -Die OneNote-Analyse wird von [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) bereitgestellt, einem Open-Source-Projekt unter der [MIT-Lizenz](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/en/95-importing-onenote.md b/docs/demo/scripts/content/en/95-importing-onenote.md index 96576c13e..620e59c65 100644 --- a/docs/demo/scripts/content/en/95-importing-onenote.md +++ b/docs/demo/scripts/content/en/95-importing-onenote.md @@ -4,10 +4,9 @@ title: Import OneNote into NoteCraft # Import OneNote into NoteCraft -NoteCraft can import a complete notebook folder or one importable file. The OfficeIMO bridge -converts the source into NoteCraft's plain folder format. The source stays unchanged. - -OneNote parsing is provided by [OfficeIMO](https://github.com/EvotecIT/OfficeIMO), an open-source project distributed under the [MIT license](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). +NoteCraft's native reader imports supported OneNote sections into its plain folder format. The +source stays unchanged. Sections it cannot read are listed with recovery steps; open each in +OneNote and save it as a `.one` section before retrying. Unlock password-protected sections first. On **File > Open**, use the two import actions: @@ -39,7 +38,7 @@ Windows-style suffix: `2026`, `2026 (1)`, `2026 (2)`, and so on. Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/es/95-importing-onenote.md b/docs/demo/scripts/content/es/95-importing-onenote.md index e142728f0..57ed8ca2c 100644 --- a/docs/demo/scripts/content/es/95-importing-onenote.md +++ b/docs/demo/scripts/content/es/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -El análisis de OneNote lo proporciona [OfficeIMO](https://github.com/EvotecIT/OfficeIMO), un proyecto de código abierto distribuido bajo la [licencia MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/fa/95-importing-onenote.md b/docs/demo/scripts/content/fa/95-importing-onenote.md index d7af58e8a..57ed8ca2c 100644 --- a/docs/demo/scripts/content/fa/95-importing-onenote.md +++ b/docs/demo/scripts/content/fa/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -تجزیه OneNote توسط [OfficeIMO](https://github.com/EvotecIT/OfficeIMO)، یک پروژه متن‌باز با [مجوز MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE)، انجام می‌شود. - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/fr/95-importing-onenote.md b/docs/demo/scripts/content/fr/95-importing-onenote.md index 847c9a0dc..57ed8ca2c 100644 --- a/docs/demo/scripts/content/fr/95-importing-onenote.md +++ b/docs/demo/scripts/content/fr/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -L'analyse de OneNote est fournie par [OfficeIMO](https://github.com/EvotecIT/OfficeIMO), un projet open source distribué sous [licence MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/he/95-importing-onenote.md b/docs/demo/scripts/content/he/95-importing-onenote.md index 488bc5e29..57ed8ca2c 100644 --- a/docs/demo/scripts/content/he/95-importing-onenote.md +++ b/docs/demo/scripts/content/he/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -ניתוח OneNote מסופק על ידי [OfficeIMO](https://github.com/EvotecIT/OfficeIMO), פרויקט קוד פתוח המופץ תחת [רישיון MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/hi/95-importing-onenote.md b/docs/demo/scripts/content/hi/95-importing-onenote.md index 8a2157685..57ed8ca2c 100644 --- a/docs/demo/scripts/content/hi/95-importing-onenote.md +++ b/docs/demo/scripts/content/hi/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -OneNote पार्सिंग [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) द्वारा प्रदान की जाती है, जो [MIT लाइसेंस](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE) के अंतर्गत वितरित एक ओपन-सोर्स परियोजना है। - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/ja/95-importing-onenote.md b/docs/demo/scripts/content/ja/95-importing-onenote.md index adbae2c39..57ed8ca2c 100644 --- a/docs/demo/scripts/content/ja/95-importing-onenote.md +++ b/docs/demo/scripts/content/ja/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -OneNote の解析には、[MIT ライセンス](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE)で配布されるオープンソースの [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) を使用しています。 - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/ko/95-importing-onenote.md b/docs/demo/scripts/content/ko/95-importing-onenote.md index 0d587b680..57ed8ca2c 100644 --- a/docs/demo/scripts/content/ko/95-importing-onenote.md +++ b/docs/demo/scripts/content/ko/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -OneNote 분석은 [MIT 라이선스](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE)로 배포되는 오픈 소스 프로젝트 [OfficeIMO](https://github.com/EvotecIT/OfficeIMO)가 제공합니다. - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/ru/95-importing-onenote.md b/docs/demo/scripts/content/ru/95-importing-onenote.md index ff418b930..57ed8ca2c 100644 --- a/docs/demo/scripts/content/ru/95-importing-onenote.md +++ b/docs/demo/scripts/content/ru/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -Разбор OneNote выполняет [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) - проект с открытым исходным кодом под [лицензией MIT](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE). - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/tr/95-importing-onenote.md b/docs/demo/scripts/content/tr/95-importing-onenote.md index b25777ecb..55c0caa29 100644 --- a/docs/demo/scripts/content/tr/95-importing-onenote.md +++ b/docs/demo/scripts/content/tr/95-importing-onenote.md @@ -4,11 +4,9 @@ title: OneNote'u NoteCraft'a aktarmak # OneNote'u NoteCraft'a aktarmak -NoteCraft tam bir defter klasörünü ya da aktarılabilir tek bir dosyayı içe aktarabilir. OfficeIMO köprüsü -kaynağı NoteCraft'ın düz klasör biçimine dönüştürür. Kaynak değişmeden kalır. - -OneNote ayrıştırması, [MIT lisansı](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE) altında -dağıtılan açık kaynaklı bir proje olan [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) tarafından sağlanır. +NoteCraft, OneNote bölümlerini yerel okuyucusuyla düz klasör biçimine aktarır. Kaynak değişmeden +kalır. Okunamayan bölümler, yeniden deneme yönergeleriyle listelenir; her birini OneNote'ta açıp +yeniden denemeden önce `.one` bölümü olarak kaydedin. Parolayla korunan bölümlerin kilidini önce açın. **Dosya > Aç**'ta iki içe aktarma eylemini kullanın: @@ -40,7 +38,7 @@ Aynı adda bir defter zaten varsa, NoteCraft Windows tarzı bir sonek ekleyerek Klasör içe aktarmaları iç içe klasörlerin içinde ilerler. Klasörler bölüm gruplarına, `.one` dosyaları bölümlere dönüşür; sayfalar ve iç içe sayfalar adlarını ve hiyerarşilerini korur. -![İçe aktarılan defter](assets/imported-notebook.png) +![Defter görünümü](assets/imported-notebook.png) Bir içe aktarma çalışırken NoteCraft, geçerli bölümü, ilerleme sayısını ve bir İçe aktarmayı iptal et düğmesini gösteren tek bir temalı ilerleme penceresi gösterir. diff --git a/docs/demo/scripts/content/ur/95-importing-onenote.md b/docs/demo/scripts/content/ur/95-importing-onenote.md index 433164686..57ed8ca2c 100644 --- a/docs/demo/scripts/content/ur/95-importing-onenote.md +++ b/docs/demo/scripts/content/ur/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -OneNote کی parsing [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) فراہم کرتی ہے، جو [MIT لائسنس](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE) کے تحت تقسیم ہونے والا اوپن سورس منصوبہ ہے۔ - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/demo/scripts/content/zh/95-importing-onenote.md b/docs/demo/scripts/content/zh/95-importing-onenote.md index ec7e5345e..57ed8ca2c 100644 --- a/docs/demo/scripts/content/zh/95-importing-onenote.md +++ b/docs/demo/scripts/content/zh/95-importing-onenote.md @@ -6,8 +6,6 @@ title: Import OneNote into NoteCraft This guide explains importing a complete notebook folder or one importable file. The source stays unchanged. -OneNote 解析由 [OfficeIMO](https://github.com/EvotecIT/OfficeIMO) 提供,这是一个采用 [MIT 许可证](https://github.com/EvotecIT/OfficeIMO/blob/master/LICENSE) 发布的开源项目。 - ![Notebook folder import](assets/import-open.png) ## Import notebook folder @@ -26,7 +24,7 @@ If a notebook with the same name already exists, NoteCraft avoids overwriting it Folder imports recurse through nested folders. Folders become section groups, `.one` files become sections, and pages and nested pages keep their names and hierarchy. -![Imported notebook](assets/imported-notebook.png) +![Notebook view](assets/imported-notebook.png) While an import is running, NoteCraft shows one themed progress dialog with the current section, progress count, and a Cancel import button. diff --git a/docs/gaps.md b/docs/gaps.md index a59ee9d10..581136a55 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -102,11 +102,11 @@ narrower than 600 points, on Android, a narrow desktop window or the browser bui the folder, is unpacked (LZX or MSZIP cabinet) into a temporary folder named after it and imported as a notebook of that name. A package's names are checked so nothing is written outside that folder. The window's Import notebook folder and Import File use the same reader - (issue #19): the chosen folder is one notebook, its subfolders section groups, and only a - section the reader cannot read goes to the optional OfficeIMO bridge. - Older bundled OfficeIMO bridges export each section as a single HTML or Markdown document. - The window and CLI now keep that document as one combined page with its assets, and report - that the original page boundaries are unavailable. Unsupported HTML remains read-only. + (issue #19): the chosen folder is one notebook, its subfolders section groups, and each + section is read by NoteCraft's native reader. Sections it cannot read are listed with their + reasons in `import-errors.txt`; readable sections still import. If no section can be read, + no notebook is created, and the error explains how to retry after saving the section from + OneNote as a `.one` file or unlocking it. Sections keep the order the notebook's `.onetoc2` gives them, and OneNote's `OneNote_RecycleBin` of deleted sections is left out. Sections and tables of contents in OneNote's OneDrive packaging ([MS-ONESTORE] 2.8 over @@ -463,7 +463,7 @@ narrower than 600 points, on Android, a narrow desktop window or the browser bui Wayland, and enables Wayland data-control. Not built yet: RTF output and paste, NoteCraft's own page format on the clipboard, URL and other registered formats, copy-as-image for selected visual blocks, and paste of copied file lists. Those need the Windows clipboard API; see - [ADR 0001](adr/0001-clipboard-boundary.md). + [ADR 0001](rfc/uiux/0001-clipboard-boundary.md). - **A box's right-click menu is short.** It has Cut, Copy and Delete, then the page's entries. OneNote's also has Paste Options, Select, Order, Move and Resize, and a small formatting toolbar above it; none of those are here yet, and no entry is shown that does nothing. Move and @@ -788,7 +788,7 @@ narrower than 600 points, on Android, a narrow desktop window or the browser bui as it was written, and shows as a link to something no longer there. - **Pasting** puts a picture on the page as a file beside it, which egui alone cannot do: the clipboard is read through the app's clipboard boundary, because egui hands a window text - only (see [ADR 0001](adr/0001-clipboard-boundary.md)). The page also has + only (see [ADR 0001](rfc/uiux/0001-clipboard-boundary.md)). The page also has its own menu under the right button, with paste, cut, copy and the things the Insert tab can put there. - **The Insert tab** carries OneNote's groups. Working: tables, a file attachment, a diff --git a/docs/how-to/move-your-notes.md b/docs/how-to/move-your-notes.md index 65c6fcea0..d1670cd99 100644 --- a/docs/how-to/move-your-notes.md +++ b/docs/how-to/move-your-notes.md @@ -19,17 +19,13 @@ sub-pages, pictures and attached files. NoteCraft's own reader does this, the sa command line below. OneNote's `OneNote_RecycleBin` folder of deleted sections is left out, and of several backup copies of a section only the newest comes in. -A section NoteCraft cannot read is given to the OfficeIMO bridge, when one is installed. A -notebook or section group is made only when a section arrives in it, so nothing empty appears. -If no section can be imported, no notebook is made and the message names the files and why. -If some cannot, the notebook holds the rest and lists the others in `import-errors.txt` inside -it. The imported notebook opens when the import ends. - -Some installed bridges export a whole section as one combined page. NoteCraft keeps that -page and its assets together and reports this limitation after import; it cannot reconstruct -the original page boundaries from that output. HTML that the editor cannot safely rewrite -opens read-only. Each import creates a new notebook under the destination folder; existing -notebooks stay intact. +Sections the native reader cannot read are listed with their reasons in `import-errors.txt` +inside the imported notebook. Readable sections still import. If no section can be imported, +no notebook is created and the error names the files and explains why. Open unreadable sections +in OneNote and save each as a `.one` section before retrying; unlock password-protected sections +first. A notebook or section group is made only when a section arrives in it, so nothing empty +appears. The imported notebook opens when the import ends. Each import creates a new notebook +under the destination folder; existing notebooks stay intact. The built-in command-line importer is also available: diff --git a/docs/officeimo-bridge.md b/docs/officeimo-bridge.md deleted file mode 100644 index e50bf1337..000000000 --- a/docs/officeimo-bridge.md +++ /dev/null @@ -1,44 +0,0 @@ -# OfficeIMO bridge - -The OfficeIMO importer is optional. NoteCraft remains a Rust application; the bridge is a -separate process that converts a OneNote input into a NoteCraft folder. - -## Contract - -The bridge must accept: - -```text ---source PATH --out PATH --format html|cmgfm -``` - -It must return exit code zero only after the output folder is complete. Its standard output is -diagnostic JSON or text for the caller. A failure must use a non-zero exit code and write a useful -diagnostic to standard error. - -The window's import reads OneNote files with NoteCraft's own reader and calls the bridge only -for a section that reader cannot read, and for files that are not OneNote files (issue #19). -`notecraft-cli import officeimo` runs the bridge for every section. - -The NoteCraft caller accepts either one `.one` section file or a folder tree. For a folder tree, -NoteCraft uses the selected folder name as the notebook, nested folders as section groups, and -each `.one` file as a section. A section group is made only once a section in it has been -converted. The bridge itself remains a single-section converter. - -## Installation - -For development, set `NOTECRAFT_OFFICEIMO_BRIDGE` to an explicitly built executable. Installed -artifacts use this layout under the NoteCraft data directory: - -```text -importers/officeimo//officeimo-notecraft[.exe] -``` - -The initial target names are `win-x64`, `linux-x64`, `osx-x64` and `osx-arm64`. Release tooling -must pin an artifact URL, SHA-256, bridge version and license manifest. Cargo builds must not -download an unpinned binary implicitly. - -Release bundles are built with [`tools/officeimo/package.ps1`](../tools/officeimo/package.ps1). -The script publishes a self-contained bridge for one runtime identifier and records its SHA-256 -in a manifest. Release packaging must run it for each target runtime and include the OfficeIMO -and transitive dependency license files beside the manifest. Generated binaries stay out of the -source repository. diff --git a/docs/onenote-migration-status.md b/docs/onenote-migration-status.md new file mode 100644 index 000000000..e1b0faddf --- /dev/null +++ b/docs/onenote-migration-status.md @@ -0,0 +1,70 @@ +# OneNote import migration: what is still open + +Status as of 2026-12-04. Covers the move from the OfficeIMO bridge to the native reader, the ink +and attachment work (RFC 0003), and the Android checks. PR #702 was merged early by mistake (it +had auto-merge enabled); future PRs stay in draft until they are ready. + +## Done + +- **Native reader handles the real samples.** Compared with OfficeIMO on six real OneNote sections + plus the synthetic attachment section: the same page titles and wording, and the native reader + keeps the pictures and files that OfficeIMO drops. +- **OfficeIMO crashes on a real sample.** `Large Desktop.one` (from the onenote.rs samples) makes the + bridge throw an exception. The native reader imports it. +- **Ink import is on `main`** (PR #574, Kaustubh). It writes each page's ink to `ink.svg` through + the app's ink writer. +- **Original ink strokes are kept** beside each page's ink layer, in `ink-original.json` (PR #702, + merged). Nothing renders from that file yet; it is kept for later use. +- **Ink data model** (`crates/formats/src/ink.rs`): stroke data with JSON and SVG forms, and an open + metadata map. Round-trip tests pass. +- **Drawing block** (`Block::Drawing`): written and read the same way in HTML and CommonMark, with + round-trip tests and a parity fixture entry (RFC 0003). +- **Synthetic attachment section** `attachment-formats.one`: PNG, JPEG, GIF, BMP, SVG, a picture + with no recorded extension, and a text file. onenote.rs reads it, and the import keeps every byte + in both formats (`crates/import/tests/attachment_formats.rs`). +- **Android APK builds** inside WSL Ubuntu 24.04, and `android/test.sh` passes on it. + +## Not done + +1. **Remove the OfficeIMO bridge.** Blocked on your confirmation. It is still in the code + (`crates/import/src/officeimo.rs`, `notebook.rs`, the packaging, and the docs). +2. **OfficeIMO fails on our synthetic attachment section** ("committed transaction has an invalid + sentinel checksum"). Probably a defect in the synthetic writer, not in real files. Needs checking + before the comparison can cover attachments. +3. **Comparison on real notebooks with attachments.** The only real samples are the onenote.rs + samples and OfficeIMO's own test files. No real notebook with pictures and files has been run + through both readers yet. +4. **Synthetic fixtures still not accepted by onenote.rs:** + - `asset-pack.one` has a deliberately missing picture, which onenote.rs rejects (`ResolutionFailed`). + - The revision-history package keeps the old layout (no section metadata root), because the + import test for it broke when the root was added. Root cause not found. + - `broken.one` fails on purpose. +5. **onenote.rs image fix is not pushed.** The fix (take a picture's extension from its bytes) is + committed locally on `fix/image-extension-from-bytes` in the onenote.rs checkout. Its `fork` + remote points at `AlienTechSoftware/onenote.rs`, not a personal fork, so push it only after + choosing the right remote. +6. **Ink import checks not done:** + - stroke width units not checked against the app (the sample shows a width of 50); + - pressure is not in OneNote's path data, so imported ink uses a neutral reading; + - not checked in the running app. +7. **Ink editing in the app (RFC 0003, stage 3).** Imported ink can be edited only through the + existing page layer, which has not been tested with imported drawings. +8. **Per-object drawing blocks are not wired into import.** The import writes the page layer only. + Whether to add per-object blocks is still open (RFC 0003, section 10). +9. **Android on a device.** The smoke test has not run. The WSL `adb` wrapper passes no arguments + through, so the script hangs or prints adb's help text. Options: run the smoke test from Windows + with the Windows adb, or fix the wrapper. +10. **Android in CI.** CI runs clippy for arm64, and the packaging workflow builds the APK and runs + `android/test.sh`. Nothing runs the app on an Android device in CI. +11. **CI matrix.** Linux, Windows and macOS run the full workspace tests on every change. Android is + covered as described in item 10. No new matrix work is pending beyond that. +12. **Coverage.** The recorded baseline (`docs/coverage.json`) predates this work. On Linux the + `import` crate is at 65.2% lines. The current branch has not been measured. +13. **Title truncation with a backslash** (`checkboxes_and_unicode.one`, native reader). Found during + the comparison and set aside as low priority. + +## Decisions needed from the owner + +- Confirm removing OfficeIMO, once item 2 and item 3 are answered. +- Whether per-object drawing blocks are wanted in import (item 8). +- Which remote the onenote.rs fix goes to (item 5). diff --git a/docs/onenote-reader-replacement.md b/docs/onenote-reader-replacement.md new file mode 100644 index 000000000..8afe3569a --- /dev/null +++ b/docs/onenote-reader-replacement.md @@ -0,0 +1,61 @@ +# Replacing the OfficeIMO bridge: what was done + +Status as of 2026-12-04. **The bridge is not removed.** OfficeIMO is still the fallback in +`crates/import/src/notebook.rs`. This document records what is in place and what is left. + +## Which readers do the work now + +| Reader | Where | Used for | Status | +|---|---|---|---| +| NoteCraft native reader | `crates/onenote` | Pages, text, pictures, files, tables, ink | Default path for sections it can read | +| `onenote_parser` 2.1.0 (onenote.rs) | `crates/import/src/tagged.rs` (PR #693) | Sections with tags | Merged; falls back to the native reader for sections with pictures or files | +| OfficeIMO (.NET bridge) | `crates/import/src/officeimo.rs`, `notebook.rs` | Fallback when the native reader cannot read a section | Still in place; removal waits for the owner | + +onenote.rs is a dependency only through the tag reader. The native reader is NoteCraft's own code; +the onenote.rs project was used as a reference for the format. + +## Done + +- **Native reader** reads pages, text, pictures, files, tables and ink. Ink was ported from onenote.rs + (paths, bounds, offsets, scaling). Its stroke counts match onenote.rs on the two ink samples + (2 objects / 14 strokes, and 2 / 2). +- **Pictures and files keep their bytes.** Verified on the synthetic `attachment-formats.one` + (PNG, JPEG, GIF, BMP, SVG, a no-extension picture, a text file) in both HTML and CommonMark. +- **Picture type from the bytes.** A picture with no recorded extension gets its type from its first + bytes (`crates/parser/src/onenote/image.rs` in the onenote.rs checkout, and the matching path in + NoteCraft). The onenote.rs side is committed locally, not pushed. +- **Comparison with OfficeIMO** on six real sections and the synthetic attachment section. Same page + titles and wording. The native reader keeps pictures and files; OfficeIMO saves none. OfficeIMO + throws an exception on `Large Desktop.one`; the native reader imports it. +- **Ink import** (on `main`, PR #574) writes each page's ink to `ink.svg`. PR #702 (merged) adds the + original strokes beside it, in `ink-original.json`. +- **Synthetic sections** now carry the records onenote.rs requires. Twelve of fourteen synthetic + sections parse in onenote.rs with no errors; `broken.one` fails on purpose and `asset-pack.one` + fails on its deliberately missing picture. +- **Android** APK builds inside WSL, and `android/test.sh` passes on it. + +## Not done + +1. **Remove the OfficeIMO bridge.** Waiting on the owner's confirmation. Code to remove: + `crates/import/src/officeimo.rs`, the calls in `notebook.rs`, the packaging of the bridge, and its docs + (`docs/officeimo-bridge.md`). +2. **OfficeIMO fails on the synthetic attachment section** ("committed transaction has an invalid + sentinel checksum"). Likely a generator defect, not a real-file defect. Check before the comparison + can include attachments. +3. **Comparison on real notebooks with attachments.** Only the onenote.rs samples and OfficeIMO's own + test files have been run through both readers. +4. **Fixtures onenote.rs does not accept:** `asset-pack.one` (missing picture) and the revision-history + package (kept on the old layout; root cause not found). +5. **onenote.rs image fix not pushed.** Committed on `fix/image-extension-from-bytes` in the onenote.rs + checkout. Its `fork` remote is `AlienTechSoftware/onenote.rs`, so choose the remote first. +6. **Ink checks:** stroke width units against the app; a check in the running app; editing imported ink. +7. **Per-object drawing blocks** are not wired into import. Owner decision (RFC 0003, section 10). +8. **Android on a device.** The smoke test has not run; the WSL adb wrapper does not pass arguments through. + +## Tests that cover this + +- `crates/import/tests/attachment_formats.rs`: pictures and files, both formats, bytes kept. +- `crates/import/tests/ink_import.rs` and `ink_original.rs`: ink layer and original strokes, both formats. +- `crates/import/tests/synthetic_corpus.rs`: totals for the synthetic set. +- `crates/import/tests/section_shapes.rs`: page order, nesting and section groups. +- `crates/onenote` unit tests: ink decoding (signed integers, GUIDs). diff --git a/docs/releases/0.0.9/README.md b/docs/releases/0.0.9/README.md index c88163f6d..e1e5bd771 100644 --- a/docs/releases/0.0.9/README.md +++ b/docs/releases/0.0.9/README.md @@ -16,13 +16,7 @@ Version 0.0.9 focuses on three high-impact product and engineering outcomes. - **Internationalization** - prepare the app interface for translated catalogs, with persistent language selection, English fallback, and an initial language proof. Add French and Spanish versions of the standalone User Assistance guides as well. Follow the ArtCraft shared catalog - and runtime pattern; scope, estimate, and the compiler-version decision are recorded in - [`workspace_1.md`](workspace_1.md). - -### Issue candidates - -`_3` will review current GitHub votes and propose a limited set of issues. Add the selected issue -numbers and acceptance criteria here after verifying the current list. + and runtime pattern. ### Cross-platform quality gate @@ -53,12 +47,6 @@ See the private host proposal: - [`adr-onenote-rs-import-evaluation.html`](adr-onenote-rs-import-evaluation.html) - Proposal to consolidate on one import backend, with acknowledgements, tradeoffs, and cost analysis - `feature_plan.md` - Implementation plan -## Parallel Workspaces - -- [`workspace_1.md`](workspace_1.md) - Internationalization -- [`workspace_2.md`](workspace_2.md) - Infinite canvas -- [`workspace_3.md`](workspace_3.md) - Performance markers and voted GitHub issues - ## Links - **GitHub Issue #20:** https://github.com/AlienTechSoftware/notecraft/issues/20 - **GitHub Issue #31:** https://github.com/AlienTechSoftware/notecraft/issues/31 diff --git a/docs/releases/0.0.9/workspace_1.md b/docs/releases/0.0.9/workspace_1.md deleted file mode 100644 index 82c195b34..000000000 --- a/docs/releases/0.0.9/workspace_1.md +++ /dev/null @@ -1,82 +0,0 @@ -# Workspace 1: Internationalization - -**Release:** v0.0.9 -**Checkout:** `o-NoteCraft_1` -**Updated:** 2026-11-05 -**Status:** Partial implementation on `rc_0.0.9`. The shared runtime, persistent picker, French/Spanish catalogs, and `en-XA`/`ar-XB` modes are present. Full UI extraction, rendered-text audit, remaining demo locales, and User Assistance translations remain open. - -## Goal - -Implement [#31 Translatable UI](https://github.com/AlienTechSoftware/notecraft/issues/31) by routing every user-facing interface string through the ArtCraft-aligned localization runtime. Cover application chrome, dialogs, status text, tooltips, accessible names, and user-facing errors. Target the 13 locales represented in the demo notebook. Keep the standalone French and Spanish User Assistance work distinct from app UI localization. - -## ArtCraft pattern found in WordCraft - -- WordCraft embeds pinned locale catalogs at build time from `craft-i18n` and uses the shared `craft-libs` runtime for lookup, locale matching, English fallback, plurals, and pseudo-language support. -- Catalog data is separate from app code: `locales//common.tsv` holds shared strings and `.tsv` holds app strings and overrides. Rows contain context, English source text, and translation. -- There is no runtime network fetch. A build without catalog data is English-only; release builds can require the pinned catalogs. Web builds embed catalogs too. -- `cargo xtask i18n-report` reports missing or stale translations. A pseudo-language UI audit finds visible text that bypasses lookup. -- Useful read-only references in `.repos/storytold`: `wordcraft/crates/ui-egui/src/i18n.rs`, `wordcraft/crates/ui-egui/build.rs`, `wordcraft/crates/ui-egui/src/i18n/audit.rs`, `wordcraft/xtask/src/main.rs`, `craft-i18n/docs/integration.md`, and `craft-i18n/docs/catalog-format.md`. - -## NoteCraft baseline and approved decisions - -NoteCraft currently has no interface localization layer or locale catalogs. Its `crates/input-language` RTL keyboard detection is for editing behavior, not interface translation. Persistent app settings are managed through `notecraft_store::Settings`. - -The bundled Welcome notebook already has Spanish and French content: 15 authored demo pages in each locale, generated to both HTML and CMGFM. The separate User Assistance set under `docs/how-to/` has 16 Markdown files including its index, about 8,924 whitespace-delimited source words, and currently has no French or Spanish editions. These are distinct deliverables. The existing demo translations can inform terminology, but the standalone guides need their own accurate translations and working localized links. - -The owner approved reuse of the shared `craft-i18n` runtime and raising NoteCraft's minimum Rust version to 1.95. Keep NoteCraft-specific catalogs in this repository for now; do not edit the read-only `.repos/storytold` mirror or contribute catalogs to another repository without separate authorization. - -A coarse scan of NoteCraft's UI source found 441 capitalized string matches across 12 of 31 Rust files; this includes non-UI strings and is not a count of translatable labels. The existing `cargo xtask text` command checks text hygiene, not localization coverage. - -## Proposed v0.0.9 scope - -1. Route agreed user-visible interface strings through one lookup API, keeping command IDs, document content, file formats, and automation selectors language-neutral. -2. Embed pinned catalogs at build time for desktop and WebAssembly. Keep English-only builds working when catalogs are unavailable; require catalogs in release builds only after the build pipeline supplies them reproducibly. -3. Persist an interface-language setting with automatic system-locale selection and a manual picker. Keep it separate from notebook language groups and input/proofing language. -4. Add a pseudo-language UI audit and missing-catalog report. Missing translations fall back to English and remain reportable. -5. Extract all interface strings used by the app into the English source lookup set, then use marked pseudo-locales to find remaining untranslated UI. Offer `en-XA` and `ar-XB` in the interface language picker and persist them like other UI languages. Preserve the English source between `$$$` and `@@@`; wrap `ar-XB` output in RTL isolation controls. Their only locale-set exception is that they do not participate in the demo notebook. Do not add build flags in this phase. -6. Provide translations for the 13 demo locales to the best available quality. French is the first real-language pilot; review each locale separately and do not infer RTL readiness from translated strings. -7. Translate the standalone User Assistance guides and their index into French and Spanish under `docs/how-to/fr/` and `docs/how-to/es/`, keeping headings, instructions, code samples, feature limits, and intra-language links aligned with the English sources. Link both localized indexes from the English `docs/how-to/README.md`. - -Not included in this estimate: Welcome notebook translation, local date/number conventions, spell checking, IME behavior, full RTL mirroring, or all 27 WordCraft languages. - -## Acceptance criteria - -- All visible interface strings in the agreed scope use lookup; stable IDs and user data remain language-neutral. -- English-only builds work without external catalogs on desktop and WebAssembly. -- Catalog builds resolve translations and fall back to English for missing entries. -- Language selection persists. Automatic mode uses a supported system locale or English fallback. -- The picker offers the 13 demo languages once their UI catalogs are embedded, plus `en-XA` and `ar-XB`. Automatic system-locale matching never selects a pseudo-locale. -- All interface strings in the agreed UI surface use lookup, and the pseudo-language audit catches visible text that bypasses it; the report names missing translations without blocking ordinary development builds. -- Arabic rendering is reviewed in the real UI. Complete RTL layout claims require separate verification against the RTL requirements. -- `docs/how-to/` provides equivalent English, French, and Spanish indexes and guide coverage; localized links resolve within the same language set and technical instructions match current product behavior. -- Tests cover fallback, locale choice, persisted setting, representative UI text, and desktop/WASM builds. - -## Estimate - -Assuming shared runtime/catalog use and approval to raise the minimum Rust version: - -| Work | Agent estimate | Owner review | -|---|---:|---:| -| Runtime, build embedding, locale setting and picker | 1 session, 30-50k tokens | 30-45 min | -| UI string extraction, English baseline, pseudo-language audit and report | 2-3 sessions, 100-180k tokens | 1-2 hours | -| LTR and Arabic proof, regressions, desktop/WASM verification | 1-2 sessions, 50-90k tokens | 45-90 min plus native-speaker review | -| French and Spanish User Assistance (16 Markdown files, ~8,924 source words) | 1-2 sessions, 40-80k tokens | 1.5-2.5 hours plus native-speaker review | -| **Total** | **5-8 sessions, 220-400k tokens** | **about 4-6.5 hours plus native-speaker review** | - -Main unknowns are the MSRV/repository-boundary decision and the amount of manual work needed for dynamically composed UI labels. The UI string count remains unmeasured; the 8,924-word UA count includes Markdown and code and is a sizing measure, not a translation-ready word count. - -## Coordination - -- `_2` owns infinite canvas; `_3` owns performance markers and the voted-issue review. -- Coordinate changes to shared UI/test infrastructure before integration. -- Branch from `next` for implementation per the release branching guide. Preserve unrelated work in this checkout. -- Do not merge, push, or contribute to the shared catalog repository without explicit authorization. - -## Progress - -- 2026-11-05: Used the owner's `en-XA` and French screenshots as an audit pair. Added French entries for visible search/add-page/drop-file/status/ribbon labels, the notebook/item plurals, and the default-format status. Kept `START HERE` and page/notebook titles as notebook content, `Discord` as a product name, and `HTML`/`CommonMark + GFM` as stable format identifiers. Applied the selected locale before startup status text is created and refreshes that status on a language change. The UI and catalog regressions pass; full UI extraction and the remaining 11 demo-language catalogs remain open. -- 2026-11-05: Clarification: pseudo lookups preserve source English, using `$$$source@@@` for `en-XA` and RLI/PDI isolation around that marker for `ar-XB`; they do not distort the words. Both pseudo locales are selectable and persisted, excluded from automatic locale selection and demo content. Added code-drawn language flags to the Options and header pickers; full locale names remain visible in menus, with XA/XB codes in the header. Focused flag, locale, persistence, and pseudo tests pass, as do formatting, clippy, and release check. Full string extraction, 11 other demo-language catalogs, rendered-state audit, and visual owner review remain outstanding. -- 2026-11-05: Rebased the implementation branch onto `698943139f70211f4ce88a02f174383394d1733e`; resolved restore conflicts while retaining main's newer UI behavior. Added the shared-runtime adapter, persistent language picker, initial French catalog, and pilot UI test. The full string extraction and rendered-state audit are not complete, so the overall localization work is not ready for final inspection. -- 2026-11-05: Consolidated on `rc_0.0.9` at `d4637ce37d7e0261df29ffa138e9d171a509e3ee`. The current local pilot offers English, French, Spanish, `en-XA`, and `ar-XB`; only English is the complete fallback. Spanish and French are partial, the other demo locales are not offered, and the rendered-text audit and User Assistance translations remain outstanding. Focused locale tests and the full repository CI gate pass. -- 2026-11-04: Read-only WordCraft and Craft catalog/runtime research completed. The release README and this note record the proposed scope. No localization code or shared catalog changes have been made. -- 2026-11-04: Confirmed Spanish and French demo content exists, but the separate 16-file `docs/how-to/` guide set has no translations. Added French and Spanish User Assistance editions to this workstream; counted about 8,924 whitespace-delimited source words, including Markdown and code. diff --git a/docs/releases/0.0.9/workspace_2.md b/docs/releases/0.0.9/workspace_2.md deleted file mode 100644 index c12a345e6..000000000 --- a/docs/releases/0.0.9/workspace_2.md +++ /dev/null @@ -1,98 +0,0 @@ -# Workspace 2: Infinite canvas - -**Release:** v0.0.9 -**Checkout:** `o-NoteCraft_2` -**Updated:** 2026-11-05 -**Status:** Issue #22 implementation complete; issue #35 assigned to this workstream, plan pending owner checkpoint. - -## Goal - -Deliver the v0.0.9 infinite-canvas work, including GitHub issue [#22: Cannot draw on infinite canvas outside text blocks](https://github.com/AlienTechSoftware/notecraft/issues/22). The release README describes the target as reliable drawing outside text blocks and across empty page space. - -## GitHub issue #22 - -- **Taken into this workstream:** 2026-11-05. The issue directly matches the empty-canvas ink and pointer-routing scope below. -- **Issue status when checked:** Open, with no comments, on 2026-11-05. The issue asks for drawing across open canvas space and verification in both HTML and CMGFM pages. -- **Implementation:** pushed on `feat/v0.0.9-infinite-canvas` in commit `f2354b5` (canvas behavior) and integrated with current `main` in `6989431`. -- **Regression coverage:** `middle_drag_pans_the_canvas_for_html_and_cmgfm` exercises drawing in open space, panning and save/reload in both formats. `drawing_over_text_keeps_ink_above_the_page_without_editing_words` covers ink over text without changing words or caret. `an_unbounded_stroke_expands_and_round_trips_the_svg_view_box` covers negative and beyond-sheet stroke coordinates. -- **Remaining:** issue #22 is still open; no GitHub comment or close action was made. Owner smoke review with the target hardware and large-stroke responsiveness review remain outstanding. Linux tablet input is tracked separately in issue [#8](https://github.com/AlienTechSoftware/notecraft/issues/8); collecting scattered drawings in issue [#23](https://github.com/AlienTechSoftware/notecraft/issues/23) is not part of this fix. - -## Initial behavior before issue #22 implementation - -The repository has page-wide ink already. `crates/ui-egui/src/app.rs` lays out an ink body after the page blocks, reserves `max(1100pt, content height + 240pt)`, and calls `inkpad::show`. The page lives in a vertical `ScrollArea`; page colour and rule lines are painted behind it. `crates/ui-egui/src/inkpad.rs` stores strokes in page coordinates in `ink.svg`. The Draw tool's ink response therefore has a finite page surface that grows with content, rather than a truly unbounded canvas. Ink and background scrolling behavior is implied by this shared page layout; it has not been visually exercised in this investigation. - -The older `docs/releases/0.0.8/issue_infinte_canvas.md` describes the original bug as empty-space ink hit testing and gives criteria for drawing outside text blocks, keeping Write behavior, and saving/reloading both HTML and CMGFM. The current `app.rs` includes a finite sheet reservation intended to cover empty page space, but no UI test specifically covering these cases was found by source search. Runtime reproduction remains unverified. - -The private backlog's owner-priority section says to preserve continuous scrolling/backgrounds, pen/touch/keyboard switching, drawing performance, and related settings/theme controls. It explicitly says to confirm whether the desired behavior is seamless backgrounds as the page grows or a different infinite-canvas behavior. The backlog also says the page already scrolls vertically, grows with content, and creates a box when open paper is clicked; that click-to-create behavior is not missing work. `work/requests/pen-and-drawing.md` records that pressure is surfaced through winit on Windows; it does not establish device classification or automatic switching requirements for touch and keyboard. - -## Clarified scope and proposed acceptance criteria - -Owner direction (2026-11-05): include both continuous page behavior and an unbounded canvas interaction; the unbounded interaction is the priority. Existing zoom-out reduces page content only (50% to 250%) and does not navigate into open space around the finite page surface. Defer automatic pen/touch/keyboard switching. Keep manual Draw/Write selection. - -Proposed observable criteria: - -1. In Draw mode, a stroke can start and continue in empty canvas space beyond the current page area in all directions, including while the view is navigated; no text box or paragraph is created by drawing. -2. Existing text and box content retain stable positions relative to page-coordinate ink while zooming and navigating. -3. Page background/rules continue seamlessly as the page grows and through navigation, without a visible edge at the former reserved sheet boundary. -4. In Write mode, text editing and click-to-create-box behavior remain unchanged; canvas navigation uses a separately defined gesture and does not steal ordinary text clicks. -5. Ink remains editable and round-trips through `ink.svg` for HTML and CMGFM pages; zoom/pan do not alter stored stroke coordinates. -6. UI regression tests cover Draw versus Write event ownership, navigation, former sheet boundaries, and save/reload for both page formats. Record a repeatable large-stroke interaction/render workload and verify it has no severe responsiveness regression; set a numeric budget after measuring the baseline. -7. Do not add automatic input switching. State actual platform support based on available UI builds/tests; do not infer device support from Windows pressure data. - -Navigation gesture is still an implementation choice. Proposed baseline: middle-button drag pans the view; wheel scrolling remains vertical, with Shift+wheel horizontal. This preserves ordinary primary-button text/ink input and avoids relying on automatic device classification. Confirm during implementation design if existing egui behavior makes this gesture conflict. - -## Implementation checkpoint proposal - -Test-first work in `crates/ui-egui/tests/ui.rs` (and focused UI helpers if needed), then implementation primarily in `crates/ui-egui/src/app.rs` and `crates/ui-egui/src/inkpad.rs`; add a small platform-neutral viewport type only if the current app state cannot own the transform cleanly. No page format change is expected. Run focused UI tests, crate tests/clippy/fmt, then `cargo xtask ci` and relevant visual paired checks for HTML/CMGFM. - -Risk: egui scroll-area event ownership and the current text layout couple page coordinates to a finite body rectangle; pan/zoom must preserve caret, selection, ink hit testing, and persistence without intercepting normal editing. Estimate: 50-90k implementation tokens; owner review 45-75 minutes including build and UI smoke review. Biggest unknown: whether current UI automation can deterministically exercise 2D pan gestures and compare persisted ink across both formats. - -The detailed private backlog is `work/notecraft-improvements.md`, especially its owner-priority and open-work sections. This summary is included here so the checkout can coordinate from Git without depending on the private host. - -## Acceptance criteria - -Acceptance criteria 1, 2, 4, 5 and the UI portions of 6 are covered by the focused UI test for HTML and CMGFM. The ink crate regression test covers negative and beyond-sheet coordinates through save and reload. Automatic input switching remains deferred as requested. Criteria around continuous backgrounds through arbitrary navigation and a measured large-stroke responsiveness budget remain open for owner smoke review; no performance claim is made. - -## Coordination - -- At assignment, `_2` was clean on `main`. Inspect local `next` and remote state before creating a dedicated v0.0.9 feature branch. -- Keep canvas implementation in `_2`; do not force-switch branches or mix unrelated changes. -- Coordinate shared UI automation requirements with `_3` and check for regressions against `_1` localization. -- Do not merge or push without explicit authorization. -- This checkout has branch `feat/v0.0.9-infinite-canvas` based on `origin/next` (local `next` did not exist). `origin/next` and `fork/next` both pointed to `568b810` at investigation time. The branch was clean when created; the handoff note is now an untracked file on this branch. - -## Progress - -- 2026-11-04: Workstream assigned. No files or code were changed in `_2` by the coordination setup. -- 2026-11-05: Inspected current page/ink layout and the private drawing backlog. Confirmed finite sheet reservation, vertical scrolling, page-colour/rule painting and page-coordinate `ink.svg`. On 2026-11-05, the owner clarified that both continuous page behavior and an unbounded canvas are wanted, with the latter prioritized; input switching is deferred. Created `feat/v0.0.9-infinite-canvas` from `origin/next` and received the required CHECKPOINT nod. -- 2026-11-05: Added a failing-first integration test, then implemented 2D canvas navigation (middle-button drag, vertical wheel, Shift+wheel horizontal), continuous viewport background/rules, page-space ink hit testing and SVG viewBox growth for negative/outside-page ink. Added save/reload regression coverage. Verified HTML and CMGFM side-by-side at matching viewport/settings with test captures; visible ink remains in open space for both. -- Checks: `cargo fmt --all -- --check` PASS; `cargo test -p notecraft-ink` PASS (37 tests); `cargo test -p notecraft-ui-egui --test ui` PASS (123 tests); `cargo clippy -p notecraft-ink -p notecraft-ui-egui --all-targets -- -D warnings` PASS; `cargo xtask ci` PASS (workspace suite and all repository gates); `git diff --check` PASS. -- Remaining owner smoke review: manually exercise large strokes and background continuity while panning/scrolling in the Windows app; large-stroke responsiveness has not been benchmarked. The issue #22 implementation was committed, pushed, and merged; the later ink-over-text fix is also on `main` and deployed to the browser demo. -- 2026-11-05 follow-up: owner clarified that ink must render above text and drawing over text must not move the caret or alter page words. Added `drawing_over_text_keeps_ink_above_the_page_without_editing_words`; fixed Draw-mode pointer handling to preserve the caret and selection while the foreground ink layer owns the gesture. `cargo test -p notecraft-ui-egui --test ui` passes (124 tests), `cargo xtask ci` passes, and `cargo build -p notecraft` passes. Relaunched the rebuilt app against a fresh temporary notebook folder containing one Welcome notebook. -- 2026-11-05 z-order follow-up: documented the UI and content z-order guidance in `SKILLS/nc-uiux-z-order`; fixed the pen palette to own pointer input above the page canvas so strokes cannot select text underneath it. Added regression test `pen_palette_owns_pointer_input_over_the_page_canvas`. Commits `7510193` and `0dc3bda` were merged into `main` at `68fa45a`. The main deployment workflow 42109527763 succeeded, and the live demo was visually verified. - -## GitHub issue #35: Preserve OneNote colors on import - -- **Assignment:** Owner assigned issue [#35](https://github.com/AlienTechSoftware/notecraft/issues/35) to `_2` on 2026-11-05. Issue remains open. No GitHub response or issue change was made. -- **Reported behavior:** OneNote notebook and section tab colors are lost on import. The reported backup may contain `.one` files without its `.onetoc2` table of contents; the issue requests a sample `.onetoc2` file, which is not currently attached. -- **Cause found:** `crates/import/src/discover.rs` scans `.one` files and classifies `.onetoc2` as ignored. `crates/onenote/src/store.rs::read_header` explicitly rejects TOC files. The importer creates notebook/section nodes without assigning colors. The destination already persists `NodeColor` through `ops::set_color`. -- **Format evidence:** Microsoft's published MS-ONE specification declares `NotebookColor` on the TOC notebook record and each TOC section record; section metadata in a `.one` file also declares `NotebookColor`. The TOC section record includes the section identity and filename for association. The current property parser supports nested property sets, so the likely approach is a bounded TOC reader plus safe matching to discovered section files, while retaining `.one` section color when no TOC exists. A notebook color cannot be recovered from a backup lacking the TOC unless another specified source exists; do not infer it from a section color. -- **Proposed scope:** preserve notebook color when a supported `.onetoc2` is present; preserve section colors from available specified metadata, preferring TOC entries when available and falling back to `.one` metadata. Missing or malformed optional TOC data must not prevent importing valid sections. Keep section order, `.onepkg`, and unrelated import capabilities out of this issue unless the owner expands scope. - -### Proposed acceptance criteria - -1. Importing a fixture notebook with a `.onetoc2` and multiple colored sections preserves notebook and section colors in the resulting NoteCraft tree. -2. Importing valid `.one` files without `.onetoc2` still succeeds and preserves any section color encoded in the `.one` metadata; notebook color remains unspecified when no supported source provides it. -3. A missing, malformed, or unsupported `.onetoc2` does not block otherwise valid `.one` imports, and invalid/undefined color values are ignored safely. -4. A TOC section's color is applied only to the matching section file, using spec-defined identity/filename data rather than folder order or a guessed color. -5. Regression tests use checked-in/synthesized real parser inputs and real temporary folders, with no mocks. Cover color persistence through the import result and verify existing imports without TOC remain unchanged. - -### Proposed implementation and verification - -Likely files: `crates/onenote/src/store.rs` and a focused TOC parser module/tests; `crates/import/src/discover.rs` and `crates/import/src/lib.rs` plus importer integration tests; format research notes if the spec findings need recording. First write failing tests for the criteria, confirm they fail, then implement. Keep import optional-TOC handling separate from `.onepkg` support. - -Focused checks: `cargo test -p notecraft-onenote`; `cargo test -p notecraft-import`; `cargo fmt --all -- --check`; `cargo clippy -p notecraft-onenote -p notecraft-import --all-targets -- -D warnings`; then `cargo xtask ci` and `git diff --check`. Run repository link checks if the research/design docs change. - -**Risk:** No representative `.onetoc2` sample is attached to #35, and the current parser rejects that file type. Format parsing, color-value mapping to NoteCraft's named palette, and stable TOC-entry-to-file matching need confirmation from Microsoft's published spec and preferably a sanitized owner sample. Unknown values must remain unset rather than guessed. - -**Estimate:** 20-35k implementation tokens; owner review 30-45 minutes including a sample-based import inspection. This is a substantial import feature and requires an owner `CHECKPOINT` before code changes under the repository contract. No implementation has started. diff --git a/docs/releases/0.0.9/workspace_3.md b/docs/releases/0.0.9/workspace_3.md deleted file mode 100644 index 19b4c05f3..000000000 --- a/docs/releases/0.0.9/workspace_3.md +++ /dev/null @@ -1,42 +0,0 @@ -# Workspace 3: Performance markers and voted issues - -**Release:** v0.0.9 -**Checkout:** `o-NoteCraft_3` -**Updated:** 2026-11-06 -**Status:** Issue #35 color-import fix is ready to test on `feat/import-section-color`; performance markers remain pending. - -## Goal - -Work on performance markers and a limited set of highly voted NoteCraft GitHub issues. - -## Performance markers - -The v0.0.9 release plan calls for low-overhead, repeatable measurements covering startup, page loading, editing, saving, search, and rendering. Review the existing instrumentation and the private host's `work/PERF_INSTRUMENTATION.md` and `work/releases/` notes before selecting markers, storage, opt-in behavior, and acceptance criteria. This summary keeps the work visible to all checkouts through Git. - -## GitHub issue selection - -Use a read-only review of the current NoteCraft issue list. Record each candidate's issue number, title, vote/reaction count, date checked, and fit for v0.0.9. Select a bounded set alongside performance work, then record issue numbers and acceptance criteria in this file and the v0.0.9 release README. Do not post comments, reactions, or status updates to GitHub. - -### Selected candidates - -Checked 2026-11-05. Both currently have zero reactions. - -- [#19: errors with import of existing OneNote notebooks](https://github.com/AlienTechSoftware/notecraft/issues/19) - Strong fit: import reliability is important to users bringing existing notes into NoteCraft. Scope and acceptance criteria need investigation. -- [#35: Keep the notebook color when importing from OneNote](https://github.com/AlienTechSoftware/notecraft/issues/35) - Bounded fit. Preserve notebook colors from `.onetoc2`, section colors from TOC entries or `.one` metadata, and keep malformed optional TOCs from blocking section imports. Imported colors map lossily to NoteCraft's named palette. - -### Additional tracked issue - -- [#31: Translatable UI](https://github.com/AlienTechSoftware/notecraft/issues/31) - Track the remaining work to extract and translate user-visible interface strings across the 13 demo locales. `_1` owns the i18n implementation; coordinate scope and avoid duplicating that work here. - -## Coordination - -- At assignment, `_3` was clean on `fix/macos-ui-table-test`. Inspect its history and purpose before switching branches; preserve that branch work. -- Verify local `next` and remote state before creating a v0.0.9 feature branch. Do not force-switch branches. -- Keep performance and issue fixes in `_3`. Coordinate UI automation work with `_1` and `_2`. -- Do not merge or push without explicit authorization. - -## Progress - -- 2026-11-04: Workstream assigned. No issue vote audit or code changes have been made in `_3` by the coordination setup. -- 2026-11-05: Added PII-safe synthetic importer regression coverage: embedded PNG/SVG and generic file bytes survive HTML and CMGFM imports; missing image data is reported without losing page text; a damaged neighboring section does not block the valid section. Native OneNote ink is not covered because the current parser has no ink content type. This does not yet reproduce the reporter's specific #19 notebook failure. -- 2026-11-06: Rebased `feat/import-section-color` onto `origin/main` at `1623775`. The owner approved using the public onenote.rs and OfficeIMO source as corroboration for the otherwise undocumented `NotebookColor` property ID. Scope stays import-only; importer selection remains undecided. Added PII-safe synthetic `.one` and `.onetoc2` fixtures and tests for TOC precedence, section metadata fallback, undefined colors, identity matching, malformed TOCs, and both page formats. Verification passed: `cargo fmt --all -- --check`, focused clippy for `notecraft-onenote` and `notecraft-import`, `cargo test -p notecraft-onenote`, `cargo test -p notecraft-import`, `git diff --check`, and full `cargo xtask ci`. The importer corpus suite reports 2 documented large Git LFS cases ignored; all remaining tests pass. No commit or push was made. diff --git a/docs/rfc/README.md b/docs/rfc/README.md new file mode 100644 index 000000000..672cd242b --- /dev/null +++ b/docs/rfc/README.md @@ -0,0 +1,21 @@ +# RFCs + +Design RFCs for NoteCraft, one folder per skill or kind. Each RFC is a +permanent, versioned record: its status, decisions and changelog live in the +document itself. RFC versions are independent of app versions. + +| Folder | Kind | RFCs | +|---|---|---| +| [`dom-ser/`](dom-ser/) | The page document object model and its serialization | [0001](dom-ser/0001-notecraft-dom.md) (draft), [0002](dom-ser/0002-edit-render-modes.md) (draft, interim), [0003](dom-ser/0003-ink-drawing-block.md) (accepted) | +| [`uiux/`](uiux/) | UI and interaction decisions (ADRs) | [0001](uiux/0001-clipboard-boundary.md) (accepted) | +| [`release/`](release/) | Release, versioning and update decisions | [0002](release/0002-release-detection.md) (accepted in part) | + +## Rules + +- One folder per skill or kind, named after the skill (for example `dom-ser`). +- File names are `-.md`, numbered from 0001 within the folder. +- An RFC's status (Draft, Accepted, Superseded) is stated in its header table + and updated there, never by moving the file. +- Changes to an RFC bump its own version and add a changelog row. App versions + do not change an RFC's version. +- New RFC folders need the owner's approval, like any new `docs/` folder. \ No newline at end of file diff --git a/docs/rfc/dom-ser/0001-notecraft-dom.md b/docs/rfc/dom-ser/0001-notecraft-dom.md new file mode 100644 index 000000000..7b4a10bb0 --- /dev/null +++ b/docs/rfc/dom-ser/0001-notecraft-dom.md @@ -0,0 +1,576 @@ +# RFC 0001: The NoteCraft document object model (DOM) + +| Field | Value | +|---|---| +| RFC | 0001 | +| Title | The NoteCraft document object model | +| Status | Draft, for owner review. Not accepted. | +| Version of this RFC | `dom-rfc 0.1-draft` | +| Versioning | Independent of the app version. This RFC's version changes only when this document changes. | +| Owner | The NoteCraft owner, with `nc-dom-ser` as the working skill | +| Affects | `crates/formats`, `crates/model`, `crates/ui-egui` (page editor), page files in both formats, `docs/dom_serialization/` | +| Related | `SKILLS/nc-dom-ser/references/object-types.md`, `SKILLS/nc-dom-ser/references/naming-convention.md`, `SKILLS/nc-uiux-bidi/references/caret-options.md`, `SKILLS/nc-design-artcraft-integration/references/wordcraft_x_notecraft_dom.md` | +| Appendix | A: Integration with other Craft apps (WordCraft as primary candidate) | + +--- + +## 1. Summary + +NoteCraft pages are stored as HTML or CommonMark-plus-GFM files. In memory they are a tree of +objects. This RFC defines that tree: what an object is, how it is named, which fields it has, how +each field is versioned, which objects may contain other objects, and how objects that this build +does not understand are kept and written back unchanged. + +It also fixes the rules that let the document model evolve without breaking old files, old builds, +or other Craft apps that later read the same objects. + +## 2. Terms + +- **DOM** here means the semantic page model: the tree the editor works on and the serializers read + and write. It does not mean the browser DOM. This is the meaning already used in + `docs/dom_serialization/README.md`. +- **Object**: one node of the tree. Every object has a kind, a version, an identifier and a payload. +- **Kind**: the identifier of an object type, in the form `family.kind` (for example `inline.image`). + It is the contract that is stored in files. +- **Payload**: the fields of an object, as defined by its kind and version. +- **Schema**: the list of fields, types, requirements, children and extension points of one kind at + one version. +- **Opaque object**: an object whose kind or version this build does not know. It keeps its original + bytes and is written back unchanged. +- **Inline object**: an object that sits in a paragraph's text as one character position. +- **Block object**: an object that sits in the body as a block of its own. +- **Container**: an object whose payload is a list of child blocks. + +## 3. Goals and non-goals + +### 3.1 Goals + +1. **Stable identity.** Every object type has a name that never changes once written. +2. **Explicit schema.** Every field is declared. Unknown fields are not silently accepted. +3. **Independent evolution.** A kind can gain a field or a new version without breaking older readers, + and without forcing an app release. +4. **Lossless unknowns.** Objects this build does not understand survive a load and save. +5. **Format parity.** A page means the same thing in HTML and CommonMark-plus-GFM. Where one format + cannot express an object, the RFC says so and says how the object is still preserved. +6. **Room for other apps.** An object created by another Craft app can live in a NoteCraft page and + come back unchanged. +7. **Testable.** Every rule in this RFC has a test that the build runs. + +### 3.2 Non-goals + +- This RFC does not define the editor's caret or layout. That is `caret-options.md`. +- It does not change the folder format of notebooks, sections or pages. +- It does not define DOCX import or export. Appendix A only maps names. +- It does not define the details of style, attributes or formats. They are stored as part of the + DOM (section 5.1), so this RFC names where they live and how they are versioned. Their content and + rules are defined in their own specifications: the theme and UI skills for visual style, and + `nc-dom-ser` and `docs/dom_serialization/` for file formats. + +## 4. Architecture + +```mermaid +flowchart LR + F1[HTML page file] -->|read| R[Reader] + F2[CMGFM page file] -->|read| R + R --> M[Object tree] + M -->|editor| E[Page editor] + E --> M + M -->|write| W1[HTML writer] + M -->|write| W2[CMGFM writer] + W1 --> F1 + W2 --> F2 + M --- S[(Schema registry
      kind, version, fields)] + R --- S + W1 --- S + W2 --- S +``` + +The **schema registry** is the single source of truth for what a kind and version contains. The +reader, both writers, the editor and the tests all read the registry. No code keeps its own list of +fields. + +Layers, following `cargo xtask layers`: + +| Layer | Crate | Responsibility | +|---|---|---| +| Low | `notecraft-model` | The object tree types, identifiers, schema registry, version rules. No I/O. | +| Middle | `notecraft-formats` | Readers and writers for both formats. Uses the model. | +| High | `notecraft-ui-egui` | The page editor. Uses the model. Never defines a field itself. | + +## 5. The object record + +Every object, in memory and in the file, has the same record shape. + +```rust +/// One object of the page tree. The payload is parsed only when the kind and version are known. +pub struct ObjectRecord { + /// The contract: `family.kind`. Never changes once written. + pub kind: Kind, + /// Version of this kind's schema that the payload was written with. + pub version: u16, + /// Stable instance id within the page. Set when the object is created or imported. + pub id: Option, + /// Where the object came from. Set once; kept on save. + pub origin: Origin, + /// Known fields, as the schema for `kind` and `version` defines them. + pub fields: Fields, + /// Child objects, only if the schema allows children for this kind. + pub children: Vec, + /// Named extensions, only at the points the schema declares. + pub extensions: Vec, +} + +/// The raw form of an object this build cannot interpret. +pub struct Opaque { + pub kind: String, + pub version: u16, + pub id: Option, + pub origin: Origin, + /// The payload exactly as read: HTML fragment, or CMGFM text, or both. + pub raw: RawPayload, +} +``` + +| Field | Stored in file | Required | Notes | +|---|---|---|---| +| `kind` | yes | yes | The identifier. Format: `family.kind`. | +| `version` | yes | yes | Integer, starting at 1. See section 7. | +| `id` | yes, when present | no for inline objects that nothing refers to; yes once anything refers to them | Unique within its page. See section 6.3. | +| `origin` | yes | yes | `notecraft`, `onenote-import`, `wordcraft-import`, `ext.`. Set once. | +| `fields` | yes | per schema | Only the fields the schema defines. Nothing else. | +| `children` | yes, when the kind allows children | per schema | Ordered. | +| `extensions` | yes, when present | no | Namespaced. See section 8. | + +There is no catch-all field. Anything not in the schema is either an error (in a known version) or +the whole object is opaque (in an unknown version). + +### 5.1 Style, attributes and formats + +Three kinds of data are stored as part of the DOM. This RFC places them and versions them; it does not +define their content. + +| Kind of data | Where it lives | Defined by | +|---|---|---| +| **Style** (named styles that objects refer to, for example a heading level or a character style) | a style table in the page header, referenced by `style` in an object's fields | a later RFC on styles | +| **Attributes** (typed properties of one object, for example width, alt text, alignment) | the object's `attrs`, declared in its schema | the kind's schema (section 10) | +| **Formats** (the page format and each object's format-specific form) | the page header (`data-nc-format`, `nc_format`) and the format mapping (section 9) | `nc-dom-ser` and `docs/dom_serialization/` | + +Rules that apply to all three, and that this RFC does define: + +1. Each is stored in the file, so a reader that loads a page and writes it back keeps them. +2. Each is versioned with the object or page that uses it: a style table has its own version, and an + attribute change follows the kind's version rules (section 7.2). +3. An unknown style name is kept as it is, like an unknown object. It is not replaced by a default. + +## 6. Identity, naming and placement + +### 6.1 Three names per kind + +| Name | Rule | Stored | +|---|---|---| +| Kind (identifier) | `family.kind`, lower case, dot separated | yes | +| Rust name | PascalCase; WordCraft's name where WordCraft has the object | no | +| Format form | HTML tag and class; CMGFM syntax | no (derived) | + +Families are fixed: `block`, `inline`, `container`, `onenote`, `ext`. A new family needs an ADR. + +Full rules and the table of kinds are in `naming-convention.md` and `object-types.md`. This RFC does +not repeat them; it depends on them. + +### 6.2 Placement + +Every kind is either inline or block. The schema says which. + +```mermaid +flowchart TD + P[Paragraph text] --> C1[character] + P --> O1[inline object
      one character position] + P --> C2[character] + B[Body] --> BL1[paragraph] + B --> BL2[block object] + B --> BL3[container] + BL3 --> BL4[child blocks] +``` + +An inline object occupies one character position in its paragraph's text. A block object is a body +child. + +### 6.3 Object identity + +An `ObjectId` is needed when something refers to an object: a comment, a link, a search result, a +caret placement, an ink stroke that belongs to an image, or an import match. + +- Format: `o_` followed by 8 to 16 lower-case hex digits, unique within the page. +- Assigned when the object is created or imported, and kept on every save. +- An id is never reused in the same page, even after the object is deleted. +- An object without an id is not referenced by anything. Writers may omit it. + +```html +
      + A harbour at dusk +
      +``` + +## 7. Versioning + +### 7.1 Two version lines + +| Line | What it versions | Where it is stored | +|---|---|---| +| Format version | the file layout and the page header | `data-nc-format` in HTML; front matter key `nc_format` in CMGFM | +| Kind version | one object kind's fields | `data-nc-version` in HTML; a `version` attribute in the CMGFM object marker | + +A page has one format version. Each object has its own kind version. A page can contain a kind at +version 1 and another at version 2. + +### 7.2 When a version changes + +| Change | Kind version | Compatibility | +|---|---|---| +| Add an optional field | no change | Old readers ignore it only if the field is optional and has a default; otherwise see below | +| Add a required field | new version | Old readers keep the object opaque | +| Remove a field | new version | Old readers keep the object opaque | +| Change a field's type or meaning | new version | Old readers keep the object opaque | +| Rename a field, same meaning | no change; add an alias for one version | Documented in the schema | +| Change allowed children | new version | Old readers keep the object opaque | +| Change allowed extensions | no change for adding a named point; new version for removing one | As above | + +Rule: **an optional field may be added without a new version only if an old reader that ignores it +loses nothing when it writes the object back.** If in doubt, bump the version. + +### 7.3 Reader behaviour + +```mermaid +sequenceDiagram + participant File + participant Reader + participant Registry + participant Model + File->>Reader: object kind=inline.image version=2 + Reader->>Registry: schema(inline.image, 2)? + alt version known + Registry-->>Reader: schema + Reader->>Model: parse fields strictly + Model-->>Reader: ObjectRecord + else version unknown + Registry-->>Reader: none + Reader->>Model: keep as Opaque (raw bytes) + else kind unknown + Registry-->>Reader: none + Reader->>Model: keep as Opaque (raw bytes) + end +``` + +Writing: + +- A known object is written from its fields, with its kind and version. +- An opaque object is written from its raw bytes, unchanged. +- The page's format version is the highest the writer needs for the objects it writes. It is never + lowered on save. + +### 7.4 Parse errors + +A known kind and version with a missing required field, or with an unknown field, is an error. The +reader reports it with the object's kind, version, id and location. It does not guess. The page still +opens: the object is kept as opaque and the user is told, so nothing is lost. + +## 8. Children and extensions + +### 8.1 Children + +Each kind declares what it may contain. Allowed values: + +| Allowed children | Meaning | Example kinds | +|---|---|---| +| `none` | no children | `inline.image`, `block.rule`, `block.math` | +| `spans` | text runs with marks | `block.paragraph`, `block.heading`, `block.quote` | +| `blocks` | a list of block objects | `container.box`, `container.callout` | +| `cells` | table cells, each holding spans or blocks | `block.table` | + +```mermaid +classDiagram + class ObjectRecord { + +kind + +version + +id + +origin + +fields + +children + +extensions + } + class Container { + children: blocks + } + class Paragraph { + children: spans + } + class Table { + children: cells + } + class Image { + children: none + } + ObjectRecord <|-- Container + ObjectRecord <|-- Paragraph + ObjectRecord <|-- Table + ObjectRecord <|-- Image + Container o-- ObjectRecord : blocks + Table o-- Cell : rows +``` + +A child may not be of a kind its parent forbids. The reader checks this and treats a violation like a +parse error. + +### 8.2 Extensions + +An extension is a named piece of data attached to an object, keyed `ext..`. Extensions +are how another Craft app, or a later NoteCraft feature, can add data to an object without changing +its kind. + +Rules: + +1. A kind declares its extension points in its schema: which names are allowed, and whether the point + is per object or per field. +2. An extension is never a core field. A reader that does not know an extension keeps it and writes it + back unchanged. A known field is never stored as an extension. +3. An extension has its own version. Its owner keeps it compatible. +4. An unknown extension never makes the object opaque. Only an unknown kind or version does. + +Example (HTML): + +```html +
      + A harbour at dusk + +
      +``` + +The script element is inert in HTML and is never executed; it is used only as a data carrier. The +exact carrier for each format is part of the format sections below and needs its own test. + +## 9. Format mapping + +### 9.1 HTML + +- One `
      `, `
      `, `

      `, `` or other element per object. The element is chosen by the + kind's schema. +- Every object carries `data-nc-kind`, `data-nc-version`, and `data-nc-id` when it has an id. +- Known fields are written as attributes or as child elements, as the schema says. Text is text. +- Unknown objects are written as the raw element they were read from. + +### 9.2 CommonMark plus GFM + +CommonMark has no general object syntax. The rules: + +- An object with a native CommonMark form uses it (for example an image embed with alt text and a + source path, for `inline.image`). +- An object without one is written as an HTML block with the same `data-nc-*` attributes, in a fenced + marker that CommonMark renders as HTML. The marker is documented in the schema. +- The file's front matter carries `nc_format`. + +```markdown + +This is a callout inside a paragraph. + +``` + +### 9.3 Parity + +Both formats must mean the same page. The parity test compares the object tree read from each format. +Pixel parity is checked by hand, as `nc-dom-ser` already requires. + +Where one format cannot express an object, the object is recorded in the parity exceptions with its +reason and its fallback. An owner decision is needed for each exception. + +## 10. The schema registry + +```rust +pub struct KindSchema { + pub kind: &'static str, // "inline.image" + pub version: u16, // 1 + pub placement: Placement, // Inline or Block + pub fields: &'static [FieldDef], // the only fields allowed + pub children: ChildRule, // None, Spans, Blocks, Cells + pub extensions: &'static [ExtPoint], + pub html: HtmlForm, // element and attributes + pub cmgfm: CmgfmForm, // native syntax or marker + pub status: Status, // Current, Deprecated, Retired +} + +pub struct FieldDef { + pub name: &'static str, + pub ty: FieldType, + pub required: bool, + pub since: u16, // the version that added it +} +``` + +Rules for the registry: + +- Every kind that the code can produce is in the registry. A kind that is not in the registry is + opaque on read. +- A `Retired` kind keeps its entry forever, so old files still read. +- The registry is generated or checked by a test against `object-types.md`. The two must match. + +## 11. Testing + +Each rule in this RFC has a test. Required test groups: + +| Group | What it proves | +|---|---| +| Round trip, HTML | Read then write an HTML page; the bytes are the same except for normalised whitespace the RFC allows. | +| Round trip, CMGFM | The same for CommonMark-plus-GFM. | +| Parity | The object tree from an HTML page equals the tree from its CMGFM twin. | +| Unknown kind | A page with an unknown kind loads; the object is opaque; saving keeps its bytes. | +| Unknown version | A page with a known kind at a newer version loads; the object is opaque. | +| Unknown extension | An object with an unknown extension keeps it through a save. | +| Strict known version | A known kind with an unknown field is reported, not silently dropped. | +| Children rule | A forbidden child kind is reported. | +| Identity | Ids are unique in a page; a deleted id is not reused. | + +```rust +#[test] +fn an_unknown_kind_survives_a_round_trip_unchanged() { + let page = r#"

      +

      kept

      "#; + let tree = read_html(page).expect("reads"); + let out = write_html(&tree); + assert_eq!(normalise(&out), normalise(page)); +} +``` + +Tests must not use mocks. Use real page files and the real readers and writers, per `AGENTS.md`. + +## 12. Migration and compatibility + +- The current model (`Block` and `Span` in `notecraft-formats`) is the starting point. Its types map to + kinds in the registry; the mapping is written as a table in `object-types.md`. +- Existing files keep reading. A file with no kind or version is read as the current version of its + implied kind. +- No file is rewritten on load. A file changes only when the user edits it, or when a migration is + run on purpose, and the migration is listed in this RFC before it ships. +- Every change to the registry is a change to this RFC's version as well: a new field or version + requires an entry in section 14. + +## 13. Open questions + +1. Whether a container's children can be a mix of blocks and tables. Proposed: yes, with the mix + listed in the schema. +2. The exact CMGFM marker for objects that have no native syntax. Proposed: the HTML-block form in 9.2. +3. Whether `origin` is needed on every object or only on imported ones. Proposed: every object, so a + later import can match. +4. How much of an opaque object's raw bytes is kept when a writer changes the page around it. + Proposed: the whole raw form, unchanged. +5. The carrier for extension data in HTML (section 8.2). Proposed: the inert script element, to be + confirmed by a test that the page's behaviour is unchanged. + +## 14. Changelog of this RFC + +| RFC version | Date | Change | +|---|---|---| +| 0.1-draft | 2026-11-12 | First draft. | +| 0.1-draft (r2) | 2026-11-12 | Style, attributes and formats are stored in the DOM; their details are deferred (sections 3.2, 5.1). | + +--- + +## Appendix A: Integration with other Craft apps (WordCraft as primary candidate) + +WordCraft is the primary candidate for integration: it already has a document model with fields, +objects, paragraphs and runs, and it is a Craft app that ships. This appendix maps NoteCraft's +proposed names to WordCraft's names, so that a shared object model, or an import and export between +the two, can be planned against one table. + +### A.1 Sources and their status + +| Source | Used for | Status | +|---|---|---| +| `storytold/wordcraft/crates/doc/src/block.rs` | `Block`, `Blocks` | read | +| `storytold/wordcraft/crates/doc/src/para.rs` | `Paragraph` | read | +| `storytold/wordcraft/crates/doc/src/para/run.rs` | `Run` | read | +| `storytold/wordcraft/crates/doc/src/para/inline_object.rs` | `InlineObject` variants | read | +| `storytold/wordcraft/crates/doc/src/position.rs` | `Pos` | read | +| `storytold/wordcraft/crates/doc/src/lib.rs` | `Document` | read | +| `storytold/wordcraft/crates/doc/src/control.rs` | content controls | read (header) | +| `storytold/wordcraft/crates/doc/src/cluster.rs` | cluster rules | read (header) | +| `storytold/wordcraft/docs/architecture.md` | list of model parts | read | +| `storytold/wordcraft/docs/typing-parity.md` | editing rules | read (sections) | +| WordCraft names not listed above (`Frame`, `ListItem`, `ContentControl`, `ChartSpec`, `Fill`) | named in the architecture notes and in an earlier survey | **to be verified** against the source before this appendix is accepted | + +### A.2 Mapping table + +Columns: NoteCraft kind (proposed), WordCraft name, relation, note. + +Relations: **same** (same meaning), **close** (similar, with a difference noted), **none** (no WordCraft +equivalent), **WC-only** (WordCraft has it, NoteCraft does not propose it yet). + +| NoteCraft kind | WordCraft name | Relation | Note | +|---|---|---|---| +| `block.paragraph` | `Block::Para(Paragraph)` | close | WordCraft's paragraph is one text stream with runs and objects; ours is spans per block. See the RFC's section 13 and the caret notes. | +| `block.heading` | paragraph with a heading style (`props`) | close | WordCraft has no heading kind; a heading is a style. | +| `block.item` | paragraph with list props (`ListItem` in the survey) | close | WordCraft's list membership is in paragraph properties. Verify the `ListItem` name. | +| `block.quote` | paragraph with a quote style | close | Style-based in WordCraft. | +| `block.code` | paragraph with a code style, or none | close | WordCraft has no code block kind in `Block`. | +| `block.math` | `InlineObject::Equation` in a paragraph, or an equation block | close | WordCraft's equations are inline objects. | +| `block.rule` | paragraph border or a section break | close | Different mechanism. | +| `block.table` | `Block::Table(Table)` | same | Cells, rows and nested content. | +| `block.container` | text box (`MAX_TEXT_BOX_DEPTH`) | close | WordCraft's text boxes nest to a depth limit. Verify whether the name is `Frame`. | +| `inline.image` | `InlineObject::Image` | same | | +| `inline.graphic` | `InlineObject::Graphic` | same | | +| `inline.shape` | `InlineObject::Shape` | same | | +| `inline.group` | `InlineObject::Group` | same | | +| `inline.field` | `InlineObject::Field` | same | | +| `inline.field.start` | `InlineObject::FieldStart` | same | | +| `inline.field.end` | `InlineObject::FieldEnd` | same | | +| `inline.control` | `InlineObject::ControlStart` and `ControlEnd` | same, paired | Pair markers in WordCraft; ours will also pair. | +| `inline.bookmark.start` | `InlineObject::BookmarkStart` | same | | +| `inline.bookmark.end` | `InlineObject::BookmarkEnd` | same | | +| `inline.comment.start` | `InlineObject::CommentStart` | same | | +| `inline.comment.end` | `InlineObject::CommentEnd` | same | | +| `inline.equation` | `InlineObject::Equation` | same | | +| `inline.ruby` | `InlineObject::Ruby` | same | | +| `inline.tab` | `InlineObject::PositionalTab` | close | WordCraft's is a positional tab stop, ours is a tab character. | +| `inline.break` | `LINE_BREAK` and `PAGE_BREAK` constants | same | WordCraft has them as characters in the text. | +| `inline.perm.start` | `InlineObject::PermStart` | same | Not yet proposed by NoteCraft. Listed for completeness. | +| `inline.perm.end` | `InlineObject::PermEnd` | same | As above. | +| `inline.note-ref` | `InlineObject::NoteRef` | same | Not yet proposed. | +| `ext.opaque` | `InlineObject::Opaque` | same | Both keep unknown content. | +| `onenote.ink` | none | none | OneNote ink has no WordCraft object. | +| `onenote.tag` | none | none | WordCraft has no OneNote tags. | +| `onenote.attachment` | `InlineObject::Image`, or a media part | close | WordCraft stores media in `Document::media`. | +| `onenote.pagelink` | a hyperlink run property | close | Not an object in WordCraft. | +| `onenote.stamp` | `InlineObject::Field` (date field) | close | Verify. | +| `onenote.audio` | none | none | | +| `onenote.video` | none | none | | +| `onenote.printout` | none | none | | +| `container.callout` | none | none | Proposed; no WordCraft equivalent. | +| WC-only: `Shape` group nesting, `ChartSpec`, `Fill` | `ChartSpec`, `Fill` (in the survey) | WC-only | Verify names. NoteCraft has no chart object yet. | + +### A.3 What the mapping means + +- Most inline kinds map one to one. The two models can exchange them without loss if the field sets + agree. The field sets are not yet compared; that is the next step. +- The biggest difference is the text model. WordCraft's paragraph is one stream; ours is per-block + spans. A shared model would need one of the two to change. This is the decision in + `caret-options.md`, option B. +- OneNote-specific kinds have no WordCraft counterpart. They need `ext.artcraft.*`-style extensions if + WordCraft is to carry them, or a shared `onenote` family in the shared library. The owner decides. + +### A.4 Next steps for the integration + +1. Verify every WordCraft name marked **to be verified** against the source. +2. Compare the field sets of each `same` row. +3. Decide whether the shared family is `ext.` (per app) or a shared crate. +4. Write the import and export tests for the `same` rows first. + +--- + +## Appendix B: How this RFC will be used + +- It lives in `docs/rfc/dom-ser/` as the permanent home for this RFC. +- Changes to the RFC bump its own version (section 14). App versions do not change it. + +## 5.3 Generated objects and the user's content + +A generated object (OCR text, boxes, descriptions) is a sidecar beside its source, identified by the source's file name, and it is never a required part of the user's content. A block may refer to it, but the page stays complete without it: a missing sidecar is rebuilt from the source. + +Moving generated data into the user's content is an explicit edit, and a permanent one is not reversible. See `nc-prod` principle 6 for the rule. \ No newline at end of file diff --git a/docs/rfc/dom-ser/0002-edit-render-modes.md b/docs/rfc/dom-ser/0002-edit-render-modes.md new file mode 100644 index 000000000..cab6da68e --- /dev/null +++ b/docs/rfc/dom-ser/0002-edit-render-modes.md @@ -0,0 +1,249 @@ +# RFC 0002: Edit and render modes for page objects (interim) + +| Field | Value | +|---|---| +| RFC | 0002 | +| Title | Edit and render modes for page objects (interim) | +| Status | Draft, for owner review. Not accepted. Stopgap until RFC 0001 is accepted. | +| Version of this RFC | `modes-rfc 0.1-draft` | +| Versioning | Independent of the app version. This RFC's version changes only when this document changes. | +| Owner | The NoteCraft owner, with `nc-dom-ser` as the working skill | +| Affects | `crates/formats` (`render.rs`, `markdown.rs`), `crates/model`, `crates/ui-egui` (page editor: `pageedit.rs`, `preview.rs`, `app.rs`), `docs/dom_serialization/`, `SKILLS/nc-dom-ser/references/object-types.md` | +| Related | RFC 0001, `object-types.md`, `caret-options.md`, `code-blocks.md`, `page-model.md`, issue #242, issue #60 | +| Superseded by | RFC 0001, on its acceptance, for every question this RFC defers (section 9) | + +--- + +## 1. Summary + +Some page objects have two faces: an edit form and a rendered form. The model +declares no modes, so the switch between the two is inferred in the user +interface from the caret position. Cursor movement cannot tell whether the +caret is in stream text or inside an object's editor, so movement guesses. +This is one cause of the caret confusion reported in issue #242. + +RFC 0001 will decide the full document object model. It is a large list and +is not yet accepted. This RFC is a partial, pragmatic clarification that +decides one question now: + +1. The rule that separates content with no modes (the text stream) from + objects with declared edit and render modes (section 3). +2. The set of content that has no modes today, whose classification is + deferred to RFC 0001 (section 4). +3. The set of objects whose modes are wired into the DOM now (section 5). +4. The Editor object, in the controller layer, that owns mode transitions + and caret handoff (section 7). + +This RFC changes no file format. Modes are not document content and are not +stored in the page file. On RFC 0001 acceptance, sections 3-5 are absorbed +into RFC 0001 or its successor, and this document is withdrawn. + +## 2. Terms + +- **Stream**: paragraph text edited as text: characters with marks, one + caret, one selection, typing, undo, redo. Paragraphs, headings, quotes + and list items are stream content. +- **Object**: content that is not stream text. An object has a kind + (`object-types.md`) and, where this RFC requires it, declared modes. +- **Inline object**: an object that sits in a paragraph's text as one + character position (RFC 0001, section 2). +- **Block object**: an object that sits in the body as a block of its own + (RFC 0001, section 2). +- **Edit mode**: the form in which an object is changed. **Render mode**: + the form in which it is shown when not being changed. A mode is a property + of the object's kind, declared in the DOM. It is not a property of the + caret. +- **Editor**: the controller object that owns mode transitions and caret + handoff for objects with declared modes (section 7). +- **Mode declaration**: the statement, in an object's schema, of which modes + the kind has and what enters and leaves each mode (section 6). + +## 3. The rule + +1. Content is stream content when the text editor and the text renderer are + sufficient: it flows and wraps with the words, takes the caret, + selection, typing, undo and redo like surrounding text, and carries no + state beyond its marks. +2. Content is an object with declared modes when its edit form differs from + its rendered form: it needs an editor or a renderer of its own. +3. The test is the mode, not the size or the family. A small object with two + faces has modes; a large object with one face does not. +4. Where the test is unclear, the content is stream content until the owner + rules otherwise. That is the deferral in section 4. + +## 4. Content with no modes today (deferred) + +| Content | Why it has no modes | Status | +|---|---|---| +| Paragraph, heading, quote, list item, rule | Edited as stream text | Deferred to RFC 0001 | +| Marks: bold, italic, underline, strikethrough, font family, font size, colour | Marks on characters; no separate editor | Deferred to RFC 0001 (see issue #60) | +| Links | A run with a target; no separate editor | Deferred to RFC 0001 | +| Line break, tab | Characters in the stream | Deferred to RFC 0001 | +| Table | Cannot be edited in place today (`page-model.md`, section 3; `gaps.md`); no edit mode exists to declare | Deferred; when in-place table editing is built, the table enters section 5 by amendment | +| Picture (block image) | Selected and resized; no text edit mode | Deferred; resize remains controller behaviour (`containers.rs`) | +| Ink | Drawn on a canvas, not edited as text; own undo; stored as files (`page-model.md`, sections 3, 5) | Out of scope for this RFC; its interaction states are unchanged | + +Rules for deferred content: + +1. Deferred content is stream content for the purposes of this RFC. No code + may infer a mode for it. +2. Deferral is not a classification. RFC 0001 decides the final + classification of every row above. + +## 5. Objects with declared modes (wired in now) + +The set is the source-versus-rendered family: every object whose edit form +differs from its rendered form today. Each already switches between the two +in the user interface without a declaration; this section makes the switch +official. + +| Kind | Edit mode | Render mode | Enters edit mode | Leaves edit mode | +|---|---|---|---|---| +| `block.code` | Source text | Code as written, with language label | Caret enters the block | Caret leaves the block | +| `block.code`, numbered (`123\|`) | Source text, line numbers hidden | Code with line numbers | Caret enters the block | Caret leaves the block | +| Diagram (mermaid fence) | Source text | Drawn picture | Single click opens the source | Leaving the block | +| `block.math` | TeX source | Typeset mathematics | Caret enters the block | Caret leaves the block | + +Notes: + +- Numbered code shows its numbers on the page and none while the caret is + in it, as a diagram shows its picture on the page and its source while it + is written in (`code-blocks.md`). +- Both modes of a numbered block use the same box, size and language label + (`preview.rs`, `pageedit.rs`), so the only change on entering is the + numbers. This RFC requires the same of every kind in the table: entering + a mode changes only the content shown, never the box. + +Rules: + +1. Entering an object enters its edit mode. Leaving it returns it to render + mode. +2. The transition is owned by the Editor (section 7). No view code changes + a mode on its own. +3. A kind enters this section only by amendment to this RFC. + +## 6. Mode declarations in the DOM + +1. Each kind in section 5 carries a mode declaration in its schema: the + modes it has, and the triggers that enter and leave each mode. +2. The declaration is the source of truth. `pageedit.rs` and `preview.rs` + read it; they do not infer a mode from caret position. +3. Modes are not stored in the page file. They are interface state. The + owner's 1:1 rule (every element in the DOM has a 1:1 representation in + the page file) is unaffected: the file holds the object, not its mode. +4. Until the schema registry of RFC 0001 exists, the declaration lives in + two places: the modes column of `object-types.md`, and the kind's model + type. On RFC 0001 acceptance, declarations move to the registry + unchanged in meaning. +5. Adding a mode to a kind, or adding a kind to section 5, is an amendment + to this RFC. + +## 7. The Editor object + +NoteCraft uses Model-View-Controller (`nc-arch`). `Session` is the +controller: it routes commands, manages MCP integration, handles test hooks +and owns autosave. The Editor is a controller object beside `Session`, for +object editing. + +Responsibilities: + +1. Own the active edit session: which object, if any, is in edit mode. +2. Own transitions: enter edit mode, leave to render mode. No other code + changes an object's mode. +3. Own caret handoff: when the caret enters an object, the stream caret is + suspended and the object's editor receives it; on leaving, the stream + caret resumes at the object's boundary position. +4. Route input by mode: keys and clicks go to the object's editor while it + is active, and to the stream editor otherwise. + +Non-responsibilities: the Editor holds no document data (model), draws +nothing (view) and owns no file I/O. It commands; the model and the views +do the work. + +The interface between the Editor and `Session` (command routing) is an +implementation matter, reviewed under `nc-design-controller` (see section +12, question 6). + +## 8. Cursor movement + +1. Movement is routed by the active mode, not by caret position. The Editor + is consulted before any caret move. +2. Arrow keys at an object's boundary move into the object's edit mode on + entering, and out of it on leaving, as section 5 defines. They do not + place a stream caret inside an object's rendered form. +3. Clicks are routed the same way: the Editor decides, from the mode, whether + a click selects the object, enters its edit mode, or places the caret. + The per-kind entry triggers are in section 5. +4. While an object is in edit mode, there is one caret, owned by the active + editor. The stream caret does not exist inside the object. +5. A mode transition is not a history step. Content changes follow the page + history rules (`page-model.md`, section 3): whole page states, not a + list of edits. + +This section addresses the two-caret problem (`caret-options.md`) for mode +objects only. The general caret model remains the subject of RFC 0001 and +of the Option B spike. + +## 9. What this RFC does not decide + +- The object tree, the schema registry, and the full kind list: RFC 0001. +- The caret model and layout: `caret-options.md` (Option B spike pending + owner approval). +- The classification of the deferred set (section 4), including: equations + as inline objects (issue #100), fields and the date line (issue #242), + to-do tags, inline images, links by id. +- Style, attributes and formats content: deferred by RFC 0001, sections + 3.2 and 5.1. +- Whether a picker counts as an edit mode (fields). +- Syntax colouring and line wrapping in code blocks (`code-blocks.md`: + not decided). +- Ink storage and ink undo (`page-model.md`, section 8). + +## 10. Consequences + +- Behaviour: unchanged for code, numbered code, diagrams and mathematics. + The change is that the modes are declared and owned, not inferred. +- File format: unchanged. No migration. Round-trip and format-parity tests + are unaffected. +- Code: `pageedit.rs` and `preview.rs` read mode declarations; mode + inference from caret position is removed for the section 5 kinds. The + Editor is new code in the controller layer. +- Issue #242: this RFC does not fix #242. It removes one cause of caret + confusion (mode guessing for objects) and defines the boundary the #242 + fix builds on: stream content is edited as runs; objects are edited in + their modes. +- Issue #60: font-formatting scope remains open. Its marks are stream + content under section 4, so its scope decision is independent of this + RFC. + +## 11. Testing + +1. Each rule in sections 3-8 has a test the build runs (following RFC 0001, + section 3.1, goal 7). +2. Mode declaration tests: each section 5 kind declares its modes; a test + fails if a kind's code and its declaration disagree. +3. Transition tests: entering and leaving each mode, including caret + handoff at both boundaries. +4. Cursor routing tests: arrow keys and clicks at object boundaries, in + both modes. +5. Existing round-trip and format-parity tests continue to pass unchanged. + +## 12. Open questions + +1. Whether a picker counts as an edit mode (fields, date line). +2. Whether a to-do tag's tick state makes it an inline object, or stream + content with state. +3. Whether a picture in a sentence flows inline, or every picture is a + block object. +4. Whether a visual equation editor (issue #100) makes equations inline + objects, and what that means for the inline-object category. +5. Whether math block entry follows the code-block rule (caret enters), to + be confirmed against current behaviour. +6. The interface between the Editor and `Session`, for + `nc-design-controller` review. + +## 13. Changelog + +| RFC version | Date | Change | +|---|---|---| +| 0.1-draft | 2026-11-14 | First draft. | \ No newline at end of file diff --git a/docs/rfc/dom-ser/0003-ink-drawing-block.md b/docs/rfc/dom-ser/0003-ink-drawing-block.md new file mode 100644 index 000000000..d95170004 --- /dev/null +++ b/docs/rfc/dom-ser/0003-ink-drawing-block.md @@ -0,0 +1,142 @@ +# RFC 0003: Ink drawings as a model block that keeps the original stroke data + +| Field | Value | +|---|---| +| RFC | 0003 | +| Title | Ink drawings as a model block that keeps the original stroke data | +| Status | Accepted by the owner (section 8). Implementation in progress. | +| Version of this RFC | `ink-rfc 0.1-draft` | +| Owner | The NoteCraft owner. Working skills: `nc-dom-ser`, `nc-uiux-drawing`. | +| Affects | `crates/formats` (`markdown.rs`, `render.rs`), `crates/model`, `crates/import` (OneNote ink), `crates/onenote` (ink reader), `SKILLS/nc-dom-ser/references/fidelity-matrix.md` (Ink Drawings rows), `docs/ink-and-pressure.md` | +| Related | RFC 0001, RFC 0002, `docs/ink-and-pressure.md`, `SKILLS/nc-uiux-drawing/references/ink-scaling-and-edge-treatment.md` | + +--- + +## 1. Summary + +Ink drawings are page objects. Today a OneNote page with ink loses its drawings on import: no +reader, importer, or serializer handles ink. This RFC adds one block kind, `Drawing`, whose model +holds the drawing's original stroke data and any metadata we choose to attach. Both page formats +link the same stored data, so a drawing reads back the same from HTML or CommonMark. + +## 2. Motivation + +- A OneNote `InkContainer` is stroke data: points, pressure, colour and width per stroke, a + bounding box, an offset from its parent, and nested ink groups. There is no bitmap fallback in + the samples checked (`desktop_missing_ink.one`, `scaled_ink.one`, 0 image objects). +- A rendered picture of a drawing is a view. It cannot be edited back into strokes, and it loses + the pressure and tool the ink contract requires us to keep. +- The model must be able to hold metadata we have not thought of yet, without a format change for + each new field. + +## 3. Model + +A new variant of `Block` (`crates/formats/src/markdown.rs`), next to `Image`: + +```rust +Drawing { + /// Short text for the picture and for readers without it. + alt: String, + /// The stored data the drawing is built from. The source of truth. + data: InkData, + /// Any further metadata, name to value. Open-ended by design. + meta: BTreeMap, + emoji: Vec, +}, +``` + +`InkData` holds: + +- `strokes`: each stroke has its points (x, y, pressure), tool, colour, width and sensitivity; +- `bounds` and `offset`, as read from the source; +- `groups`: nested ink objects, each with its own strokes and offset; +- `raw`: the original bytes of the source ink object, unchanged, so a later reader can recover + anything the parsed fields leave out. + +`meta` is free-form. Known keys are documented; unknown keys survive a round trip untouched. + +## 4. Storage + +A drawing is stored as three files in the page's `assets` folder, named from the block's place +in the page (`drawing-N`): + +| File | Holds | Who writes it | Who reads it | +|---|---|---|---| +| `drawing-N.ink` | `raw`, the original ink bytes | import, and any later save that keeps the source | round trip, recovery | +| `drawing-N.json` | `data` and `meta`, parsed and versioned | the model on every save | the editor and the serializers | +| `drawing-N.svg` | the rendered view | derived from `data`, rebuilt on save | page display, and as the fallback picture | + +The `.json` file carries a schema version. The `.svg` file is a view and may be regenerated at +any time; the `.json` is the data we keep. + +## 5. Page formats + +Both formats link the same files, so the data is identical whichever format is read. + +HTML: + +```html +
      + Hand-drawn sketch +
      +``` + +CommonMark: + +```markdown +![Hand-drawn sketch](assets/drawing-3.svg) + +[ink data](assets/drawing-3.json) · [original ink](assets/drawing-3.ink) +``` + +The CommonMark form keeps the picture line that readers already understand, and adds two links so +the data files are never orphaned. This replaces the current matrix entry `[Hand-drawn image]` +(text only) for ink drawings. Parity rule: the same three files exist for both formats; only the +markup around them differs. + +## 6. Import + +The importer maps each OneNote ink container to a `Drawing` block: + +1. read the container's stroke list, bounds and offset (`crates/onenote`, ink reader); +2. write `drawing-N.ink` from the container's raw bytes; +3. write `drawing-N.json` from the parsed strokes, with metadata recording the source object + identity and any property the parser did not map; +4. render `drawing-N.svg` from the strokes, using the rendering rules in + `nc-uiux-drawing`'s ink scaling and edge treatment. + +An ink object with no strokes is imported as an empty drawing with its raw bytes, so nothing is +dropped silently. + +## 7. Tests + +- Round trip, both formats: a `Drawing` written to HTML and to CommonMark reads back with equal + `data`, `meta` and `raw`. +- Metadata: an unknown `meta` key survives a save and a reload. +- Import of the real samples: `desktop_missing_ink.one` produces 2 ink objects and 14 strokes, and + `scaled_ink.one` produces 2 ink objects and 2 strokes. These are the counts the fork's reader + reaches through page content, outline elements and outline groups (test + `ink_samples_keep_their_stroke_counts`). Ink nested inside other embedded objects is not counted + yet, so the import must be checked against those too. +- Synthetic ink: the generator gains an ink builder so ink cases can be generated the same way as + images, and each is checked with onenote.rs before it is accepted. + +## 8. Decisions (owner) + +1. Keep the original ink bytes whenever we can (`raw` is preserved, not dropped). +2. The rendered `.svg` is stored in the page's assets folder, not rebuilt on open. +3. After import the drawing behaves as any drawing made in the app: editable, with the same + object model. The imported object is kept as close to the app's own drawings as possible. +4. Be as comprehensive as possible and future ready: the matrix rows (`[Hand-drawn image]`, + `ink.svg`) move to this design now, and the metadata map stays open-ended. + +## 9. Status of work + +Accepted. Implementation follows section 7; the page-format change lands with its tests. + +## 10. Decision: both layers (owner, later) + +Import writes each page's ink into the page's `ink.svg` through the app's normal drawing path, so +imported ink renders and edits like app-drawn ink. The original stroke data is also kept as a file in +the page folder (`ink-original.json`), as metadata. Nothing renders from that file; it is kept for +future use. Per-object `Drawing` blocks stay for drawings that must be separate objects. \ No newline at end of file diff --git a/docs/adr/0002-release-detection.md b/docs/rfc/release/0002-release-detection.md similarity index 100% rename from docs/adr/0002-release-detection.md rename to docs/rfc/release/0002-release-detection.md diff --git a/docs/adr/0001-clipboard-boundary.md b/docs/rfc/uiux/0001-clipboard-boundary.md similarity index 100% rename from docs/adr/0001-clipboard-boundary.md rename to docs/rfc/uiux/0001-clipboard-boundary.md diff --git a/docs/rfc/ver.0.1.x/rfc-mve-v1-branching.md b/docs/rfc/ver.0.1.x/rfc-mve-v1-branching.md new file mode 100644 index 000000000..25817a7d1 --- /dev/null +++ b/docs/rfc/ver.0.1.x/rfc-mve-v1-branching.md @@ -0,0 +1,316 @@ +# RFC - Branching and MVE for 0.1.x: The Migration from 0.0.27 + +**Status:** Draft - for review +**Current version:** NoteCraft 0.0.27 (0.0.x line) +**Target:** NoteCraft 0.1.x - reached only when this migration is complete +**Please do not publish or share yet. This draft is for review first.** + +--- + +## Part 1 - Letter to the team + +Dear friends, + +When I first thought of NoteCraft, I thought a simple architecture and a familiar look would get us noticed. + +It did. + +But even if we reach about 50% parity with OneNote, we will still have to solve two big challenges. + +**First, how do all these features integrate together?** + +Model-View-Controller (MVC) failed in the first week. Model-View-ViewModel (MVVM) was overkill. That is why I introduced an official Editor, and why I believe the right balance is Model-View-Editor (MVE), where the Editor plays the role of the controller. + +**Second, how do we align with the rest of ArtCraft?** + +ArtCraft is going through its own re-architecture. There is a very large and useful library, craft-lib, that we can reuse and help expand. We already use parts of it, and parts of WordCraft. + +We are at NoteCraft 0.0.27. To get to 0.1.x, we need to complete this migration first. 0.1.x is not just the next number after 0.0.27 - it marks that the new architecture is in place. + +I need your help with what comes next. + +Below is a proposal for how we work towards 0.1.x: the architecture we build on, and the branching system that lets us build it without stopping daily work on the 0.0.x line. + +Please read it, question it, and tell me where it is weak. + +--- +## Part 2 - The proposal + +### Summary + +NoteCraft is at **0.0.27** on the 0.0.x line. The next milestone is **0.1.x**, and we should not use that number until the migration proposed here is complete. + +This RFC proposes two linked decisions: + +1. **Adopt MVE as the official architecture** for NoteCraft, with the Editor as the central coordinating component. +2. **Adopt a three-branch system** for the road to 0.1.x: + - `main` stays hot, and continues the 0.0.x line. + - Each release gets a short-lived, cold branch. + - A parallel `_v1x` branch stays hot, receives merges from `main` in one direction only, and carries the migration work until it is complete. When it is complete, `_v1x` becomes 0.1.x. + +The two decisions support each other. MVE gives us a stable place for features to integrate. The branching system gives us a stable place to build that integration without freezing the product people use today. + +In short: **0.0.27 → migration on `_v1x` → 0.1.x.** There is no 0.1.x without the migration. + +### Challenge 1 - Feature integration + +As parity grows, the hard problem is no longer adding a single feature. It is making features work together, in one page, in one editing session, without breaking each other. + +Our experience so far: + +| Approach | Result | +|---|---| +| MVC | Failed in the first week | +| MVVM | Overkill for this application | +| MVE | Proposed balance - see below | + +The Editor is already a real part of NoteCraft. This RFC proposes making its role formal, so new features integrate through it by design, rather than by exception. + +### Proposal 1 - Model-View-Editor (MVE) + +In MVE: + +- The **Model** holds the data: notebooks, sections, pages, and page content. +- The **View** renders that data and presents the familiar notebook interface. +- The **Editor** coordinates change. It receives user intent, applies the editing rules, updates the Model, and decides what the View must refresh. + +The Editor plays the role that a controller plays in MVC, but it is a first-class, permanent component with a defined remit - not a set of scattered controllers. + +```mermaid +flowchart LR + User["User"] --> View["View
      Renders pages
      Familiar notebook look"] + View -->|"User intent"| Editor["Editor
      Coordinates editing
      Applies rules
      Owns the session"] + Editor -->|"Updates"| Model["Model
      Notebooks, sections,
      pages, and content"] + Model -->|"State to render"| View + Editor -->|"Shared editing behaviour"| CraftLib["craft-lib / WordCraft
      Reused components"] +``` + +**What this asks of contributors:** + +- Route new editing behaviour through the Editor, not around it. +- Keep the Model free of rendering and interaction logic. +- Keep the View free of editing rules. +- Raise it in review when a feature cannot fit this shape, so the architecture is adjusted openly rather than bypassed quietly. + +### Challenge 2 - Alignment with ArtCraft + +NoteCraft does not stand alone. ArtCraft is being re-architected, and NoteCraft should align with that work instead of diverging from it. + +craft-lib is a large and useful shared library. We already use parts of it, and parts of WordCraft. The opportunity is to expand that reuse deliberately: + +- Prefer a craft-lib component where one exists or can reasonably be added. +- Contribute improvements back to craft-lib when a need starts in NoteCraft but is general. +- Avoid building a private NoteCraft-only version of something ArtCraft already maintains. +- Track where we diverge, and why, so divergence is a decision and not an accident. + +Alignment is not a one-time import. It is an ongoing discipline, and the `_v1x` branch proposed below - the branch that becomes 0.1.x - is where the larger alignment work would land. + +### Proposal 2 - A three-branch system + +#### The three branches at a glance + +| Branch | Purpose | Temperature | +|---|---|---| +| `main` | Latest and greatest; daily work; the 0.0.x line from 0.0.27 onward | Hot | +| `release/*` | One release; testing and patches only | Cold, almost frozen | +| `_v1x` | The 0.1.x migration, built in parallel | Hot | + +| Branch | Merges in from | Merges out to | +|---|---|---| +| `main` | Normal pull requests | `release/*` and `_v1x` | +| `release/*` | Its cut-off commit on `main`, plus release patches | Nowhere - it is deleted after release | +| `_v1x` | `main` only, in one direction - by merge, or by occasional cherry-pick | Nowhere until the migration is complete and it becomes 0.1.x | + +#### Infographic - How the branches relate + +Two long lines, running in parallel. `main` continues forever. Releases branch off it like a half fish-bone. `_v1x` (v0.1) runs above it until the migration is complete. + +```mermaid +gitGraph + commit id: "0.0.27" + branch _v1x + checkout _v1x + commit id: "MVE + Editor" + commit id: "craft-lib align" + checkout main + commit id: "daily work" + branch release-0.0.28 + checkout release-0.0.28 + commit id: "tests + patches" tag: "v0.0.28" + checkout main + commit id: "parity + fixes" + branch release-0.0.32 + checkout release-0.0.32 + commit id: "tests + patches" tag: "v0.0.32" + checkout main + commit id: "main continues" + checkout _v1x + merge main id: "sync main to _v1x" + commit id: "migration continues" + checkout main + commit id: "main forever" +``` + +Read it as: + +- **Long line - `_v1x` / v0.1:** the migration line. It does not stop `main`. It becomes 0.1.x only when the migration is complete. +- **Long line - `main`:** hot, latest and greatest, the 0.0.x line from 0.0.27 onward. It continues indefinitely. +- **Short branches off `main` - `release/*`:** the fish-bone teeth. Each one is cut from one commit on `main` (for example v0.0.27, then later v0.0.32), gets tests and patches only, ships, and is deleted. +- **Sync is one way only, `main` → `_v1x`:** shown above as a merge. In practice it can also be an occasional cherry-pick of a single commit from `main` to `_v1x`, or a CI job that automates the `main` → `_v1x` sync - see Branch 3 and Open questions. Nothing merges back from `_v1x` to `main` while the migration is incomplete. + +How `_v1x` is finally promoted to 0.1.x is one of the decisions this RFC asks reviewers to settle - see Open questions. + +#### Version path - 0.0.27 to 0.1.x + +```mermaid +flowchart LR + A["0.0.27
      Current release
      0.0.x line on main"] + B["0.0.x continues
      Parity, fixes, daily work
      on main"] + C["_v1x migration
      MVE + Editor
      ArtCraft / craft-lib alignment"] + D["0.1.x
      First release after
      migration is complete"] + + A --> B + A --> C + B -->|"main merged one-way into _v1x"| C + C -->|"Migration complete"| D +``` + +While the migration is incomplete, releases stay on 0.0.x. The version does not move to 0.1.x early to signal progress - it moves when the work is done. + +#### Branch 1 - `main` remains hot + +`main` remains our hot branch. Latest and greatest goes into `main`. + +Daily development, fixes, and parity work continue there as they do today, and releases from `main` stay on the 0.0.x line - the line that is at 0.0.27 today. Nothing in this proposal freezes `main`, slows it down, or makes it wait for 0.1.x. + +#### Branch 2 - A throwaway cold branch for each release + +When we release, we create a throwaway branch off a cut-off commit on `main`. + +That branch is cold, almost frozen: + +- No new features land on it. +- All release test runs happen against it. +- Only release patches - fixes needed to ship that release - go onto it. +- When the release is done, the branch is discarded. + +Any fix that is also needed in the product generally must also land on `main`. A release branch must never become the only home of a fix. + +```mermaid +gitGraph + commit id: "Work on main" + commit id: "Cut-off commit" + branch release + checkout release + commit id: "Release tests" + commit id: "Release patch only" + checkout main + commit id: "Daily work continues" + commit id: "Same fix, if needed on main" +``` + +#### Branch 3 - `_v1x`, a parallel hot branch for 0.1.x + +In parallel with `main`, a long-lived `_v1x` branch carries the migration work. When that work is complete, `_v1x` becomes the 0.1.x line. + +Its rules are different from both other branches: + +- It is hot. Active migration work lands there regularly. +- Merges run in one direction only: `main` → `_v1x`. +- Work from `_v1x` does not merge back into `main` while the migration is incomplete. +- It exists until the migration is complete, and not beyond that without a new decision. + +**How `main` reaches `_v1x` - two ways, both one-way:** + +1. **Regular merge, `main` → `_v1x`.** The default. It keeps `_v1x` current with the 0.0.x line. +2. **Occasional cherry-pick, `main` → `_v1x`.** When only one fix or feature on `main` is needed on `_v1x` now, and a full merge is not wanted yet, cherry-pick that single commit. + +**Open option - CI automation:** should we set up a CI job for `main` → `_v1x` - for example, a job that opens (or performs) the sync merge on a schedule, or after each release - instead of doing every sync by hand? This RFC does not decide that. It is listed in Open questions for reviewers to settle, including what the job may do automatically and what still needs a human check. + +This protects both sides. `main` is not destabilised by unfinished architecture work, and the migration work is not lost or repeatedly rebased - it keeps receiving the latest work from `main`. + +```mermaid +gitGraph + commit id: "main: daily work" + branch _v1x + checkout _v1x + commit id: "0.1.x migration" + checkout main + commit id: "main: parity work" + commit id: "main: urgent fix" + checkout _v1x + cherry-pick id: "main: urgent fix" + commit id: "migration work" + checkout main + commit id: "main: more work" + checkout _v1x + merge main id: "main into _v1x" + commit id: "migration continues" +``` + +No merge or cherry-pick in the other direction is made while the migration is incomplete. All sync between the two hot branches runs from `main` to `_v1x` only. + + +### How a release would run + +1. Choose the cut-off commit on `main`. +2. Create `release/*` from that commit. Name it for the release it will ship. +3. Run all release tests against `release/*`. +4. Land only release patches on `release/*`. Land the same fix on `main` as well, if `main` also needs it. +5. Ship from `release/*`. +6. Delete `release/*`. It was throwaway by design. + +### How the 0.1.x migration would run + +1. Create `_v1x` from `main` at the current 0.0.x line (0.0.27 or a later 0.0.x cut-off agreed when the branch is created). +2. Land migration work on `_v1x` through its own pull requests: MVE / Editor formalisation, and ArtCraft / craft-lib / WordCraft alignment. +3. Merge `main` into `_v1x` regularly, on a cadence reviewers agree in this RFC. Cherry-pick single commits from `main` to `_v1x` when only one change is needed sooner. Decide in this RFC whether a CI job should automate the `main` → `_v1x` sync. +4. Do not merge or cherry-pick `_v1x` back into `main`. +5. Continue until the agreed definition of "migration complete" is met. +6. Then promote `_v1x` to 0.1.x, as a separate step - for example, a final merge into `main` followed by the first 0.1.x release, or `_v1x` becoming the new `main` for the 0.1.x line. + +### Risks and trade-offs + +**Drift between `main` and `_v1x`.** The longer the migration takes, the larger each merge from `main` can become. A regular merge cadence, and keeping migration changes as contained as possible, are the mitigations. + +**Two hot branches need discipline.** Contributors must be clear, for each change, whether it belongs on `main`, on `_v1x`, or on both. Unclear routing will create duplicated or missing work. + +**Release patches can be lost.** A patch that lands only on a throwaway release branch is deleted with it. The rule that general fixes also land on `main` must be checked during every release. + +**MVE is a constraint.** Making the Editor the formal centre will slow some features at first, especially features designed around bypassing it. That cost is the point of the proposal: integration is paid for once, centrally, instead of repeatedly, feature by feature. + +### Alternatives considered + +**Keep only `main`, with long-lived release branches.** Rejected in this proposal because a release branch that lives on stops being frozen, and starts collecting work that belongs on `main`. + +**Build 0.1.x directly on `main`.** Rejected in this proposal because unfinished migration work would land in the product people use every day, and the 0.0.x line would carry half-migrated architecture. + +**Merge `_v1x` back into `main` regularly.** Rejected in this proposal because it would import the incomplete migration into `main` before it is ready. One-directional merges keep that boundary clear, and keep 0.1.x meaning "migration complete." + +**Stay with MVC or MVVM.** Rejected based on experience: MVC failed in the first week, and MVVM was overkill. + +### Open questions - decisions needed before adoption + +1. **Branch name.** Is `_v1x` the final name for the 0.1.x migration branch, and does it follow our branch naming and protection rules? +2. **Merge cadence and automation.** How often is `main` merged into `_v1x` - weekly, at each release, or on another schedule - and who owns each merge? When is a cherry-pick used instead of a full merge? Should a CI job automate the `main` → `_v1x` sync, and if so, what may it do on its own and what needs a human check? +3. **Definition of done.** What, in concrete terms, means "the migration is complete" and NoteCraft may move from 0.0.x (currently 0.0.27) to 0.1.x? +4. **Final promotion.** When the migration is complete, does `_v1x` merge into `main` and then ship as 0.1.x, replace `main`, or follow another path? +5. **What belongs where.** Which kinds of change go to `main` only, to `_v1x` only, and to both? +6. **craft-lib alignment.** Which parts of craft-lib and WordCraft are in scope for the 0.1.x migration, and who tracks divergence? +7. **Release branch naming and lifetime.** What is the exact `release/*` naming pattern, and when exactly is a release branch deleted? + +### The ask + +I need your help with the coming work. + +Please review this proposal for the parts I cannot settle alone: + +- Does MVE describe how we actually build, and where does it not fit? +- Is the one-directional rule for `_v1x` workable in practice? +- What cadence and completion criteria would make the migration succeed instead of drift, so we can honestly move from 0.0.27 / 0.0.x to 0.1.x? + +Comments, objections, and counter-proposals are welcome. Nothing in this draft is final until we agree it together. + +--- + +**End of draft - for review first. Do not publish yet.** diff --git a/docs/testing.md b/docs/testing.md index 462b0e75d..9cdbb27c0 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -76,11 +76,9 @@ Tests are not a substitute for looking. The tests render with egui's bundled fonts, so they do not depend on installed fonts. -The real OfficeIMO bridge acceptance test is opt-in. Set `NOTECRAFT_OFFICEIMO_BRIDGE` to an -installed bridge, then run `cargo test -p notecraft-cli --test officeimo_bridge -- --ignored`. -It imports the public fixture in both formats as a section and a folder, repeats each import, -and checks the notebook tree, source preservation and existing notes. It uses isolated child -process settings and environment; default CI does not need an installed bridge. +The native OneNote notebook-import tests cover attachment bytes, partial import reporting, +unsupported sections, supported source choices and the no-empty-notebook error: +`cargo test -p notecraft-import --lib notebook::tests`. ## Hostile input @@ -182,7 +180,7 @@ The desktop jobs build the default features and then run the workspace tests wit ## Clipboard in tests No test reads or writes the system clipboard. The app takes its clipboard as a boundary (see -[ADR 0001](adr/0001-clipboard-boundary.md)), and the UI tests give it an in-memory clipboard from +[ADR 0001](rfc/uiux/0001-clipboard-boundary.md)), and the UI tests give it an in-memory clipboard from `crates/ui-egui/tests/support/clipboard.rs`. That double is the one mock the rules allow (see `AGENTS.md`). Copies are read from it, and the UI suite runs in parallel. diff --git a/i18n/ar-XB.tsv b/i18n/ar-XB.tsv index 3b97c1db6..c06790704 100644 --- a/i18n/ar-XB.tsv +++ b/i18n/ar-XB.tsv @@ -498,7 +498,6 @@ @id ui.make_the_page_smaller [[RLI]]$$$Make the page smaller@@@[[PDI]] @id ui.making_a_printout_of_name [[RLI]]$$$Making a printout of {name}…@@@[[PDI]] @id ui.making_a_printout_of_name_page_done_of_total [[RLI]]$$$Making a printout of {name}: page {done} of {total}@@@[[PDI]] -@id ui.many_thanks_to_its_authors_and_contributors [[RLI]]$$$— many thanks to its authors and contributors.@@@[[PDI]] @id ui.markdown [[RLI]]$$$Markdown@@@[[PDI]] @id ui.match_case [[RLI]]$$$Match case@@@[[PDI]] @id ui.math [[RLI]]$$$Math@@@[[PDI]] @@ -513,7 +512,6 @@ @id ui.merge [[RLI]]$$$Merge@@@[[PDI]] @id ui.mermaid [[RLI]]$$$Mermaid@@@[[PDI]] @id ui.mint [[RLI]]$$$mint@@@[[PDI]] -@id ui.mit_license [[RLI]]$$$MIT license@@@[[PDI]] @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 [[RLI]]$$$MIT or Apache-2.0, at your option. The koala artwork is not covered by it; see ATTRIBUTION.md.@@@[[PDI]] @id ui.mode [[RLI]]$$$Mode@@@[[PDI]] @id ui.modify_tool [[RLI]]$$$Modify Tool@@@[[PDI]] @@ -610,11 +608,9 @@ @id ui.off_2 [[RLI]]$$$off@@@[[PDI]] @id ui.office_document [[RLI]]$$$Office document@@@[[PDI]] @id ui.office_text_inspection [[RLI]]$$$Office text inspection@@@[[PDI]] -@id ui.officeimo [[RLI]]$$$OfficeIMO@@@[[PDI]] @id ui.ok [[RLI]]$$$OK@@@[[PDI]] @id ui.one_tree_of_notebooks [[RLI]]$$$One tree of notebooks@@@[[PDI]] @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b [[RLI]]$$$OneDrive and SharePoint: not built. Point NoteCraft at a folder your sync tool already watches and it is the same thing.@@@[[PDI]] -@id ui.onenote_import [[RLI]]$$$OneNote import@@@[[PDI]] @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 [[RLI]]$$$Online notebooks (OneDrive, SharePoint) are not built. A notebook in a folder your sync tool watches is synced by it.@@@[[PDI]] @id ui.only_a_list_item_can_be_indented [[RLI]]$$$Only a list item can be indented@@@[[PDI]] @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it [[RLI]]$$$Only open it if you trust the file and the person who created it.@@@[[PDI]] @@ -683,7 +679,6 @@ @id ui.pictures [[RLI]]$$$Pictures@@@[[PDI]] @id ui.plain [[RLI]]$$$Plain@@@[[PDI]] @id ui.plain_text [[RLI]]$$$Plain text@@@[[PDI]] -@id ui.powered_by [[RLI]]$$$Powered by@@@[[PDI]] @id ui.pressure_sensitivity_now_of_100 [[RLI]]$$$Pressure sensitivity {now} of 100@@@[[PDI]] @id ui.pressure_sensitivity_tip [[RLI]]$$$How readily the pen answers pressure: turned up, a light hand lays down more ink@@@[[PDI]] @id ui.pressure_sensitivity_unavailable [[RLI]]$$$Pressure sensitivity unavailable@@@[[PDI]] @@ -908,7 +903,6 @@ @id ui.top [[RLI]]$$$Top@@@[[PDI]] @id ui.triangle [[RLI]]$$$Triangle@@@[[PDI]] @id ui.type [[RLI]]$$$Type@@@[[PDI]] -@id ui.under_the [[RLI]]$$$under the@@@[[PDI]] @id ui.undo [[RLI]]$$$Undo@@@[[PDI]] @id ui.undo_ctrl_z [[RLI]]$$$Undo (Ctrl+Z)@@@[[PDI]] @id ui.undo_stroke [[RLI]]$$$Undo@@@[[PDI]]\n[[RLI]]$$$stroke@@@[[PDI]] diff --git a/i18n/ar.tsv b/i18n/ar.tsv index f37f68bc0..0bd19c35e 100644 --- a/i18n/ar.tsv +++ b/i18n/ar.tsv @@ -357,7 +357,6 @@ @id ui.make_subpage اجعلها صفحة فرعية @id ui.make_the_page_larger تكبير الصفحة @id ui.make_the_page_smaller تصغير الصفحة -@id ui.many_thanks_to_its_authors_and_contributors — شكرًا جزيلاً لمؤلفيه ومساهמיه. @id ui.markdown Markdown @id ui.match_case مطابقة حالة الأحرف @id ui.math رياضيات @@ -372,7 +371,6 @@ @id ui.merge دمج @id ui.mermaid Mermaid @id ui.mint نعناع -@id ui.mit_license ترخيص MIT @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT أو Apache-2.0، حسب اختيارك. لا يغطي هذا عمل الكوالا الفني؛ انظر ATTRIBUTION.md. @id ui.mode الوضع @id ui.modify_tool أداة التعديل @@ -467,11 +465,9 @@ @id ui.off_2 إيقاف @id ui.office_document مستند Office @id ui.office_text_inspection فحص نص Office -@id ui.officeimo OfficeIMO @id ui.ok موافق @id ui.one_tree_of_notebooks شجرة واحدة من الدفترة @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive و SharePoint: غير مبنين. وجه NoteCraft إلى مجلد يراقه أداة المزامنة الخاصة بك بالفعل، وسيكون الأمر نفسه. -@id ui.onenote_import استيراد OneNote @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 الدفترة عبر الإنترنت (OneDrive، SharePoint) غير مبنية. الدفتر في مجلد تراقه أداة المزامنة الخاصة بك يتم مزامنته بواسطةها. @id ui.only_a_list_item_can_be_indented يمكن فقط لعنصر قائمة أن يكون مسنداً @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it افتحه فقط إذا كنت تثق في الملف والشخص الذي أنشأه. @@ -540,7 +536,6 @@ @id ui.pictures الصور @id ui.plain عادي @id ui.plain_text نص عادي -@id ui.powered_by مدعوم بواسطة @id ui.pressure_sensitivity_now_of_100 حساسية الضغط {now} تساوي 100 @id ui.pressure_sensitivity_unavailable حساسية الضغط غير متاحة @id ui.previous السابق @@ -748,7 +743,6 @@ @id ui.top أعلى @id ui.triangle مثلث @id ui.type النوع -@id ui.under_the تحت الـ @id ui.undo تراجع @id ui.undo_ctrl_z تراجع (Ctrl+Z) @id ui.undo_stroke تراجع \nstroke diff --git a/i18n/de.tsv b/i18n/de.tsv index 8d9b54755..e58cf85d7 100644 --- a/i18n/de.tsv +++ b/i18n/de.tsv @@ -354,7 +354,6 @@ @id ui.make_subpage Als Unterseite einrücken @id ui.make_the_page_larger Seite vergrößern @id ui.make_the_page_smaller Seite verkleinern -@id ui.many_thanks_to_its_authors_and_contributors — vielen Dank an die Autoren und Mitwirkenden. @id ui.markdown Markdown @id ui.match_case Groß-/Kleinschreibung beachten @id ui.math Mathematik @@ -369,7 +368,6 @@ @id ui.merge Zusammenführen @id ui.mermaid Mermaid @id ui.mint mint -@id ui.mit_license MIT-Lizenz @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT oder Apache-2.0, nach Ihrer Wahl. Die Koala-Grafik ist davon nicht abgedeckt; siehe ATTRIBUTION.md. @id ui.mode Modus @id ui.modify_tool Werkzeug ändern @@ -464,11 +462,9 @@ @id ui.off_2 aus @id ui.office_document Office-Dokument @id ui.office_text_inspection Inspektion von Office-Texten -@id ui.officeimo OfficeIMO @id ui.ok OK @id ui.one_tree_of_notebooks Ein Baum von Notizbüchern @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive und SharePoint: nicht implementiert. Verweisen Sie NoteCraft auf einen Ordner, den Ihr Synchronisierungstool bereits überwacht, und es ist dasselbe. -@id ui.onenote_import OneNote-Import @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 Online-Notizbücher (OneDrive, SharePoint) sind nicht implementiert. Ein Notizbuch in einem Ordner, den Ihr Synchronisierungstool überwacht, wird von diesem synchronisiert. @id ui.only_a_list_item_can_be_indented Nur ein Listenelement kann eingerückt werden @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it Öffnen Sie es nur, wenn Sie der Datei und der Person, die sie erstellt hat, vertrauen. @@ -537,7 +533,6 @@ @id ui.pictures Bilder @id ui.plain Einfach @id ui.plain_text Klartext -@id ui.powered_by Unterstützt von @id ui.pressure_sensitivity_now_of_100 Druckempfindlichkeit {now} von 100 @id ui.pressure_sensitivity_unavailable Druckempfindlichkeit nicht verfügbar @id ui.previous Vorherige @@ -745,7 +740,6 @@ @id ui.top Oben @id ui.triangle Dreieck @id ui.type Typ -@id ui.under_the unter dem @id ui.undo Rückgängig @id ui.undo_ctrl_z Rückgängig (Strg+Z) @id ui.undo_stroke Rückgängig \nstrich diff --git a/i18n/en-XA.tsv b/i18n/en-XA.tsv index 2d4c4090c..00172fba5 100644 --- a/i18n/en-XA.tsv +++ b/i18n/en-XA.tsv @@ -498,7 +498,6 @@ @id ui.make_the_page_smaller $$$Make the page smaller@@@ @id ui.making_a_printout_of_name $$$Making a printout of {name}…@@@ @id ui.making_a_printout_of_name_page_done_of_total $$$Making a printout of {name}: page {done} of {total}@@@ -@id ui.many_thanks_to_its_authors_and_contributors $$$— many thanks to its authors and contributors.@@@ @id ui.markdown $$$Markdown@@@ @id ui.match_case $$$Match case@@@ @id ui.math $$$Math@@@ @@ -513,7 +512,6 @@ @id ui.merge $$$Merge@@@ @id ui.mermaid $$$Mermaid@@@ @id ui.mint $$$mint@@@ -@id ui.mit_license $$$MIT license@@@ @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 $$$MIT or Apache-2.0, at your option. The koala artwork is not covered by it; see ATTRIBUTION.md.@@@ @id ui.mode $$$Mode@@@ @id ui.modify_tool $$$Modify Tool@@@ @@ -610,11 +608,9 @@ @id ui.off_2 $$$off@@@ @id ui.office_document $$$Office document@@@ @id ui.office_text_inspection $$$Office text inspection@@@ -@id ui.officeimo $$$OfficeIMO@@@ @id ui.ok $$$OK@@@ @id ui.one_tree_of_notebooks $$$One tree of notebooks@@@ @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b $$$OneDrive and SharePoint: not built. Point NoteCraft at a folder your sync tool already watches and it is the same thing.@@@ -@id ui.onenote_import $$$OneNote import@@@ @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 $$$Online notebooks (OneDrive, SharePoint) are not built. A notebook in a folder your sync tool watches is synced by it.@@@ @id ui.only_a_list_item_can_be_indented $$$Only a list item can be indented@@@ @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it $$$Only open it if you trust the file and the person who created it.@@@ @@ -683,7 +679,6 @@ @id ui.pictures $$$Pictures@@@ @id ui.plain $$$Plain@@@ @id ui.plain_text $$$Plain text@@@ -@id ui.powered_by $$$Powered by@@@ @id ui.pressure_sensitivity_now_of_100 $$$Pressure sensitivity {now} of 100@@@ @id ui.pressure_sensitivity_tip $$$How readily the pen answers pressure: turned up, a light hand lays down more ink@@@ @id ui.pressure_sensitivity_unavailable $$$Pressure sensitivity unavailable@@@ @@ -908,7 +903,6 @@ @id ui.top $$$Top@@@ @id ui.triangle $$$Triangle@@@ @id ui.type $$$Type@@@ -@id ui.under_the $$$under the@@@ @id ui.undo $$$Undo@@@ @id ui.undo_ctrl_z $$$Undo (Ctrl+Z)@@@ @id ui.undo_stroke $$$Undo@@@\n$$$stroke@@@ diff --git a/i18n/en.tsv b/i18n/en.tsv index c9aa63c2b..fe2b5a453 100644 --- a/i18n/en.tsv +++ b/i18n/en.tsv @@ -498,7 +498,6 @@ @id ui.make_the_page_smaller Make the page smaller @id ui.making_a_printout_of_name Making a printout of {name}… @id ui.making_a_printout_of_name_page_done_of_total Making a printout of {name}: page {done} of {total} -@id ui.many_thanks_to_its_authors_and_contributors — many thanks to its authors and contributors. @id ui.markdown Markdown @id ui.match_case Match case @id ui.math Math @@ -513,7 +512,6 @@ @id ui.merge Merge @id ui.mermaid Mermaid @id ui.mint mint -@id ui.mit_license MIT license @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT or Apache-2.0, at your option. The koala artwork is not covered by it; see ATTRIBUTION.md. @id ui.mode Mode @id ui.modify_tool Modify Tool @@ -610,11 +608,9 @@ @id ui.off_2 off @id ui.office_document Office document @id ui.office_text_inspection Office text inspection -@id ui.officeimo OfficeIMO @id ui.ok OK @id ui.one_tree_of_notebooks One tree of notebooks @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive and SharePoint: not built. Point NoteCraft at a folder your sync tool already watches and it is the same thing. -@id ui.onenote_import OneNote import @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 Online notebooks (OneDrive, SharePoint) are not built. A notebook in a folder your sync tool watches is synced by it. @id ui.only_a_list_item_can_be_indented Only a list item can be indented @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it Only open it if you trust the file and the person who created it. @@ -683,7 +679,6 @@ @id ui.pictures Pictures @id ui.plain Plain @id ui.plain_text Plain text -@id ui.powered_by Powered by @id ui.pressure_sensitivity_now_of_100 Pressure sensitivity {now} of 100 @id ui.pressure_sensitivity_tip How readily the pen answers pressure: turned up, a light hand lays down more ink @id ui.pressure_sensitivity_unavailable Pressure sensitivity unavailable @@ -908,7 +903,6 @@ @id ui.top Top @id ui.triangle Triangle @id ui.type Type -@id ui.under_the under the @id ui.undo Undo @id ui.undo_ctrl_z Undo (Ctrl+Z) @id ui.undo_stroke Undo\nstroke diff --git a/i18n/es.tsv b/i18n/es.tsv index 57c5c02f3..8774ee71e 100644 --- a/i18n/es.tsv +++ b/i18n/es.tsv @@ -354,7 +354,6 @@ @id ui.make_subpage Convertir en subpágina @id ui.make_the_page_larger Aumentar el tamaño de la página @id ui.make_the_page_smaller Reducir el tamaño de la página -@id ui.many_thanks_to_its_authors_and_contributors — muchas gracias a sus autores y colaboradores. @id ui.markdown Markdown @id ui.match_case Coincidir mayúsculas y minúsculas @id ui.math Matem?ticas @@ -369,7 +368,6 @@ @id ui.merge Combinar @id ui.mermaid Mermaid @id ui.mint mint -@id ui.mit_license Licencia MIT @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT o Apache-2.0, a tu elección. La obra de arte del koala no está cubierta por ella; consulta ATTRIBUTION.md. @id ui.mode Modo @id ui.modify_tool Herramienta de modificación @@ -464,11 +462,9 @@ @id ui.off_2 off @id ui.office_document Documento de oficina @id ui.office_text_inspection Inspección de texto de oficina -@id ui.officeimo OfficeIMO @id ui.ok Aceptar @id ui.one_tree_of_notebooks Un árbol de cuadernos @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive y SharePoint: no compilados. Señala NoteCraft a una carpeta que tu herramienta de sincronización ya vigila y es lo mismo. -@id ui.onenote_import Importación de OneNote @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 Los cuadernos en línea (OneDrive, SharePoint) no están compilados. Un cuaderno en una carpeta que tu herramienta de sincronización vigila se sincroniza por ella. @id ui.only_a_list_item_can_be_indented Solo un elemento de lista puede estar sangrado @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it Ábrelo solo si confías en el archivo y en la persona que lo creó. @@ -537,7 +533,6 @@ @id ui.pictures Imágenes @id ui.plain Sin formato @id ui.plain_text Texto sin formato -@id ui.powered_by Desarrollado por @id ui.pressure_sensitivity_now_of_100 Sensibilidad a la presión {now} de 100 @id ui.pressure_sensitivity_unavailable Sensibilidad a la presión no disponible @id ui.previous Anterior @@ -745,7 +740,6 @@ @id ui.top Top @id ui.triangle Triangle @id ui.type Tipo -@id ui.under_the debajo de @id ui.undo Deshacer @id ui.undo_ctrl_z Undo (Ctrl+Z) @id ui.undo_stroke Deshacer \ntrazo diff --git a/i18n/fa.tsv b/i18n/fa.tsv index 7e6513131..ef40bfd42 100644 --- a/i18n/fa.tsv +++ b/i18n/fa.tsv @@ -354,7 +354,6 @@ @id ui.make_subpage تبدیل به زیرصفحه @id ui.make_the_page_larger بزرگ‌تر کردن صفحه @id ui.make_the_page_smaller کوچک‌تر کردن صفحه -@id ui.many_thanks_to_its_authors_and_contributors — تشکر فراوان از نویسندگان و مشارکت‌کنندگان. @id ui.markdown Markdown @id ui.match_case تطبیق با حالت بزرگ/کوچک @id ui.math ریاضی @@ -369,7 +368,6 @@ @id ui.merge ادغام @id ui.mermaid Mermaid @id ui.mint سبز نعنایی -@id ui.mit_license مجوز MIT @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT یا Apache-2.0، به انتخاب شما. هنر تصویر کوالا تحت پوشش آن نیست؛ به ATTRIBUTION.md مراجعه کنید. @id ui.mode حالت @id ui.modify_tool ابزار تغییر @@ -464,11 +462,9 @@ @id ui.off_2 خاموش @id ui.office_document سند اداری @id ui.office_text_inspection بازرسی متن اداری -@id ui.officeimo OfficeIMO @id ui.ok تأیید @id ui.one_tree_of_notebooks یک درخت از دفترچه‌ها @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive و SharePoint: ساخته نشده است. NoteCraft را به پوشه‌ای که ابزار همگام‌سازی شما نظارت می‌کند هدایت کنید؛ همان کار را انجام می‌دهد. -@id ui.onenote_import وارد کردن OneNote @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 دفترچه‌های آنلاین (OneDrive، SharePoint) ساخته نشده‌اند. دفترچه‌ای در پوشه‌ای که ابزار همگام‌سازی شما نظارت می‌کند توسط آن همگام می‌شود. @id ui.only_a_list_item_can_be_indented فقط یک مورد فهرست می‌تواند تورفتگی داشته باشد @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it تنها در صورتی آن را باز کنید که به فایل و شخصی که آن را ایجاد کرده اعتماد دارید. @@ -537,7 +533,6 @@ @id ui.pictures تصاویر @id ui.plain ساده @id ui.plain_text متن ساده -@id ui.powered_by قدرت گرفته از @id ui.pressure_sensitivity_now_of_100 حساسیت فشار {now} از 100 @id ui.pressure_sensitivity_unavailable حساسیت فشار در دسترس نیست @id ui.previous قبلی @@ -745,7 +740,6 @@ @id ui.top بالا @id ui.triangle مثلث @id ui.type نوع -@id ui.under_the زیرِ @id ui.undo واگردانی @id ui.undo_ctrl_z واگردانی (Ctrl+Z) @id ui.undo_stroke واگردان\nخط diff --git a/i18n/fr.tsv b/i18n/fr.tsv index d84d7020a..0ed12d699 100644 --- a/i18n/fr.tsv +++ b/i18n/fr.tsv @@ -354,7 +354,6 @@ @id ui.make_subpage Créer une sous-page @id ui.make_the_page_larger Agrandir la page @id ui.make_the_page_smaller Réduire la page -@id ui.many_thanks_to_its_authors_and_contributors — avec tous nos remerciements à ses auteurs et contributeurs. @id ui.markdown Markdown @id ui.match_case Respecter la casse @id ui.math Maths @@ -369,7 +368,6 @@ @id ui.merge Fusionner @id ui.mermaid Mermaid @id ui.mint mint -@id ui.mit_license Licence MIT @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 Licence MIT ou Apache-2.0, au choix. L’illustration du koala n’est pas couverte par ces licences ; consultez ATTRIBUTION.md. @id ui.mode Mode @id ui.modify_tool Modifier l'outil @@ -464,11 +462,9 @@ @id ui.off_2 off @id ui.office_document Document de bureau @id ui.office_text_inspection Inspection du texte de bureau -@id ui.officeimo OfficeIMO @id ui.ok OK @id ui.one_tree_of_notebooks Un seul arbre de cahiers @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive et SharePoint ne sont pas encore pris en charge. Indiquez à NoteCraft un dossier déjà surveillé par votre outil de synchronisation : le résultat est le même. -@id ui.onenote_import Importation depuis OneNote @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 Les blocs-notes en ligne (OneDrive, SharePoint) ne sont pas encore pris en charge. Un bloc-notes placé dans un dossier surveillé par votre outil de synchronisation sera synchronisé par celui-ci. @id ui.only_a_list_item_can_be_indented Seul un élément de liste peut être indenté @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it Ouvrez-le uniquement si vous faites confiance au fichier et à son créateur. @@ -537,7 +533,6 @@ @id ui.pictures Images @id ui.plain Simple @id ui.plain_text Plain text -@id ui.powered_by Propulsé par @id ui.pressure_sensitivity_now_of_100 Sensibilité à la pression {now} de 100 @id ui.pressure_sensitivity_unavailable Sensibilité à la pression non disponible @id ui.previous Précédent @@ -745,7 +740,6 @@ @id ui.top Top @id ui.triangle Triangle @id ui.type Type -@id ui.under_the sous licence @id ui.undo Annuler @id ui.undo_ctrl_z Undo (Ctrl+Z) @id ui.undo_stroke Annuler\ntrait diff --git a/i18n/he.tsv b/i18n/he.tsv index 0bbdfa1b3..f355bba9a 100644 --- a/i18n/he.tsv +++ b/i18n/he.tsv @@ -354,7 +354,6 @@ @id ui.make_subpage הפוך לעמוד משנה @id ui.make_the_page_larger הגדלת הדף @id ui.make_the_page_smaller הקטנת הדף -@id ui.many_thanks_to_its_authors_and_contributors — תודה רבה למחבריו ותורמיו. @id ui.markdown Markdown @id ui.match_case התאמת אותיות גדולות/קטנות @id ui.math מתמטיקה @@ -369,7 +368,6 @@ @id ui.merge מיזוג @id ui.mermaid Mermaid @id ui.mint מנטה -@id ui.mit_license רישיון MIT @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT או Apache-2.0, לפי בחירתך. אמנות הקואלה אינה מכוסה בכך; ראה ATTRIBUTION.md. @id ui.mode מצב @id ui.modify_tool כלי עריכה @@ -464,11 +462,9 @@ @id ui.off_2 כבוי @id ui.office_document מסמך אופיס @id ui.office_text_inspection בדיקת טקסט אופיס -@id ui.officeimo OfficeIMO @id ui.ok אישור @id ui.one_tree_of_notebooks עץ מחברות אחד @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive ו-SharePoint: טרם נבנו. הפנה את NoteCraft לתיקייה שכבר מופקחת על ידי כלי הסינכרון שלך והיא תהיה אותו הדבר. -@id ui.onenote_import ייבוא OneNote @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 מחברות מקוונות (OneDrive, SharePoint) טרם נבנו. מחברת בתיקייה שכבר מופקחת על ידי כלי הסינכרון שלך מסונכרנת על ידו. @id ui.only_a_list_item_can_be_indented רק פריט רשימה ניתן להזחה @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it פתח אותו רק אם אתה סומך על הקובץ ועל מי שיצר אותו. @@ -537,7 +533,6 @@ @id ui.pictures תמונות @id ui.plain רגיל @id ui.plain_text טקסט רגיל -@id ui.powered_by באמצעות @id ui.pressure_sensitivity_now_of_100 רגישות ללחץ {now} מתוך 100 @id ui.pressure_sensitivity_unavailable רגישות ללחץ אינה זמינה @id ui.previous הקודם @@ -745,7 +740,6 @@ @id ui.top למעלה @id ui.triangle משולש @id ui.type סוג -@id ui.under_the מתחת ל- @id ui.undo ביטול פעולה @id ui.undo_ctrl_z ביטול פעולה (Ctrl+Z) @id ui.undo_stroke קו \n diff --git a/i18n/hi.tsv b/i18n/hi.tsv index 689327058..066ae6ee3 100644 --- a/i18n/hi.tsv +++ b/i18n/hi.tsv @@ -354,7 +354,6 @@ @id ui.make_subpage उपपृष्ठ बनाएँ @id ui.make_the_page_larger पृष्ठ को बड़ा करें @id ui.make_the_page_smaller पृष्ठ को छोटा करें -@id ui.many_thanks_to_its_authors_and_contributors — इसके लेखकों और योगदानकर्ताओं को अनेक-अनेक धन्यवाद। @id ui.markdown मार्कडाउन @id ui.match_case केस मिलाएं @id ui.math गणित @@ -369,7 +368,6 @@ @id ui.merge मर्ज करें @id ui.mermaid Mermaid @id ui.mint mint -@id ui.mit_license MIT लाइसेंस @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT या Apache-2.0, आपकी पसंद के अनुसार। कोआला कलाकृति इसके अंतर्गत नहीं है; ATTRIBUTION.md देखें। @id ui.mode मोड @id ui.modify_tool टूल संशोधित करें @@ -464,11 +462,9 @@ @id ui.off_2 बंद @id ui.office_document ऑफिस दस्तावेज़ @id ui.office_text_inspection ऑफिस पाठ निरीक्षण -@id ui.officeimo OfficeIMO @id ui.ok ठीक है @id ui.one_tree_of_notebooks नोटबुक्स का एक वृक्ष @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive और SharePoint: बनाया नहीं गया। NoteCraft को उस फ़ोल्डर की ओर इशारा करें जो आपका सिंक टूल पहले से देख रहा है, तो यह वही है। -@id ui.onenote_import OneNote आयात @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 ऑनलाइन नोटबुक्स (OneDrive, SharePoint) बनाए नहीं गए हैं। आपके सिंक टूल द्वारा देखे जाने वाले फ़ोल्डर में एक नोटबुक उसी द्वारा सिंक होती है। @id ui.only_a_list_item_can_be_indented केवल सूची आइटम को इंडेंट किया जा सकता है @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it इसे केवल तभी खोलें यदि आप फ़ाइल और इसे बनाने वाले व्यक्ति पर भरोसा करते हैं। @@ -537,7 +533,6 @@ @id ui.pictures तस्वीरें @id ui.plain सादा @id ui.plain_text सादा पाठ -@id ui.powered_by द्वारा संचालित @id ui.pressure_sensitivity_now_of_100 100 की {now} दबाव संवेदनशीलता @id ui.pressure_sensitivity_unavailable दबाव संवेदनशीलता अनुपलब्ध @id ui.previous पिछला @@ -745,7 +740,6 @@ @id ui.top शीर्ष @id ui.triangle त्रिभुज @id ui.type प्रकार -@id ui.under_the के नीचे @id ui.undo पूर्ववत करें @id ui.undo_ctrl_z पूर्ववत करें (Ctrl+Z) @id ui.undo_stroke Stroke पूर्ववत \n diff --git a/i18n/ja.tsv b/i18n/ja.tsv index 8b2111102..b09ec9148 100644 --- a/i18n/ja.tsv +++ b/i18n/ja.tsv @@ -354,7 +354,6 @@ @id ui.make_subpage サブページにする @id ui.make_the_page_larger ページを大きくする @id ui.make_the_page_smaller ページを小さくする -@id ui.many_thanks_to_its_authors_and_contributors — 著者および貢献者に心より感謝いたします。 @id ui.markdown Markdown @id ui.match_case 大文字と小文字を区別 @id ui.math 数学 @@ -369,7 +368,6 @@ @id ui.merge 結合 @id ui.mermaid Mermaid @id ui.mint ミント -@id ui.mit_license MIT ライセンス @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT または Apache-2.0、お選びください。コアラのイラストはこれに含まれません;ATTRIBUTION.md を参照してください。 @id ui.mode モード @id ui.modify_tool ツールを編集 @@ -464,11 +462,9 @@ @id ui.off_2 オフ @id ui.office_document オフィス文書 @id ui.office_text_inspection オフィステキストの検査 -@id ui.officeimo OfficeIMO @id ui.ok OK @id ui.one_tree_of_notebooks ノートブックの単一ツリー @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive および SharePoint: 構築されていません。NoteCraft をすでに同期ツールが監視しているフォルダを指すように設定すると、同じようになります。 -@id ui.onenote_import OneNote インポート @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 オンラインノートブック(OneDrive、SharePoint)は構築されていません。同期ツールが監視しているフォルダ内のノートブックはそれによって同期されます。 @id ui.only_a_list_item_can_be_indented リスト項目のみがインデントできます @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it ファイルと作成者を信頼できる場合のみ開いてください。 @@ -537,7 +533,6 @@ @id ui.pictures 画像 @id ui.plain プレーン @id ui.plain_text プレーンテキスト -@id ui.powered_by 提供元 @id ui.pressure_sensitivity_now_of_100 100の圧力感度{now} @id ui.pressure_sensitivity_unavailable 圧力感度が利用できません @id ui.previous 前へ @@ -745,7 +740,6 @@ @id ui.top トップ @id ui.triangle 三角形 @id ui.type タイプ -@id ui.under_the 下にある @id ui.undo 元に戻す @id ui.undo_ctrl_z 元に戻す (Ctrl+Z) @id ui.undo_stroke Undo\nstroke diff --git a/i18n/ko.tsv b/i18n/ko.tsv index 72a46c4c9..353b17487 100644 --- a/i18n/ko.tsv +++ b/i18n/ko.tsv @@ -354,7 +354,6 @@ @id ui.make_subpage 하위 페이지로 만들기 @id ui.make_the_page_larger 페이지 크기 키우기 @id ui.make_the_page_smaller 페이지 크기 줄이기 -@id ui.many_thanks_to_its_authors_and_contributors — 저자와 기여자들에게 깊은 감사를 드립니다. @id ui.markdown 마크다운 @id ui.match_case 대소문자 구분 @id ui.math 수학 @@ -369,7 +368,6 @@ @id ui.merge 병합 @id ui.mermaid Mermaid @id ui.mint 민트 -@id ui.mit_license MIT 라이선스 @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 선택에 따라 MIT 또는 Apache-2.0. 코알라 일러스트레이션은 해당 라이선스로 커버되지 않습니다. ATTRIBUTION.md를 참조하세요. @id ui.mode 모드 @id ui.modify_tool 도구 수정 @@ -464,11 +462,9 @@ @id ui.off_2 꺼짐 @id ui.office_document 오피스 문서 @id ui.office_text_inspection 오피스 텍스트 검사 -@id ui.officeimo OfficeIMO @id ui.ok 확인 @id ui.one_tree_of_notebooks 노트북의 단일 트리 @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive 및 SharePoint: 구축되지 않았습니다. 동기화 도구가 이미 감시하는 폴더를 NoteCraft에 지정하면 동일한 효과를 얻습니다. -@id ui.onenote_import OneNote 가져오기 @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 온라인 노트북(OneDrive, SharePoint)은 구축되지 않았습니다. 동기화 도구가 감시하는 폴더의 노트북은 해당 도구로 동기화됩니다. @id ui.only_a_list_item_can_be_indented 목록 항목만 들여쓰기할 수 있습니다 @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it 파일과 작성자를 신뢰할 때만 여십시오. @@ -537,7 +533,6 @@ @id ui.pictures 이미지 @id ui.plain 일반 @id ui.plain_text 일반 텍스트 -@id ui.powered_by 제공: @id ui.pressure_sensitivity_now_of_100 100의 압력 감도 {now} @id ui.pressure_sensitivity_unavailable 압력 감도 사용 불가 @id ui.previous 이전 @@ -745,7 +740,6 @@ @id ui.top 상단 @id ui.triangle 삼각형 @id ui.type 유형 -@id ui.under_the 아래의 @id ui.undo 실행 취소 @id ui.undo_ctrl_z 실행 취소 (Ctrl+Z) @id ui.undo_stroke 실행 취소 \n 스트로크 diff --git a/i18n/nl.tsv b/i18n/nl.tsv index 6a8fe042b..df981a531 100644 --- a/i18n/nl.tsv +++ b/i18n/nl.tsv @@ -498,7 +498,6 @@ @id ui.make_the_page_smaller Pagina verkleinen @id ui.making_a_printout_of_name Afdruk maken van {name}… @id ui.making_a_printout_of_name_page_done_of_total Afdruk maken van {name}: pagina {done} van {total} -@id ui.many_thanks_to_its_authors_and_contributors Met dank aan de auteurs en bijdragers. @id ui.markdown Markdown @id ui.match_case Hoofdletters en kleine letters onderscheiden @id ui.math Wiskunde @@ -513,7 +512,6 @@ @id ui.merge Samenvoegen @id ui.mermaid Mermaid @id ui.mint mint -@id ui.mit_license MIT-licentie @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT- of Apache-2.0-licentie, naar keuze. De koala-afbeelding valt hier niet onder. Zie ATTRIBUTION.md. @id ui.mode Modus @id ui.modify_tool Hulpmiddel aanpassen @@ -610,11 +608,9 @@ @id ui.off_2 uit @id ui.office_document Office-document @id ui.office_text_inspection Office-tekstinspectie -@id ui.officeimo OfficeIMO @id ui.ok OK @id ui.one_tree_of_notebooks Eén structuur met alle notitieblokken @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive en SharePoint zijn nog niet beschikbaar. Wijs NoteCraft naar een map die je synchronisatietool al bewaakt; dat werkt op dezelfde manier. -@id ui.onenote_import OneNote importeren @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 Online notitieblokken (OneDrive, SharePoint) zijn nog niet beschikbaar. Een notitieblok in een map die je synchronisatietool bewaakt, wordt daarmee gesynchroniseerd. @id ui.only_a_list_item_can_be_indented Alleen een lijstitem kan worden ingesprongen @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it Open het alleen als je het bestand en de maker ervan vertrouwt. @@ -683,7 +679,6 @@ @id ui.pictures Afbeeldingen @id ui.plain Eenvoudig @id ui.plain_text Platte tekst -@id ui.powered_by Mogelijk gemaakt door @id ui.pressure_sensitivity_now_of_100 Drukgevoeligheid: {now} van 100 @id ui.pressure_sensitivity_tip Bepaalt hoe sterk de pen op druk reageert. Bij een hogere instelling geeft lichte druk meer inkt. @id ui.pressure_sensitivity_unavailable Drukgevoeligheid niet beschikbaar @@ -908,7 +903,6 @@ @id ui.top Boven @id ui.triangle Driehoek @id ui.type Type -@id ui.under_the onder de @id ui.undo Ongedaan maken @id ui.undo_ctrl_z Ongedaan maken (Ctrl+Z) @id ui.undo_stroke Penstreek\nongedaan maken diff --git a/i18n/ru.tsv b/i18n/ru.tsv index 6207eede2..ab46343a0 100644 --- a/i18n/ru.tsv +++ b/i18n/ru.tsv @@ -354,7 +354,6 @@ @id ui.make_subpage Сделать подстраницей @id ui.make_the_page_larger Увеличить страницу @id ui.make_the_page_smaller Уменьшить страницу -@id ui.many_thanks_to_its_authors_and_contributors — большое спасибо авторам и участникам. @id ui.markdown Markdown @id ui.match_case С учётом регистра @id ui.math Математика @@ -369,7 +368,6 @@ @id ui.merge Объединить @id ui.mermaid Mermaid @id ui.mint мята -@id ui.mit_license Лицензия MIT @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT или Apache-2.0, на ваш выбор. Искусство с коалой не подпадает под него; см. ATTRIBUTION.md. @id ui.mode Режим @id ui.modify_tool Изменить инструмент @@ -464,11 +462,9 @@ @id ui.off_2 выкл @id ui.office_document Документ Office @id ui.office_text_inspection Анализ текста Office -@id ui.officeimo OfficeIMO @id ui.ok ОК @id ui.one_tree_of_notebooks Одно дерево блокнотов @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive и SharePoint: не реализовано. Укажите NoteCraft на папку, которую уже отслеживает ваш инструмент синхронизации, и всё будет работать. -@id ui.onenote_import Импорт из OneNote @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 Онлайн-блокноты (OneDrive, SharePoint) не реализованы. Блокнот в папке, отслеживаемой вашим инструментом синхронизации, будет синхронизироваться этим инструментом. @id ui.only_a_list_item_can_be_indented Отступить можно только элемент списка @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it Открывайте его только если вы доверяете файлу и человеку, который его создал. @@ -537,7 +533,6 @@ @id ui.pictures Изображения @id ui.plain Обычный @id ui.plain_text Простой текст -@id ui.powered_by Работает на базе @id ui.pressure_sensitivity_now_of_100 Чувствительность к давлению {now} из 100 @id ui.pressure_sensitivity_unavailable Чувствительность к давлению недоступна @id ui.previous Предыдущий @@ -745,7 +740,6 @@ @id ui.top Верх @id ui.triangle Треугольник @id ui.type Тип -@id ui.under_the под @id ui.undo Отменить @id ui.undo_ctrl_z Отменить (Ctrl+Z) @id ui.undo_stroke Отменить\nstroke diff --git a/i18n/tr.tsv b/i18n/tr.tsv index e3de02bb5..707b3d33f 100644 --- a/i18n/tr.tsv +++ b/i18n/tr.tsv @@ -430,7 +430,6 @@ @id ui.make_the_page_smaller Sayfayı küçült @id ui.making_a_printout_of_name {name} çıktısı oluşturuluyor… @id ui.making_a_printout_of_name_page_done_of_total {name} çıktısı oluşturuluyor: {done} / {total} sayfa -@id ui.many_thanks_to_its_authors_and_contributors — yazarlarına ve katkıda bulunanlara çok teşekkürler. @id ui.markdown Markdown @id ui.match_case Büyük/küçük harf eşleştir @id ui.math Matematik @@ -445,7 +444,6 @@ @id ui.merge Birleştir @id ui.mermaid Mermaid @id ui.mint nane yeşili -@id ui.mit_license MIT lisansı @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 İsteğinize bağlı olarak MIT veya Apache-2.0. Koala çizimi bunun kapsamında değildir; ATTRIBUTION.md dosyasına bakın. @id ui.mode Mod @id ui.modify_tool Aracı Düzenle @@ -541,11 +539,9 @@ @id ui.off_2 kapalı @id ui.office_document Office belgesi @id ui.office_text_inspection Office metin incelemesi -@id ui.officeimo OfficeIMO @id ui.ok Tamam @id ui.one_tree_of_notebooks Tek not defteri ağacı @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive ve SharePoint: geliştirilmedi. NoteCraft'ı eşitleme aracınızın zaten izlediği bir klasöre yönlendirmeniz aynı işi görür. -@id ui.onenote_import OneNote içe aktarma @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 Çevrimiçi not defterleri (OneDrive, SharePoint) geliştirilmedi. Eşitleme aracınızın izlediği bir klasördeki not defteri onun tarafından eşitlenir. @id ui.only_a_list_item_can_be_indented Yalnızca bir liste öğesi girintilenebilir @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it Yalnızca dosyaya ve onu oluşturan kişiye güveniyorsanız açın. @@ -614,7 +610,6 @@ @id ui.pictures Resimler @id ui.plain Düz @id ui.plain_text Düz metin -@id ui.powered_by Destekleyen: @id ui.pressure_sensitivity_now_of_100 Basınç hassasiyeti: {now} / 100 @id ui.pressure_sensitivity_unavailable Basınç hassasiyeti kullanılamıyor @id ui.previous Önceki @@ -833,7 +828,6 @@ @id ui.top Üst @id ui.triangle Üçgen @id ui.type Tür -@id ui.under_the altında @id ui.undo Geri al @id ui.undo_ctrl_z Geri al (Ctrl+Z) @id ui.undo_stroke Çizgiyi\ngeri al diff --git a/i18n/ur.tsv b/i18n/ur.tsv index 9beca8349..e2790b309 100644 --- a/i18n/ur.tsv +++ b/i18n/ur.tsv @@ -354,7 +354,6 @@ @id ui.make_subpage ذیلی صفحہ بنائیں @id ui.make_the_page_larger صفحے کو بڑا کریں @id ui.make_the_page_smaller صفحے کو چھوٹا کریں -@id ui.many_thanks_to_its_authors_and_contributors — اس کے مصنفین اور تعاون کرنے والوں کا بہت بہت شکریہ۔ @id ui.markdown مارک ڈاؤن @id ui.match_case کیس میچ @id ui.math ریاضی @@ -369,7 +368,6 @@ @id ui.merge میج @id ui.mermaid Mermaid @id ui.mint mint -@id ui.mit_license MIT لائسنس @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT یا Apache-2.0، آپ کی مرضی سے۔ کوآلا آرٹ ورک اس کے تحت نہیں ہے؛ ATTRIBUTION.md دیکھیں۔ @id ui.mode موڈ @id ui.modify_tool ٹول میں ترمیم @@ -464,11 +462,9 @@ @id ui.off_2 آف @id ui.office_document آفس دستاویز @id ui.office_text_inspection آفس ٹیکسٹ معائنہ -@id ui.officeimo OfficeIMO @id ui.ok ٹھیک ہے @id ui.one_tree_of_notebooks نوٹ بکس کا ایک درخت @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive اور SharePoint: تیار نہیں۔ NoteCraft کو اس فولڈر کی طرف اشارہ کریں جسے آپ کا سنک ٹول پہلے سے دیکھ رہا ہے، یہ وہی چیز ہے۔ -@id ui.onenote_import OneNote امپورٹ @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 آن لائن نوٹ بکس (OneDrive، SharePoint) تیار نہیں ہیں۔ آپ کے سنک ٹول کے ذریعے دیکھے جانے والے فولڈر میں موجود نوٹ بک اس کے ذریعے سنک ہوتی ہے۔ @id ui.only_a_list_item_can_be_indented صرف فہرست کا ایک آئٹم انڈینٹ کیا جا سکتا ہے @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it صرف اس صورت میں کھولیں جب آپ فائل اور اسے بنانے والے شخص پر بھروسہ کریں۔ @@ -537,7 +533,6 @@ @id ui.pictures تصاویر @id ui.plain سادہ @id ui.plain_text سادہ متن -@id ui.powered_by چلانے والا @id ui.pressure_sensitivity_now_of_100 دباؤ حساسیت {now} 100 کا @id ui.pressure_sensitivity_unavailable دباؤ حساسیت دستیاب نہیں @id ui.previous پچھلا @@ -745,7 +740,6 @@ @id ui.top اوپر @id ui.triangle مثلث @id ui.type ٹائپ -@id ui.under_the کے تحت @id ui.undo واپس لیں @id ui.undo_ctrl_z واپس لیں (Ctrl+Z) @id ui.undo_stroke \n اسٹروک واپس لیں diff --git a/i18n/zh.tsv b/i18n/zh.tsv index 31db65944..fa256e43d 100644 --- a/i18n/zh.tsv +++ b/i18n/zh.tsv @@ -355,7 +355,6 @@ @id ui.make_subpage 设为子页面 @id ui.make_the_page_larger 放大页面 @id ui.make_the_page_smaller 缩小页面 -@id ui.many_thanks_to_its_authors_and_contributors —— 衷心感谢其作者和贡献者。 @id ui.markdown Markdown @id ui.match_case 区分大小写 @id ui.math 数学 @@ -370,7 +369,6 @@ @id ui.merge 合并 @id ui.mermaid Mermaid @id ui.mint 薄荷色 -@id ui.mit_license MIT 许可证 @id ui.mit_or_apache_2_0_at_your_option_the_koala_artwork_i_2ad8f523c0 MIT 或 Apache-2.0,由您选择。考拉图案不受其覆盖;请参阅 ATTRIBUTION.md。 @id ui.mode 模式 @id ui.modify_tool 修改工具 @@ -465,11 +463,9 @@ @id ui.off_2 关闭 @id ui.office_document Office 文档 @id ui.office_text_inspection Office 文本检查 -@id ui.officeimo OfficeIMO @id ui.ok 确定 @id ui.one_tree_of_notebooks 一个笔记本树 @id ui.onedrive_and_sharepoint_not_built_point_notecraft_at_584930dc1b OneDrive 和 SharePoint:未内置。将 NoteCraft 指向同步工具已监控的文件夹即可实现相同效果。 -@id ui.onenote_import OneNote 导入 @id ui.online_notebooks_onedrive_sharepoint_are_not_built_a_860f0281c0 在线笔记本(OneDrive、SharePoint)未内置。位于同步工具监控文件夹中的笔记本将由该工具同步。 @id ui.only_a_list_item_can_be_indented 只有列表项可以缩进 @id ui.only_open_it_if_you_trust_the_file_and_the_person_who_created_it 仅当您信任该文件及其创建者时才打开。 @@ -538,7 +534,6 @@ @id ui.pictures 图片 @id ui.plain 纯文本 @id ui.plain_text 纯文本 -@id ui.powered_by 技术支持 @id ui.pressure_sensitivity_now_of_100 压感 {now} 为 100 @id ui.pressure_sensitivity_unavailable 压感不可用 @id ui.previous 上一个 @@ -748,7 +743,6 @@ @id ui.top 顶部 @id ui.triangle 三角形 @id ui.type 类型 -@id ui.under_the 在……下方 @id ui.undo 撤销 @id ui.undo_ctrl_z 撤销 (Ctrl+Z) @id ui.undo_stroke 撤销\n笔画 diff --git a/packaging/windows/notecraft.wxs b/packaging/windows/notecraft.wxs index 3b3d868ab..432600e18 100644 --- a/packaging/windows/notecraft.wxs +++ b/packaging/windows/notecraft.wxs @@ -111,16 +111,6 @@ - - - - - - - - - - diff --git a/packaging/windows/package.ps1 b/packaging/windows/package.ps1 index 1c6ffe94e..89a74c84a 100644 --- a/packaging/windows/package.ps1 +++ b/packaging/windows/package.ps1 @@ -27,9 +27,7 @@ #> param( [switch] $SkipBuild, - [switch] $ZipOnly, - [string] $BridgeProject = (Join-Path $PSScriptRoot '..\..\tools\officeimo\OfficeIMO.NoteCraft.Bridge\OfficeIMO.NoteCraft.Bridge.csproj'), - [string] $BridgeBinary = $env:NOTECRAFT_OFFICEIMO_BRIDGE + [switch] $ZipOnly ) $ErrorActionPreference = 'Stop' $Root = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path @@ -136,18 +134,6 @@ Invoke-Native 'stage bundled offline transcription' { throw 'demo staging failed: a format start page is missing' } -# The importer is part of the Windows product, not an optional file that can silently be -# omitted from a release. Build and stage the self-contained OfficeIMO bridge beside NoteCraft. -$BridgeStage = Join-Path $TargetDir 'officeimo-package' -Remove-Item -Recurse -Force $BridgeStage -ErrorAction SilentlyContinue -New-Item -ItemType Directory -Force -Path $BridgeStage | Out-Null -$LASTEXITCODE = 0 -& (Join-Path $Root 'tools\officeimo\package.ps1') -BridgeProject $BridgeProject -BridgeBinary $BridgeBinary -Rid 'win-x64' -Version $Version -OutputRoot $BridgeStage -if ($LASTEXITCODE -ne 0) { throw "OfficeIMO bridge packaging failed with exit code $LASTEXITCODE" } -$BridgeExe = Join-Path $BridgeStage 'importers\officeimo\win-x64\officeimo-notecraft.exe' -if (-not (Test-Path $BridgeExe)) { throw "OfficeIMO bridge was not produced: $BridgeExe" } -Copy-Item (Join-Path $BridgeStage 'importers') $Stage -Recurse - & (Join-Path $PSScriptRoot 'sign.ps1') (Join-Path $Stage 'notecraft.exe') (Join-Path $Stage 'notecraft-cli.exe') (Join-Path $VoiceStage 'whisper-cli.exe') # The notices travel with the program: the installer and the portable zip both carry them, and the diff --git a/tools/officeimo/OfficeIMO.NoteCraft.Bridge/OfficeIMO.NoteCraft.Bridge.csproj b/tools/officeimo/OfficeIMO.NoteCraft.Bridge/OfficeIMO.NoteCraft.Bridge.csproj deleted file mode 100644 index 392962709..000000000 --- a/tools/officeimo/OfficeIMO.NoteCraft.Bridge/OfficeIMO.NoteCraft.Bridge.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - Exe - net8.0 - enable - enable - officeimo-notecraft - true - true - - - - - - - diff --git a/tools/officeimo/OfficeIMO.NoteCraft.Bridge/Program.cs b/tools/officeimo/OfficeIMO.NoteCraft.Bridge/Program.cs deleted file mode 100644 index 5a801d1aa..000000000 --- a/tools/officeimo/OfficeIMO.NoteCraft.Bridge/Program.cs +++ /dev/null @@ -1,36 +0,0 @@ -using OfficeIMO.OneNote; -using OfficeIMO.OneNote.Html; -using OfficeIMO.OneNote.Markdown; - -static string Required(string[] args, string name) -{ - var index = Array.IndexOf(args, name); - if (index < 0 || index + 1 >= args.Length || string.IsNullOrWhiteSpace(args[index + 1])) - throw new ArgumentException($"Missing required argument {name}."); - return args[index + 1]; -} - -try -{ - var source = Path.GetFullPath(Required(args, "--source")); - var output = Path.GetFullPath(Required(args, "--out")); - var format = Required(args, "--format").ToLowerInvariant(); - if (!File.Exists(source) || !source.EndsWith(".one", StringComparison.OrdinalIgnoreCase)) - throw new ArgumentException("--source must name an existing .one section file."); - if (format is not ("html" or "cmgfm")) - throw new ArgumentException("--format must be html or cmgfm."); - - Directory.CreateDirectory(output); - var section = OneNoteSectionReader.Read(source); - if (format == "html") - File.WriteAllText(Path.Combine(output, "index.html"), section.ToHtmlDocument()); - else - File.WriteAllText(Path.Combine(output, "index.md"), section.ToMarkdownDocument(new OneNoteMarkdownOptions()).ToMarkdown()); - Console.WriteLine($"Imported {Path.GetFileName(source)} to {output}"); - return 0; -} -catch (Exception error) -{ - Console.Error.WriteLine(error.Message); - return 1; -} diff --git a/tools/officeimo/README.md b/tools/officeimo/README.md deleted file mode 100644 index de4f7921d..000000000 --- a/tools/officeimo/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# OfficeIMO release bundle - -NoteCraft loads the optional OfficeIMO bridge from: - -```text -/importers/officeimo//officeimo-notecraft[.exe] -``` - -Build a self-contained release bundle with: - -```powershell -pwsh tools/officeimo/package.ps1 ` - -BridgeProject path/to/OfficeIMO.NoteCraft.Poc.csproj ` - -Rid win-x64 ` - -Version 0.0.7 ` - -OutputRoot path/to/release -``` - -Run it once for each supported RID: `win-x64`, `linux-x64`, `osx-x64`, and `osx-arm64`. -The script records the SHA-256 of each executable in `manifest.json`. Release packaging must -also copy the OfficeIMO and transitive dependency license files beside that manifest. Do not -commit generated binaries to the source repository. diff --git a/tools/officeimo/package.ps1 b/tools/officeimo/package.ps1 deleted file mode 100644 index 354ddd33e..000000000 --- a/tools/officeimo/package.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -[CmdletBinding()] -param( - [Parameter(Mandatory)] [string]$BridgeProject, - [Parameter(Mandatory)] [string]$Rid, - [Parameter(Mandatory)] [string]$Version, - [Parameter(Mandatory)] [string]$OutputRoot, - [string]$BridgeBinary -) - -$ErrorActionPreference = 'Stop' -$root = (Resolve-Path $OutputRoot).Path -$name = if ($env:OS -eq 'Windows_NT') { 'officeimo-notecraft.exe' } else { 'officeimo-notecraft' } -$target = Join-Path $root 'importers\officeimo' -$publish = Join-Path $target $Rid -New-Item -ItemType Directory -Force -Path $publish | Out-Null - -if ($BridgeBinary) { - $published = Join-Path $publish $name - Copy-Item -LiteralPath (Resolve-Path $BridgeBinary).Path -Destination $published -Force -} else { - $project = (Resolve-Path $BridgeProject).Path - dotnet publish $project -c Release -f net8.0 -r $Rid -p:TargetFrameworks=net8.0 -p:TargetFramework=net8.0 -p:RunAnalyzers=false --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -o $publish - $published = Join-Path $publish $name - if (-not (Test-Path $published)) { - $candidate = Get-ChildItem -LiteralPath $publish -Filter '*.exe' -File | Select-Object -First 1 - if (-not $candidate) { throw "publish did not produce an executable under $publish" } - Move-Item -LiteralPath $candidate.FullName -Destination $published -Force - } -} -$binary = $published -$hash = (Get-FileHash -LiteralPath $binary -Algorithm SHA256).Hash.ToLowerInvariant() -$manifest = [ordered]@{ - bridge = 'OfficeIMO' - version = $Version - rid = $Rid - executable = "importers/officeimo/$Rid/$name" - sha256 = $hash - license = 'OfficeIMO and transitive dependency licenses must ship beside this manifest.' -} -$manifest | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $target 'manifest.json') -Encoding utf8 -Write-Output "OfficeIMO bundle: $binary" -Write-Output "SHA-256: $hash" diff --git a/xtask/src/main.rs b/xtask/src/main.rs index f247e8534..13720de8a 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -176,7 +176,6 @@ fn generated_root_entry(root: &Path, path: &Path) -> bool { return false; }; matches!(name, ".git" | ".phase1" | "dist" | "target" | "out" | "prototypes" | "snapshots" | "my-notebooks") - || name.starts_with(".work-officeimo-") } fn files_under(root: &Path, dir: &Path, out: &mut Vec) -> Result<(), String> { @@ -816,7 +815,7 @@ mod tests { #[test] fn walker_excludes_generated_root_directories() { let tree = TestTree::new(); - for name in [".git", ".phase1", "dist", "target", "out", "prototypes", "snapshots", "my-notebooks", ".work-officeimo-test"] { + for name in [".git", ".phase1", "dist", "target", "out", "prototypes", "snapshots", "my-notebooks"] { let generated = tree.0.join(name); fs::create_dir(&generated).expect("generated directory"); fs::write(generated.join("not-source.md"), "generated").expect("generated file");