SimpleWiki

References

The ref and references components work together to add Wikipedia-style inline citations to your articles.

Place :ref{n="1"} anywhere in your text to insert a [1] marker. At the bottom of the page, a ::references block renders the numbered source list. Clicking a marker scrolls to the entry; the ↩ arrow links back to the citation.


Basic Usage

The World Wide Web was invented in 1989. :ref{n="1"}
It is built on the HTTP protocol. :ref{n="2"}

::references
---
items:
  - title: "CERN – Tim Berners-Lee and the WWW"
    url: "https://home.cern/science/computing/birth-web"
    note: "Original source."
  - title: "MDN – HTTP Overview"
    url: "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview"
---
::

Result:

The World Wide Web was invented in 1989. [1] It is built on the HTTP protocol. [2]


With Notes

Use the optional note field to add a short description, access date, or any other context to a reference entry.

Oxygen was discovered in the 18th century. :ref{n="1"}

::references
---
items:
  - title: "Wikipedia – Oxygen"
    url: "https://en.wikipedia.org/wiki/Oxygen"
    note: "Accessed July 2025."
---
::

Result:

Oxygen was discovered in the 18th century. [1]

References
  1. Wikipedia – Oxygen — Accessed July 2025.↩

Without a URL

A URL is optional. This is useful for books, printed papers, or internal documents that have no web address.

This approach was first described in the seminal paper. :ref{n="1"}

::references
---
items:
  - title: "Smith, J. (2019). Advanced Techniques. Journal of Examples, 4(2), 12–18."
    note: "Print only."
---
::

Result:

This approach was first described in the seminal paper. [1]

References
  1. Smith, J. (2019). Advanced Techniques. Journal of Examples, 4(2), 12–18. — Print only.↩

Citing the Same Source Multiple Times

You can use the same n value more than once to cite a single source at different points in the text. The ↩ back-link will navigate to the first occurrence.

The algorithm runs in linear time. :ref{n="1"}
As noted earlier, this makes it suitable for large datasets. :ref{n="1"}

::references
---
items:
  - title: "Knuth, D. E. (1997). The Art of Computer Programming."
---
::

Result:

The algorithm runs in linear time. [1] As noted earlier, this makes it suitable for large datasets. [1]

References
  1. Knuth, D. E. (1997). The Art of Computer Programming.↩

Props

:ref

PropTypeRequiredDescription
nnumber | stringYesThe citation number shown as [n] and used to link to the matching entry in ::references.

::references

PropTypeRequiredDescription
itemsarrayYesList of reference entries.
items[].titlestringYesDisplay text for the reference (author, title, or site name).
items[].urlstringNoURL the title links to. Omit for offline sources.
items[].notestringNoShort additional context shown after a dash.

Tips

  • Numbers in :ref{n="..."} are matched to items by position — item 1 corresponds to n="1", item 2 to n="2", and so on.
  • Put the ::references block at the very end of the page, after all other content.
  • Works well alongside the existing reference-list component — use ref/references for inline citations and reference-list for a plain "Further Reading" section.