Commit 8ef9a10c by PLN (Algolia)

markdown: unknown directives render as literal text; code breakout no longer slides off-screen

A bare ':word' in prose (127.0.0.1:1234) parses as a remark-directive
and the default renderer emitted an empty <div> mid-paragraph — the
browser closed the <p> and tore the text apart at the colons, eating
the ports. Unknown directives now go back to literal text; the mapped
island vocabulary (::note, ::audio, embeds) is untouched.

The wide-screen code breakout set margin-left: 50% on the figure, then
the later 'margin: 1.5rem 0' shorthand reset it to 0 while the
translateX(-50%) survived: every code block sat half its width off the
left edge. margin-block now, and the breakout centers on the core
column (verified: figure center == viewport center at 1440).

The post's image alt restored to what the placeholder asked for —
synthetic-data index shot, 5 projects, 3 up 2 down.
parent 2352d4e1
...@@ -869,7 +869,10 @@ ...@@ -869,7 +869,10 @@
} }
.article .prose :global([data-rehype-pretty-code-figure]) { .article .prose :global([data-rehype-pretty-code-figure]) {
margin: 1.5rem 0; /* margin-block only: margin-inline belongs to the wide-screen breakout
rule above — the shorthand here used to reset its margin-left to 0 and
shove every code block half its width off the left edge. */
margin-block: 1.5rem;
} }
.article :global(.prose-codebar) { .article :global(.prose-codebar) {
......
---
title: Devname
---
I'm tired boss of localhost:1234.
Of memorizing, for each local runnign project, yet another sequence of digits like a 2fa code.
And damn I've been running a lot of local webservers these days : the fun art project at 127.0.0.1:1234 and my blog rebuild draft at localhost:8888 and random test servers and hot-reloading game-of-life and databases and... a beautiful mess :')
So i made _devname_ : a little daemon, and a CLI, that allow each project, each agent, to book a local domain.
![The devname.localhost index (synthetic data: 5 projects, 3 up, 2 down)](/images/blog/devname/devname-index.png)
The CLI is quite minimalist:
```bash
devname ensure myapp # books monapp.localhost
devname ls # current state
# ... ->
# bench.sre.localhost 8895 down bench dashboard
# decisions.localhost 8017 up decision gateway (d3-nano), key required
# lmstudio.localhost 1234 up LM Studio OpenAI-compatible server
# www.localhost 17005 up personal site static export preview
# ...
```
Let me know what you make of it :)
...@@ -7,14 +7,19 @@ C'est cool d'avoir plein de projets en local ! Des 127.0.0.1:1234 et des localho ...@@ -7,14 +7,19 @@ C'est cool d'avoir plein de projets en local ! Des 127.0.0.1:1234 et des localho
Alors j'ai fait devname : un petit daemon et un CLI qui permettent à chaque projet, ou agent, de réserver un domaine en local. Alors j'ai fait devname : un petit daemon et un CLI qui permettent à chaque projet, ou agent, de réserver un domaine en local.
![L'index devname.localhost — données synthétiques](/images/blog/devname/devname-index.png) ![L'index devname.localhost (données synthétiques : 5 projets, 3 up, 2 down)](/images/blog/devname/devname-index.png)
Le CLI est assez minimaliste : Le CLI est assez minimaliste :
```bash ```bash
devname ensure monapp # réserve monapp.localhost, imprime l'URL devname ensure monapp # réserve monapp.localhost, imprime l'URL
PORT=$(devname ensure monapp --format port) # le port, pour le serveur devname ls # l'état actuel
devname ls # l'état du monde, up/down en direct # ... ->
# bench.sre.localhost 8895 down bench dashboard
# decisions.localhost 8017 up decision gateway (d3-nano), key required
# lmstudio.localhost 1234 up LM Studio OpenAI-compatible server
# www.localhost 17005 up personal site static export preview
# ...
``` ```
Dites-m'en des nouvelles ;) Dites-m'en des nouvelles ;)
--- ---
title: Devname title: Devname
date: '2026-11-06' date: '2026-11-06'
draft: true description: 'Marre de retenir 127.0.0.1:1234? devname réserve un domaine.localhost à chaque projet local.'
description: 'Marre des 127.0.0.1:8888 ? devname réserve un domaine *.localhost à chaque projet local — un daemon, un CLI, zéro port à retenir.' tags: [cli, agent, dx, oss, web, meta, devname, localhost]
tags: [cli, devx, localhost]
--- ---
...@@ -48,7 +48,17 @@ export function remarkDirectiveTags() { ...@@ -48,7 +48,17 @@ export function remarkDirectiveTags() {
return; return;
} }
const mapping = directiveComponents[node.name]; const mapping = directiveComponents[node.name];
if (!mapping) return; if (!mapping) {
// Unknown directive: prose wins. A bare `:word` in running text (a
// port like 127.0.0.1:1234, a URL fragment, anything) parses as a
// directive, and the default renderer emits an empty <div> — which
// makes the browser close the <p> and tears the paragraph apart.
// Put the literal text back instead.
const label = nodeTextLike(node);
node.type = 'text';
node.value = ':' + node.name + (label ? `[${label}]` : '');
return;
}
node.data = node.data || {}; node.data = node.data || {};
node.data.hName = mapping.tag; node.data.hName = mapping.tag;
// Leaf directives carry their target in the label — micromark's // Leaf directives carry their target in the label — micromark's
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment