EDITORCLASSBLOGLOGINOpkleOpkle, the Editor for CreatorsInfiniteExpression,In New Forms.New ContentOpkle makes an editor so anyone can build for the web without code, and share it anywhere.Blending text and screen, we build tools that make the web about imagination, not code.Building Opkle Editor: A Spreadsheet for Table Imagesdev17Building Opkle Editor: One Dataset as Table, Board, Calendardev18Building Opkle Editor: A Publisher for Books on the Webdev19Building Opkle Editor: Publishing the Edit View to the Webdev20Building Opkle Editor: How the EPUB Editor Ties It Togetherdev211213141516...20 Building Opkle Editor: Publishing the Edit View to the Web

After finishing the Publisher's preview and design state, I built the publishing system that moves that screen to a real public URL. The goal here was clearer than just uploading files to a server. The workspace I checked in the editor had to run on the browser's public page with the same size calculations, the same chapter navigation, and the same theme and responsive behavior.

A typical web export reads the editing data and generates fresh HTML. But once the output is produced separately, the editor and the published copy become two different interpreters from that moment on. Whenever I fix the page calculation or mobile navigation on one side, I have to repeat the same change on the other, and the slightest drift makes the real link differ from the result I approved in the preview.

I didn't define publishing as a transformation that generates a new document. I saw it as the process of preserving, in another execution environment, the document meaning that was fixed at editing time. More important than how I split responsibilities between server and browser was the principle that the same input state must produce the same observable result in different environments. In Part 20, I'd like to lay out that principle as mathematical properties of the public document.

Snapshot semantics

If the document at publication time is \(\sigma_t\), the published copy must read a state fixed at a specific moment, not an editing state that keeps changing. Otherwise, only some of the values changed while the publish request was in progress get mixed in, and a document that never actually existed at any point in time can be created. A snapshot isn't just a copy; it is a consistent observation at a single logical instant.

If I write the render result as \(R(\sigma,e)\), then \(e\) is the execution environment, such as screen size and input method. The editor and the public page can't have exactly the same environment, so the entire pixel array doesn't need to be identical. Instead, the content, reading order, constraints and permitted interactions must have the same meaning. The first job was to separate what may vary with the environment from the invariants of the document itself.

A snapshot must be complete, but it needn't be redundant. Completeness means the information needed to determine the published result doesn't depend on external mutable state. By contrast, re-copying content the source already holds, or storing every value that can be derived by computation, only inflates the state space. Like a minimal sufficient statistic, I kept only the information needed to reproduce the result, and drew the boundary so that this alone can determine the observed meaning.

If a normalization function \(N\) satisfies \(N(N(\sigma))=N(\sigma)\), old and new states meet at the same normal form. Missing values, out-of-range values and equivalent values that differ only in representation don't produce a different result at each boot. Thanks to this idempotent normalization, a published snapshot became a stable semantic unit across changes of time and execution environment.

Resource closure

An ebook isn't made of the body text alone. If a document references fonts, images, styles and an internal navigation structure, the unit that can be published is not the starting file but the closure of the reference graph. If the resource graph is \(G=(V,E)\) and the root document is \(r\), the set of required resources is \(\mathrm{Reach}(r)\), the set of vertices reachable from \(r\).

If even one element is missing from this set, the document exists only partially. When the body opens but the fonts differ, or the cover shows but the images inside vanish, it means that a successful file transfer and a successful preservation of the document are different things. So it was more accurate to see the unit of publication as a self-contained graph defined by reachability, not as a list of individual files.

Conversely, if unreachable resources keep being included, the snapshot grows needlessly and stale information lingers. Computing the graph closure and excluding every vertex outside it is the same principle as mark-and-sweep in garbage collection. Starting from the root, I mark only what is needed, and resources that contribute nothing to the observed result can be removed from the published meaning.

Resources that aren't essential to running the body, such as a representative image, I kept in a separate optional set. With a required set \(M\) and an auxiliary set \(A\), publishability is decided by the completeness of \(M\), and a failure in \(A\) may be a drop in quality but must not become a failure of the document itself. With this distinction made clear, I got self-containedness and resilience together, without a problem with a single resource halting the whole publication.

Atomic publication

The state to avoid most in a publishing system is a document that readers can reach but whose content isn't fully ready. If the externally observable state is \(U\) and the ready state is \(C\), it is best for the transition to appear logically in one step, \(U\to C\). Even if several jobs are needed internally, no intermediate state should be exposed to an outside observer.

This requirement is broader than database atomicity. Large resources and small metadata differ in cost and failure patterns, and cramming everything into one physical transaction doesn't make the problem go away. What matters is deciding which point serves as the linearization point of the publication. Before that point the previous version must be valid, and after it the entire new version must be valid.

I split the failure model explicitly as well. A failure before preparation must return to a state in which nothing has been published, and a cleanup failure after commit must not roll back a publication that has already succeeded. Writing this as a state machine makes it clear which failures are compensable in the transitions among prepare \(P\), commit \(C\) and cleanup \(K\). If every error is undone in the same way, even a successful result ends up damaged.

Retryability comes from idempotence. If applying the same publish intent \(q\) twice satisfies \(F(F(s,q),q)=F(s,q)\), a re-request after a network drop won't create a duplicate document. I verified publishing, updating and recovery against this principle, and stabilized things so that from the outside one only ever observes either the complete previous state or the complete new state.

Identity and Namespace

A document's content, its identity and the name readers use are not the same thing. Content changes over time, identity ties those changes into a single document history, and the public name is the result of mapping an identity into an external namespace. If these three layers are merged, the address changes whenever the content is edited, or different documents collide just because their names happen to be the same.

If the identity set is \(I\) and the public name set is \(N\), name assignment can be seen as a partial function \(u:I\rightharpoonup N\). For documents that are currently public, this function must be injective. \(u(i_1)=u(i_2)\) must imply \(i_1=i_2\), so that one name never points to two documents at once. Meanwhile a new version of the same identity must keep corresponding to the same name.

Objects with a containment relationship, such as a project and the publications within it, also have separate identities. A name that refers to a set and a name that refers to an element of the set can't substitute for each other. From the relational viewpoint they have different candidate keys, and from the graph viewpoint they are different kinds of vertices. If a child object were assumed to be the same just because its parent object is the same, ambiguity would arise the moment multiple documents are handled.

I treated identity as nominal identity rather than value comparison. Documents with the same content can still be different documents, and a document whose content changed can still be the same document. After setting this standard, external names stayed steady through repeated editing and republishing, and several kinds of documents could coexist in one workspace without intruding on each other's public history.

Reference monitor

A public address can be known by anyone, so knowing an address must not imply the authority to change anything. If the set of principals is \(S\), the set of objects is \(O\) and the set of permissions is \(P\), the access policy can be expressed as an access matrix \(A:S\times O\to2^P\). Reading, editing, publishing and switching to private are different permissions, and there's no reason to bundle them under the same condition.

Every sensitive operation has to pass through a reference monitor. As in the classic conditions, the monitor must be completely mediating and non-bypassable, its own policy must not be tamperable, and it must be small and clear enough to be verified. If permission checks are scattered across many processing stages, the chance that one path misses them grows. Conversely, when a single policy boundary governs every state change, it becomes easier to prove the system's security invariants.

The order of checks is also part of safety. If an observable side effect occurs before the permission decision, the system state may already have changed even if the request is ultimately rejected. So a safe transition must keep the order \(precondition\Rightarrow effect\), and when a decision can't be settled, it must fall into the deny set rather than the allow set. This is the fail-closed principle.

Whether a document is public is a security state different from the existence of its identity. Switching to private doesn't erase the document's history, and merely existing doesn't make a document observable by everyone. If the visibility lattice is \(private\preceq public\), publishing is an upward flow of information and going private is the removal of outside observation paths. Applying this distinction, I completed the work so that the permission boundaries of publishing, unpublishing and recovery stay consistent.

Relational metadata

The metadata of a public document is smaller than the binary body, but it decides identity and discoverability. If I view it only as one giant record, it's hard to tell which value functionally depends on what. If a relation \(R\) has a functional dependency \(X\to Y\), then two tuples with the same determinant \(X\) must have the same \(Y\). This rule became the standard for organizing the relationships among document, user, public name and time information.

The purpose of normalization isn't to create lots of tables but to prevent update anomalies. When one fact is repeated in several places, a contradiction arises the moment only some of them change. Conversely, splitting values that are always read together too finely only adds join costs and points of failure. I divided facts by meaning, into facts about identity, presentation snapshots and references to large resources, so that each fact has one authoritative location.

Time isn't a single value either. The creation time is the start of the document's history, and the last-modified time indicates the freshness of the current version. If both are overwritten by the same rule, the document's origin changes every time it is republished. Separating immutable time from mutable time lets sorting, caching and audit records each keep their own meaning.

It also has to be clear what to trust when the local editing state and the public state differ. In a distributed system with several replicas, not all copies can be the authority at once. Facts that affect the outside world, like whether something is public, are decided in a single authoritative relation, and the remaining state is treated as a projection that shows that fact quickly. Thanks to this principle, the public state was restored without contradiction even after a refresh or reconnection.

Observable shell

A public document must carry at least minimal meaning even before all of its executable code is ready. Search engines, share previews and assistive technologies observe a document differently from a finished interactive screen. So the initial response should provide the document's external meaning, such as the title, description, representative resources and canonical address, and the execution environment that follows should add interaction progressively.

This can be seen as monotonic enhancement. If the initial set of observed information is \(O_0\) and the set after execution is \(O_1\), then \(O_0\subseteq O_1\) must hold. Even as features are added, the title or document identity delivered at first must not be overturned. Instead of becoming different documents depending on whether JavaScript runs, the same document offers richer operations.

Moving strings into several language contexts also requires per-context encoding. HTML body, attributes, URLs and script data have different permitted grammars, so a single escape function can't handle them all. Only by producing a safe representation according to the grammar of the target language the value goes into can data that crosses a boundary avoid being interpreted as structure itself. The safety of a public document is also decided by this kind of rigor at language boundaries.

I considered quickly observed values, such as the first screen's background and its basic geometry, to be part of the document's meaning too. Even an arbitrary screen that flashes briefly before the body is ready is a real result to the reader. I reduced the visual discontinuity between the initial and final observation, and organized the public screen so that the document's identity and access path remain even without any interaction.

Behavioral equivalence

Saying that the editor's preview and the public reader are the same doesn't mean the code strings are the same. If I view the two systems as labeled transition systems \(M_1=(S_1,A,\to_1)\) and \(M_2=(S_2,A,\to_2)\), then for the same user action they must move to corresponding states and be able to observe the same result. This is a question of behavioral equivalence.

If there is a relation \(\mathcal{B}\subseteq S_1\times S_2\) between the two sets of states such that for every transition \(s_1\xrightarrow{a}s'_1\) on one side there exists \(s_2\xrightarrow{a}s'_2\) on the other with \((s'_1,s'_2)\in\mathcal{B}\), then the two systems are in a bisimulation relation. As long as page navigation, chapter selection, changes in screen conditions and theme switching keep this relation, readers experience the same document even though the internal environments differ.

The public reader offers no editing operations, so the operation sets of the two transition systems can't be exactly the same. The public mode can be seen as a subalgebra that picks only the read operations from the editing transition system. What was removed is not the document's meaning but the authority to change state. The operations needed for observation and navigation have to stay closed.

Instead of maintaining two implementations that merely make the screen look similar, I reviewed against whether the same semantic function holds in both environments. The responsive boundaries, page ratios, chapter selection and transition results all kept their correspondence, and things were stabilized into a structure in which an improvement on one side doesn't break the meaning on the other.

Deterministic boot

Booting the public reader means loading several resources at the same time, but the result must not depend on the accident of execution speed. If I write the boot states as \(B_0,B_1,\ldots,B_n\), each transition may move to the next state only when its required preconditions are met. Tasks that can be prepared independently may run in parallel, but the commitment of the observable screen has to happen from one consistent state.

Determinism doesn't mean fixing the order of every event. It is closer to confluence: even if independent events occur in a different order, the final state must be the same. If two transitions \(a,b\) are independent, \(a(b(s))=b(a(s))\) holds, and an ordering is imposed only where there is a dependency. Keeping this property produces the same document regardless of network and device performance.

Screen size changes also have to distinguish continuous noise from meaningful state changes. When small changes repeat near a threshold, chattering can occur, with two modes flipping back and forth. Using hysteresis, which sets different entry and exit boundaries, or a stable interval of a certain duration is the standard control-theory remedy for this kind of instability.

I set the final reveal point to after the state machine has converged and the closure of the required resources is ready. At the same time, I kept a liveness condition so that a delay in some non-essential resource can't block the whole system forever. Across repeated network delays and screen transitions, I confirmed that the first chapter, the reading order and the geometry state boot to the same result.

Persistent publication

What matters in republishing is the persistence of the document's identity more than the creation of new files. If the versions of a document \(i\) are \(v_0,v_1,\ldots,v_n\), the public address should point to the whole family of versions rather than to one specific version. Readers see the latest valid version under the same name, and the system must be able to distinguish the temporal relationships among versions when needed.

This structure follows the principle of persistent identifiers. A name has to be a function of the document's identity, not of its location or its byte array. If the name changes every time the content does, external references break, and if different documents share one name, referential integrity collapses. Separating a stable name from a mutable payload preserves both edits and outside citations.

A cache that doesn't know this time model can keep showing stale observed values. Including the logical version \(v\) in the observation key keeps the same identity while distinguishing the new state from the old one. What matters isn't eliminating caches outright but making clear the equivalence relation for when two representations can be treated as the same value.

I repeatedly reviewed flowing EPUBs and fixed-layout documents, new publications and updates to the same address, failures of required and optional resources, mobile and desktop, switching between public and private, permission denials, normalization of old snapshots and cache refresh. I confirmed that the content, reading order, layout constraints and interactions of the editor and the public page keep the same meaning. The Publisher system, which publishes an edited book as a web document without conversion loss, was fully implemented and stabilized.

PreviousListNext
CopyrightAll design outputs and videos on this website are copyrighted by Abstract Cloud and protected under copyright law and related regulations. All content, including web, video, text, cover, and interior designs, is the property of the copyright holder. Unauthorized reproduction, distribution, creation of derivative works, or online sharing without prior consent is strictly prohibited. Violations may result in civil and criminal liability under copyright law. Legitimate purchases and copyright protection preserve creators' rights and fuel better works in return.Copyright: Abstract Cloud | CEO: Bae Changkyu
© Abstract Cloud. All Rights Reserved.
HOMEFAQTerms of ServicePrivacy PolicyRefund PolicySeller Informationhelp@opkle.app
+82 10-2747-3403
Business Name :Abstract Cloud  |  CEO :Bae ChangkyuBusiness Registration Number :249-74-00533E-commerce Registration Number :2025-Uijeongbu Songsan-0634Address :402, 108-dong, 49 Buyong-ro, Uijeongbu-si, Gyeonggi-do, Republic of KoreaAll content, designs, and source code on this website
are copyrighted by Opkle.
Opkle