Skip to content

Latest commit

 

History

History
181 lines (136 loc) · 6.06 KB

post.adoc

File metadata and controls

181 lines (136 loc) · 6.06 KB
title Your Article Title Here
date 2026-01-01
description A short, one- or two-sentence summary of the article.
authors
your-author-slug
categories
Java
related_posts

Open with a paragraph that says what the reader will get. No "= Title" heading here — the title above is already the page’s H1.

A section heading

Sections start at ==. Sub-sections use ===. They become the "On this page" navigation automatically.

Inline markup: bold, italic, monospace, and a link with its text in brackets. Links to other sites automatically open in a new tab; links to other foojay pages stay in the same tab. (Adding AsciiDoc’s own ^ suffix — text — still works and is left as you wrote it, but you no longer need it.)

  • A bullet

  • Another one

    • Nested, with two stars

      1. A numbered item

      2. The next one

Code

A source block is a [source,<language>] line followed by a ---- fence. It is syntax-highlighted by the same highlighter Markdown articles use, so the language names are the same ones — java, bash, yaml, xml, kotlin, json, python, sql and so on. An unknown one renders unhighlighted rather than broken.

public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello, foojay!");
    }
}

A ---- fence with no [source] line gives plain, unhighlighted output.

Block titles

Any block takes a caption: a line starting with a dot, directly above it.

What the build does
./gradlew build

Callouts

Numbered markers in the code, explained underneath. Markdown has no equivalent.

Write the marker inside a comment for the language of the snippet — // for Java, # for a shell or Python, -- for SQL — and the comment goes away in the rendered article, leaving a circled number in its place. Line the markers up in a column if you like; the padding in front of the comment is kept.

var list = new ArrayList<String>();   // (1)
list.add("foojay");                   // (2)
  1. Create the list.

  2. Add to it.

Admonitions

The labelled boxes that set a remark apart from the text around it. One word, then a colon:

Note
Something worth knowing.
Tip
A shortcut the reader may not know.
Important
Something they should not skip.
Warning
Something that will bite them.
Caution
Something that could lose data.

Tables

cols sets the relative column widths; options="header" makes the first row a header. A 2+| prefix spans two columns and .2+| spans two rows.

Table 1. An optional caption
Column What goes in it

First

Something short

Second

Something longer, which is why this column is twice as wide

Images

Put the file in THIS folder and reference it by name. The text in the brackets is the DESCRIPTION, and it is the only part of an image a reader using a screen reader gets — write what it shows, the way you would say it out loud. Leave it empty only when the image is decoration; the PR check reports empty ones so you can confirm that was deliberate, and never fails your pull request over it.

The Ports view in IntelliJ

Every image in an article is click-to-enlarge automatically.

Foojay’s own shortcodes work here too, for a floated or captioned image and for a gallery — see template/post.md for what each one takes:

{{< img src="my-image.png" alt="The Ports view in IntelliJ" class="alignright" width="320" caption="An optional caption" >}}

One thing that is Markdown-only

Nothing else differs, but this does: Mermaid diagrams work in AsciiDoc as well, written as a mermaid source block.

graph LR
    A[Source] --> B[javac]
    B --> C[Bytecode]
Loading