Skip to content

docs(fix): Preserve indented Elixir reference examples - #375

Merged
tony merged 3 commits into
mainfrom
fix/indented-elixir-examples
Dec 6, 2026
Merged

tony merged 3 commits into
mainfrom
fix/indented-elixir-examples

Conversation

@tony

@tony tony commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #371.

What changed, and why

The Elixir reference split an indented example at its blank line and rendered the callback as a paragraph. The adapter now reads top-level indented blocks from the Markdown syntax tree and passes each block to the existing code renderer. Readers can copy the alias, blank line and indented callback together from published docstrings.

IEx prompts and expected output stay in the same example. Paragraph and list continuations stay in the surrounding text. The companion PR adds an explicit Elixir fence to the source docstring. Source change

The branch builds on the released guide data in #368 and regenerates the shared site’s cached API model from the same Elixir 0.1.3 source. The rebuilt preview preserves the Server, Control, Pane, Session and Window examples as copyable code. Release source

Checks run

  • Rendered the original LibTmux.Server.with_owned/2 docstring through the Astro reference page. The baseline had no highlighted block. The fixed page has one Elixir block with each source line and its indentation intact.
  • Rendered the fenced source with both adapters. Both produced identical highlighted HTML.
  • Ran the Elixir and shared Markdown regression suites, package lint and type checks. The full API-model unit run took 23.62 s. It excluded outer suites and skipped the optional F# compiler case.
  • Built the shared preview from the released model and compared the complete owned-server callback with its pinned source. The export test detected both the stale model and a removed session-creation line. It also passed on the newer fenced source. The exact-head Linux run passed in 65.726 s, with Pagefind disabled. Source-bound regression

Public site

The Elixir port builds its production reference with the renderer pinned in its caller. The adapter reaches that reference after the port adopts a docs revision containing this change. The explicit source fence in the companion Elixir PR also works on the older renderer. Elixir publisher update · Current production provenance

Rebased checks

After rebasing, the released API model passed its freshness check and the shared-site build rendered the owned-server callback with its blank line, indentation and syntax colors. The Elixir and Markdown adapter suites and the reference export passed in the same 89.314 s run. Pagefind and the assembled multi-site checks were outside this run.

Merge stack

This PR targets main at the bottom of the stack. Stack #399 · Changes in this PR

All seven documentation jobs passed, including preview publication on 917418af1. GitHub records the stack merge at 5a6dc108d. CI run · Merged commit Local checks rebuilt the site on 22947ee66 after #398, #379 and #383 merged. They verified version selection, the Elixir documentation workflow, the showcase links and the rendered example.

Published preview check

The published Server.with_owned/2 example matched all six lines of the released Elixir source, including its blank line and callback indentation. It rendered with 6 syntax styles. The guide and recording checks also passed. The served-page checks took 2.94 s after publication for 917418af1. Rendered example · Publisher run On all 7 checked pages, the only difference from the CI artifact was the analytics script added by Cloudflare.

Tool use

Codex updated the adapter and its tests and compared the native example data. A separate Codex reviewer checked the rendered HTML against the original and fenced source.

tony added 3 commits December 5, 2026 18:19
why: The reference adapter loses code block boundaries in valid
indented ExDoc examples and renders the callback as prose.

what:
- Read top-level indented examples from the Markdown block tree.
- Preserve blank lines, relative indentation and IEx output.
- Keep list and paragraph continuations in the surrounding prose.
why: Shared previews render the committed API model. The 0.1.3 model
still put indented callbacks in prose after the adapter learned to
extract them. Its owned-server example had no language or highlighting.

what:
- Regenerate the Elixir model from the same 0.1.3 source and toolchain.
- Check the public reference export for the complete owned-server
  callback, its language, blank line and nested indentation.
why: Checking the language and the ends of the callback let a missing
session creation pass. Both released indented code and the newer
fenced form have a complete example in the pinned source.

what:
- Read the documented block from the source paired with the API model.
- Compare the exported language and every code line with that block.
@tony
tony force-pushed the fix/indented-elixir-examples branch from c911dee to 917418a Compare December 6, 2026 00:21
@tony
tony added this pull request to stack #399 December 6, 2026 01:07
@tony
tony merged commit 5a6dc10 into main Dec 6, 2026
7 checks passed

This branch was previously deployed

1 inactive deployment
docs-preview — 917418af Deployed Dec 6, 2026 by tony via publish-preview / publish #1613
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Elixir reference renders indented code examples as paragraphs

1 participant