Minimal object containing this commit
Commit Diff
commit 5fbdec60e4f8c6efd75a541e0202d41443e89e7a186b475729e9ae51ae955fe1
Author: yihanwu1024 <yihanwu1024>
Date: Tue Nov 18 23:13:19 2025 +0000
create article about my new Web
diff --git a/35fdd93b8a0667e53f4bd27f1a7d319b7a83c9fcef445f637f7b37b76cb1a8f7 b/35fdd93b8a0667e53f4bd27f1a7d319b7a83c9fcef445f637f7b37b76cb1a8f7
new file mode 100644
index 0000000..925da5b
--- /dev/null
+++ b/35fdd93b8a0667e53f4bd27f1a7d319b7a83c9fcef445f637f7b37b76cb1a8f7
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="35fdd93b8a0667e53f4bd27f1a7d319b7a83c9fcef445f637f7b37b76cb1a8f7">
+<title>Implementation Notes</title>
+<para>Each object has a 256-bit ID serialized as hexadecimal string.
+This applies to named objects, immutable objects, and Git hashes.
+The length of the ID is chosen to coincide with that of the ubiquitous SHA-256.
+Note: Named objects are still not content-addressed, despite having names that have the same format as hashes.
+For named objects, each ID lives once at most.
+An object with some ID can be created if the ID has not been used before.
+At the same time, IDs must be unique across named objects, immutable objects, and commit hashes.</para>
+<para>Immutables are not stored in the Git repository.
+One day they might be on IPFS, but today it is in a plain directory on my server.
+A nuance that I handled was the automatic serving of MIME types, since I wanted to query with only a 256-bit ID.</para>
+<blockquote>
+<para>问群友一个 nginx 配置问题。我有一堆无扩展名的的文件,但是我知道它们的 mime type。如何让 nginx 以正确的 mime type 来 serve 它们?我可以在服务器上给它们加扩展名,但是必须支持客户端发出不带扩展名的请求。每一个文件 mime type 都不一样而且无规律。我不能把这个映射放在这个配置里,它需要是放在文件系统上的,我有几百条这个映射。</para>
+<para>每个文件 ln 到正确扩展名。然后 nginx 里 try_files 把所有扩展名列一遍。</para>
+<para>截至发稿收获了 2 个 🎉</para>
+</blockquote>
+<para>All named objects are written in DocBook XML.
+XInclude is supported.
+The single database for named objects is a Git repository.
+It contains a flat set of files; there is no hierarchy.
+Each file has the same name as its <literal>xml:id</literal> at the XML root node.
+There is no file name extension.
+Multiple users can work on the same named object in the Git way, meaning each change has a provenance.</para>
+<para>During compilation, for each Git commit, a coreferences table is constructed.
+Naively, for each commit, this computation takes <inlineequation><!--O(n)--><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></inlineequation> time where <inlineequation><!--n--><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi></math></inlineequation> is the number of objects at that snapshot.
+This algorithm is currently deployed.
+Compilation is not done for references, because it takes <inlineequation><!--O(1)--><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>O</mi><mo>(</mo><mn>1</mn><mo>)</mo></math></inlineequation> time.</para>
+</section>
diff --git a/3813be1edef8b3c80fc9b57535668b11045c39372b5c2022aca98281f3c9b84f b/3813be1edef8b3c80fc9b57535668b11045c39372b5c2022aca98281f3c9b84f
new file mode 100644
index 0000000..320ad99
--- /dev/null
+++ b/3813be1edef8b3c80fc9b57535668b11045c39372b5c2022aca98281f3c9b84f
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="3813be1edef8b3c80fc9b57535668b11045c39372b5c2022aca98281f3c9b84f">
+<title>Named</title>
+<itemizedlist>
+<listitem>
+<para>name-addressed (the name does not have to be human-readable)</para>
+</listitem>
+<listitem>
+<para>will go on to have a human-readable title, but not as the address</para>
+</listitem>
+<listitem>
+<para>meaningful</para>
+</listitem>
+<listitem>
+<para>warrants versioning</para>
+</listitem>
+<listitem>
+<para>can refer to other resources independently in each version</para>
+</listitem>
+<listitem>
+<para>versioning only applies to writes</para>
+</listitem>
+<listitem>
+<para>usually requires central authority, or owner</para>
+</listitem>
+<listitem>
+<para>can have namespaces</para>
+</listitem>
+<listitem>
+<para>global namespace must have global version ordering</para>
+</listitem>
+</itemizedlist>
+<para>This has been implemented in the following way: all meaningful objects are in XML, and their root element each has a <literal>xml:id</literal>.</para>
+</section>
diff --git a/427a1373d3f7e171c599f19a55b279b323d436a73e36b57683d6d8685ffca915 b/427a1373d3f7e171c599f19a55b279b323d436a73e36b57683d6d8685ffca915
new file mode 100644
index 0000000..12a910a
--- /dev/null
+++ b/427a1373d3f7e171c599f19a55b279b323d436a73e36b57683d6d8685ffca915
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="427a1373d3f7e171c599f19a55b279b323d436a73e36b57683d6d8685ffca915">
+<title>Non-features</title>
+<itemizedlist>
+<listitem>
+<para>No dependent history: It is not possible to transclude a past revision of any named object.</para>
+</listitem>
+</itemizedlist>
+</section>
diff --git a/5e5261af24051a8af902c67807a322f2c087ffcb939b297a5c3733ba9f298c43 b/5e5261af24051a8af902c67807a322f2c087ffcb939b297a5c3733ba9f298c43
new file mode 100644
index 0000000..a118523
--- /dev/null
+++ b/5e5261af24051a8af902c67807a322f2c087ffcb939b297a5c3733ba9f298c43
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="5e5261af24051a8af902c67807a322f2c087ffcb939b297a5c3733ba9f298c43">
+<title>Managing the data</title>
+<para>Proposing the following dichotomy.
+An item is either content-addressed and immutable, or name-addressed, mutable, owned and versioned.</para>
+<include xmlns="http://www.w3.org/2001/XInclude" href="eada661c8a090982b0fbc89c0b5c397111f608ee2a4faf5bda9ea17d0d604485"/>
+<include xmlns="http://www.w3.org/2001/XInclude" href="3813be1edef8b3c80fc9b57535668b11045c39372b5c2022aca98281f3c9b84f"/>
+<include xmlns="http://www.w3.org/2001/XInclude" href="9afeb4befad7ff0f4655c9045c004d8a85f85ccc7fe9b595f6460a71d4fc4cbd"/>
+</section>
diff --git a/72f331af11242841c9995ea2472472ddf3e08c57577487a79778c85cf70bde1c b/72f331af11242841c9995ea2472472ddf3e08c57577487a79778c85cf70bde1c
new file mode 100644
index 0000000..194052d
--- /dev/null
+++ b/72f331af11242841c9995ea2472472ddf3e08c57577487a79778c85cf70bde1c
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="72f331af11242841c9995ea2472472ddf3e08c57577487a79778c85cf70bde1c">
+<title>Objects and History</title>
+<para>History only makes sense for mutable objects.
+In the past, I have seen history-enabled systems done by wrapping a global history around the business semantics.
+For example, a database with a transaction log is such a system.
+This kind of systems have a problem:
+It is not trivial to answer questions about the lifecycle of objects inside the system.
+An object in this system can get deleted, but its identifier remains available for future use.
+In contrast, on my new Web, every identifier has exactly one life.
+Reusing the identifier of a dead object is prohibited.</para>
+<para>Can we theorize this?
+There seems to be a mixture of linearity and nonlinearity here.
+The linear part is every identifier having exactly one life.
+The nonlinear part is the forced creation of new identifiers for new objects.</para>
+</section>
diff --git a/95f09183736961085b4e82fc88b96be97a829ac9bc3c41ed16459c3ba90218a4 b/95f09183736961085b4e82fc88b96be97a829ac9bc3c41ed16459c3ba90218a4
new file mode 100644
index 0000000..b6524db
--- /dev/null
+++ b/95f09183736961085b4e82fc88b96be97a829ac9bc3c41ed16459c3ba90218a4
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="95f09183736961085b4e82fc88b96be97a829ac9bc3c41ed16459c3ba90218a4">
+<title>My New Web</title>
+<include xmlns="http://www.w3.org/2001/XInclude" href="aed5891d7d7783ef09cf3878e10c5c3f3a5cd63e27c2bfc03a312e3c765e3713"/>
+<include xmlns="http://www.w3.org/2001/XInclude" href="5e5261af24051a8af902c67807a322f2c087ffcb939b297a5c3733ba9f298c43"/>
+<include xmlns="http://www.w3.org/2001/XInclude" href="72f331af11242841c9995ea2472472ddf3e08c57577487a79778c85cf70bde1c"/>
+<include xmlns="http://www.w3.org/2001/XInclude" href="35fdd93b8a0667e53f4bd27f1a7d319b7a83c9fcef445f637f7b37b76cb1a8f7"/>
+<include xmlns="http://www.w3.org/2001/XInclude" href="d2751edce63984fe40d9d5aef053b9fa7272eb4cddff9b090ae295c2aadce144"/>
+<include xmlns="http://www.w3.org/2001/XInclude" href="9eb80fc3e6b66694601facf84cf115282571fcd1b702b6f09bb167300b4402d3"/>
+<include xmlns="http://www.w3.org/2001/XInclude" href="427a1373d3f7e171c599f19a55b279b323d436a73e36b57683d6d8685ffca915"/>
+</article>
diff --git a/9afeb4befad7ff0f4655c9045c004d8a85f85ccc7fe9b595f6460a71d4fc4cbd b/9afeb4befad7ff0f4655c9045c004d8a85f85ccc7fe9b595f6460a71d4fc4cbd
new file mode 100644
index 0000000..c9fe3fc
--- /dev/null
+++ b/9afeb4befad7ff0f4655c9045c004d8a85f85ccc7fe9b595f6460a71d4fc4cbd
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="9afeb4befad7ff0f4655c9045c004d8a85f85ccc7fe9b595f6460a71d4fc4cbd">
+<title>Both</title>
+<itemizedlist>
+<listitem>
+<para>can be referred to, resulting in coreferences, for each version of the complete site</para>
+</listitem>
+</itemizedlist>
+</section>
diff --git a/9eb80fc3e6b66694601facf84cf115282571fcd1b702b6f09bb167300b4402d3 b/9eb80fc3e6b66694601facf84cf115282571fcd1b702b6f09bb167300b4402d3
new file mode 100644
index 0000000..c68806c
--- /dev/null
+++ b/9eb80fc3e6b66694601facf84cf115282571fcd1b702b6f09bb167300b4402d3
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="9eb80fc3e6b66694601facf84cf115282571fcd1b702b6f09bb167300b4402d3">
+<title>Features</title>
+<itemizedlist>
+<listitem>
+<para>Server-side transclusion with XInclude (FYI, transclusion ~= include + hyperlink)</para>
+<itemizedlist>
+<listitem>
+<para>listing references</para>
+</listitem>
+<listitem>
+<para>listing coreferences (backlinks)</para>
+</listitem>
+<listitem>
+<para>jumping to a coreference right at the transclusion site</para>
+</listitem>
+</itemizedlist>
+</listitem>
+<listitem>
+<para>Collaborative, versioned editing à la Git</para>
+<itemizedlist>
+<listitem>
+<para>Git versioning semantics</para>
+</listitem>
+<listitem>
+<para>commit log of each object</para>
+</listitem>
+<listitem>
+<para>commit log of each user</para>
+</listitem>
+<listitem>
+<para>blaming each object</para>
+</listitem>
+<listitem>
+<para>viewing commit diff</para>
+</listitem>
+</itemizedlist>
+</listitem>
+<listitem>
+<para>Orthogonal integration</para>
+<itemizedlist>
+<listitem>
+<para>All features above are supported, even if they are combined.</para>
+</listitem>
+</itemizedlist>
+</listitem>
+</itemizedlist>
+</section>
diff --git a/aed5891d7d7783ef09cf3878e10c5c3f3a5cd63e27c2bfc03a312e3c765e3713 b/aed5891d7d7783ef09cf3878e10c5c3f3a5cd63e27c2bfc03a312e3c765e3713
new file mode 100644
index 0000000..29789f5
--- /dev/null
+++ b/aed5891d7d7783ef09cf3878e10c5c3f3a5cd63e27c2bfc03a312e3c765e3713
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="aed5891d7d7783ef09cf3878e10c5c3f3a5cd63e27c2bfc03a312e3c765e3713">
+<title>Requirements for Transclusion</title>
+<para>I would like to support transclusion.
+For example, I would like to include a previous article as a section in a new article.
+Transclusion cannot be done satisfactorily in HTML or Markdown, because the document is syntactically a list of block-level elements.
+An include in this situation would introduce an unknown number of elements that are not separated from the surrounding content.
+I need a markup standard where the syntax tree is isomorphic to the outline tree, so when I include things they are nested in a smaller hierarchy level.
+DocBook satisfies this requirement, and I can use <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.w3.org/TR/xinclude/">XInclude</link> for inclusion.
+Then everything else is left for the page compiler.</para>
+</section>
diff --git a/d2751edce63984fe40d9d5aef053b9fa7272eb4cddff9b090ae295c2aadce144 b/d2751edce63984fe40d9d5aef053b9fa7272eb4cddff9b090ae295c2aadce144
new file mode 100644
index 0000000..847b8aa
--- /dev/null
+++ b/d2751edce63984fe40d9d5aef053b9fa7272eb4cddff9b090ae295c2aadce144
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="d2751edce63984fe40d9d5aef053b9fa7272eb4cddff9b090ae295c2aadce144">
+<title>Using the Site</title>
+<para>A user can choose to write articles in another markup language, then use Pandoc or a comparable tool to convert it to DocBook XML.
+The user needs to configure a git client to use a good username.
+The user can create, modify, and delete named objects.
+However, a set of changes should only be committed to git if they are consistent.
+For example, if an object is deleted, then all references to it must be deleted.</para>
+</section>
diff --git a/eada661c8a090982b0fbc89c0b5c397111f608ee2a4faf5bda9ea17d0d604485 b/eada661c8a090982b0fbc89c0b5c397111f608ee2a4faf5bda9ea17d0d604485
new file mode 100644
index 0000000..19ca6e8
--- /dev/null
+++ b/eada661c8a090982b0fbc89c0b5c397111f608ee2a4faf5bda9ea17d0d604485
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="eada661c8a090982b0fbc89c0b5c397111f608ee2a4faf5bda9ea17d0d604485">
+<title>Immutable</title>
+<itemizedlist>
+<listitem>
+<para>content-addressed (hash-addressed)</para>
+</listitem>
+<listitem>
+<para>name makes no sense</para>
+</listitem>
+<listitem>
+<para>no central authority</para>
+</listitem>
+<listitem>
+<para>versioning makes no sense</para>
+</listitem>
+<listitem>
+<para>no lifecycle</para>
+</listitem>
+</itemizedlist>
+</section>