Wikifreedia
All versions

= Nostr-flavored Markup

== Asciidoc and Markdown

The Alexandria and GitRepublic apps support multiple markup formats for different use cases. Below is a summary of the supported tags and features for each parser, as well as the formats used for publications and wikis.

== Basic Markup Parser

The basic markup parser follows the https://github.com/nostrability/nostrability/issues/146[Nostr best-practice guidelines] and supports:

  • Headers: ** ATX-style: # H1 ** Setext-style: H1\n=====
  • Bold: \*bold*
  • Italic: \_italic_
  • Strikethrough: \~strikethrough~
  • Blockquotes: > quoted text
  • Unordered lists: * item
  • Ordered lists: 1. item
  • Links: [text](url)
  • Images: ![alt](url)
  • Hashtags: #hashtag
  • Nostr identifiers: npub, nprofile, nevent, naddr, note, with or without nostr: prefix (note is deprecated)
  • Emoji shortcodes: :smile: will render as 😄

== Advanced Markup Parser

The advanced markup parser includes all features of the basic parser, plus:

  • Inline code: code
  • Syntax highlighting: for code blocks in many programming languages (from https://highlightjs.org/[highlight.js])

image::https://i.nostr.build/JNJIyAxmVO5WAxVb.png[Go, 400]

image::https://i.nostr.build/trYVSyNYtgQGgvDT.png[C++, 400]

  • Tables: Pipe-delimited tables with or without headers

image::https://i.nostr.build/svSqZn15gxqjACZJ.png[table, 400]

  • Footnotes: [^1] or [^Smith], which should appear where the footnote shall be placed, and will be displayed as unique, consecutive numbers
  • Footnote References: [^1]: footnote text or [^Smith]: Smith, Adam. 1984 "The Wiggle Mysteries, which will be listed in order, at the bottom of the event, with back-reference links to the footnote, and text footnote labels appended

image::https://i.nostr.build/tvFv7ciHcY5DMNh2.png[footnotes, 400]

  • Wikilinks: \[NIP-54][] will render as a hyperlink and goes to https://next-alexandria/publication?d=nip-54[NIP-54].

image::https://i.nostr.build/bSLegUBDKYdC15LZ.png[wikilink]

== Publications and Wikis

Publication sections/notes (kind 30041) and wikis (kind 30818) in Alexandria use AsciiDoc as their primary markup language, not Markdown.

AsciiDoc supports a much broader set of formatting, semantic, and structural features, including:

  • Section and document structure
  • Advanced tables, callouts, admonitions
  • Cross-references, footnotes, and bibliography
  • Custom attributes and macros
  • Asciimath and LaTeX
  • And much more

For more information on AsciiDoc, see the https://asciidoc.org/[AsciiDoc documentation].

  • The markdown parsers are primarily used for comments, issues, long-form articles and other user-generated content.
  • Publications and wikis are rendered using AsciiDoc for maximum expressiveness and compatibility.
  • All URLs are sanitized to remove tracking parameters, and YouTube links are presented in a clean, privacy-friendly format.
  • No external URLs are overwritten, but internal URLs are displayed as embedded links.
  • https://raw.githubusercontent.com/ShadowySupercode/gc-alexandria/refs/heads/master/tests/integration/markupTestfile.md[Here is a test markup file] that you can use to test out the parser and see how things should be formatted.

Other authors

No one else has published this topic yet.