Sandbox:Temp: Difference between revisions
Created page with "This is a scratch page. You can do whatever to it below this line == Freedom begins under this line ==" |
Sandbox demo: semantic content model demonstration (entities, dynamic rendering, citations, embeds, sitelink) (via update-page on MediaWiki MCP Server) Tag: Reverted |
||
| Line 2: | Line 2: | ||
== Freedom begins under this line == | == Freedom begins under this line == | ||
This page is a demonstration of ronzz-wikibase's semantic content model: '''items''' (persons, sources, quotations, mathematical expressions, code), '''dynamic rendering''' of their statements, '''citations''', '''embeds''', and the '''page ↔ item sitelink'''. Everything shown below is live data: edit an item and this page updates by itself — no page editing required. | |||
The page is sitelinked to [[Item:Q1080|Charles Babbage]], so the short parser-function forms in the Dynamic rendering section resolve to that item automatically. | |||
=== 1. The items behind this page === | |||
{| class="wikitable" | |||
! Kind !! Item !! Live data rendered from statements | |||
|- | |||
| Person || [[Item:Q1080|Charles Babbage]] || instance of: {{#statements:P1|from=Q1080}} · born {{#statements:P50|from=Q1080}} · died {{#statements:P52|from=Q1080}} | |||
|- | |||
| Collective (publisher) || [[Item:Q1081|Longman]] || instance of: {{#statements:P1|from=Q1081}} | |||
|- | |||
| Book (citable source) || [[Item:Q1082|Passages from the Life of a Philosopher]] || instance of: {{#statements:P1|from=Q1082}} · author: {{#statements:P6|from=Q1082}} · publisher: {{#statements:P54|from=Q1082}} · year: {{#statements:P8|from=Q1082}} | |||
|- | |||
| Mathematical expression || [[Item:Q1083|Euler's identity]] || instance of: {{#statements:instance of|from=Q1083}} (property by label) · LaTeX: {{#statements:P4|from=Q1083}} | |||
|- | |||
| Code snippet || [[Item:Q1085|Finite differences in Python]] || instance of: {{#statements:P1|from=Q1085}} · language: {{#statements:P5|from=Q1085}} | |||
|- | |||
| Quotation || [[Item:Q1086|Pray, Mr. Babbage, …]] || instance of: {{#statements:P1|from=Q1086}} · attributed to: {{#statements:P6|from=Q1086}} · source: {{#statements:P28|from=Q1086}} | |||
|} | |||
=== 2. Embedded content === | |||
Item content renders standalone at its embed URL — the same fragment the '''Copy embed code''' button on each item page points to. On this wiki the Sanitizer keeps raw <code>iframe</code> tags out of pages (the iframe snippet is meant for third-party sites), so the reliable on-wiki surface is the bare embed URL — which also feeds the citation auto-collect: | |||
* '''Quotation''' — [https://wikibase.ronzz.org/wiki/Special:Embed/Q1086 rendered embed] | |||
* '''Mathematical expression''' — [https://wikibase.ronzz.org/wiki/Special:Embed/Q1083 rendered embed] | |||
* '''Code snippet''' — [https://wikibase.ronzz.org/wiki/Special:Embed/Q1085 rendered embed] | |||
The content itself is rendered inline below, straight from the items' statements: | |||
==== Quotation ==== | |||
<blockquote>{{#statements:P2|from=Q1086}}</blockquote> | |||
==== Mathematical expression ==== | |||
<code>{{#statements:P4|from=Q1083}}</code> — rendered with KaTeX at the embed URL above. | |||
==== Code snippet ==== | |||
{{#statements:P3|from=Q1085}} | |||
=== 3. Dynamic rendering === | |||
The values in the table above come from the <code>#statements</code> parser function. Because this page is sitelinked to [[Item:Q1080]], the short form — no <code>from=</code> — resolves to that item: | |||
* {{#statements:P1}} — instance of (short form, via the sitelink) | |||
* Born {{#statements:P50}} · died {{#statements:P52}} (short form, via the sitelink) | |||
* {{#statements:P6|from=Q1082}} wrote ''Passages from the Life of a Philosopher'' (explicit <code>from=</code> form) | |||
=== 4. Citations === | |||
The citable source [[Item:Q1082]] is cited inline with the custom citation mechanism and collected in the bibliography below:<ref>{{#cite:Q1082}}</ref> | |||
Babbage recounts the reactions his Difference Engine provoked in his autobiography, and the quotation embedded above comes from the same work.<ref>{{#cite:Q1082}}</ref> | |||
==== Bibliography ==== | |||
<references/> | |||
==== Sources collected automatically ==== | |||
The <nowiki>{{#citations:}}</nowiki> collector gathers the same book here automatically — deduplicated across the footnote citations above and the embed URLs in § 2: | |||
{{#citations:}} | |||
=== 5. Try it yourself === | |||
* Open [[Item:Q1080]] and use '''Update basic information''' to change a date — the Dynamic rendering section updates immediately. | |||
* Use the '''Sitelink''' tab on this page to link it to another item and see the short forms change. | |||
* See the help pages: [[Help:Contributing/semanticDynamicContent]], [[Help:Contributing/citations]], [[Help:Contributing/quotation]], [[Help:Contributing/math]], [[Help:Contributing/code]], [[Help:Contributing/entities]]. | |||
Revision as of 09:19, 30 August 2026
This is a scratch page. You can do whatever to it below this line
Freedom begins under this line
This page is a demonstration of ronzz-wikibase's semantic content model: items (persons, sources, quotations, mathematical expressions, code), dynamic rendering of their statements, citations, embeds, and the page ↔ item sitelink. Everything shown below is live data: edit an item and this page updates by itself — no page editing required.
The page is sitelinked to Charles Babbage, so the short parser-function forms in the Dynamic rendering section resolve to that item automatically.
1. The items behind this page
| Kind | Item | Live data rendered from statements |
|---|---|---|
| Person | Charles Babbage | instance of: person · born 26 December 1791 · died 18 October 1871 |
| Collective (publisher) | Longman | instance of: private company |
| Book (citable source) | Passages from the Life of a Philosopher | instance of: book · author: Charles Babbage · publisher: Longman · year: 1864 |
| Mathematical expression | Euler's identity | instance of: mathematical expression (property by label) · LaTeX: e^{i\pi}+1=0 |
| Code snippet | Finite differences in Python | instance of: code snippet · language: Python |
| Quotation | Pray, Mr. Babbage, … | instance of: quotation content · attributed to: Charles Babbage · source: Passages from the Life of a Philosopher |
2. Embedded content
Item content renders standalone at its embed URL — the same fragment the Copy embed code button on each item page points to. On this wiki the Sanitizer keeps raw iframe tags out of pages (the iframe snippet is meant for third-party sites), so the reliable on-wiki surface is the bare embed URL — which also feeds the citation auto-collect:
- Quotation — rendered embed
- Mathematical expression — rendered embed
- Code snippet — rendered embed
The content itself is rendered inline below, straight from the items' statements:
Quotation
On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Mathematical expression
e^{i\pi}+1=0 — rendered with KaTeX at the embed URL above.
Code snippet
def diff(xs): return [b - a for a, b in zip(xs, xs[1:])]; squares = [n**2 for n in range(1, 7)]; print(diff(diff(squares)))
3. Dynamic rendering
The values in the table above come from the #statements parser function. Because this page is sitelinked to Item:Q1080, the short form — no from= — resolves to that item:
- person — instance of (short form, via the sitelink)
- Born 26 December 1791 · died 18 October 1871 (short form, via the sitelink)
- Charles Babbage wrote Passages from the Life of a Philosopher (explicit
from=form)
4. Citations
The citable source Item:Q1082 is cited inline with the custom citation mechanism and collected in the bibliography below:[1]
Babbage recounts the reactions his Difference Engine provoked in his autobiography, and the quotation embedded above comes from the same work.[1]
Bibliography
Sources collected automatically
The {{#citations:}} collector gathers the same book here automatically — deduplicated across the footnote citations above and the embed URLs in § 2:
- Babbage, C. (1864). Passages from the Life of a Philosopher. In Passages from the Life of a Philosopher. Longman.
5. Try it yourself
- Open Item:Q1080 and use Update basic information to change a date — the Dynamic rendering section updates immediately.
- Use the Sitelink tab on this page to link it to another item and see the short forms change.
- See the help pages: Help:Contributing/semanticDynamicContent, Help:Contributing/citations, Help:Contributing/quotation, Help:Contributing/math, Help:Contributing/code, Help:Contributing/entities.