Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Supports content-md format for AI Agents](https://contentmd.org/badge.svg)](https://contentmd.org)

# Content-md

[content-md](https://contentmd.org) is an open specification for structuring content to be consumed by AI agents.
Expand All @@ -8,8 +10,9 @@ Content-md synthesizes the current practices of structuring the markdown represe

- **[Documentation](https://contentmd.org)** — Motivation, guides and tutorials
- **[Specification](https://contentmd.org/specification)** — Format details
- **[`contentmd` Command Line](https://contentmd.org/cli)** — Fetch and validate markdown

This repo contains the specification, documentation, and reference guides.
This repo contains the specification, documentation, reference guides, and the Rust command line.

## About

Expand Down
11 changes: 11 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,15 @@
return '/' . trimPath($path);

},

'isActive' => function ($page, $path) {
$pagePath = str_replace('\\', '/', trimPath($page->getPath()));
$path = trimPath($path);

if(Str::endsWith($path, '*')){
$path = rtrim($path, '*');
return Str::startsWith($pagePath, $path) || $pagePath === $path;
}
return Str::endsWith($pagePath, $path) || $pagePath === $path;
},
];
7 changes: 7 additions & 0 deletions source/_components/code-snippet.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="relative rounded bg-zinc-200 dark:bg-zinc-800 p-3 pr-8 font-mono text-xs text-zinc-900 dark:text-zinc-100 overflow-x-auto agent:hidden" x-data="{ copied: false }" x-bind:data-copied="copied">
<span x-ref="code">{{ $slot }}</span>
<button type="button" @click="navigator.clipboard.writeText($refs.code.innerText.trim()).then(() => { copied = true; setTimeout(() => copied = false, 2000) })" class="absolute hit-area-2 size-6 shrink-0 top-2 right-2 text-zinc-900 dark:text-zinc-100 hover:text-zinc-950 dark:hover:text-white transition-colors" aria-label="Copy to clipboard">
<svg x-show="!copied" class="size-4" aria-hidden="true" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path></svg>
<svg x-show="copied" class="size-4 text-emerald-700 dark:text-emerald-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z" clip-rule="evenodd"></path></svg>
</button>
</div>
1 change: 1 addition & 0 deletions source/_components/nav-link.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a href="{{ $href }}" @class(['text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button', 'font-bold underline' => $active ?? false]) class="">{{ $slot }}</a>
17 changes: 9 additions & 8 deletions source/_layouts/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<meta property="og:title" content="{{ $page->title ?? $page->siteTitle }}">

<meta property="og:locale" content="en_US">
<meta name="description" content="{{ $page->description ?? $page->siteDescription }}">
<meta property="og:description" content="{{ $page->description ?? $page->siteDescription }}">
<meta property="og:url" content="{{ $page->url($page->getUrl()) }}">
<meta property="og:site_name" content="OneOffTech">
Expand Down Expand Up @@ -105,20 +104,22 @@ class="ignore-agent shadow-xl z-50 fixed bottom-3.5 right-3.5 border border-zinc
</a>
<nav class="relative flex items-center gap-6 text-sm agent:flex-col agent:items-start">
<div class="hidden sm:flex items-center gap-6 agent:flex-col agent:flex agent:items-start agent:gap-3">
<a href="/writers" class="text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Write content-md</a>
<a href="/consumers" class="text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Read content-md</a>
<a href="/specification" class="text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Specification</a>
<a href="{{ $page->github }}" target="_blank" rel="noopener noreferrer" class="text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">
<x-nav-link href="/cli" :active="$page->isActive('cli')" >CLI</x-nav-link>
<x-nav-link href="/writers" :active="$page->isActive('writers')">Write</x-nav-link>
<x-nav-link href="/consumers" :active="$page->isActive('consumers')">Read</x-nav-link>
<x-nav-link href="/specification" :active="$page->isActive('specification')">Specification</x-nav-link>
<a href="{{ $page->github }}" target="_blank" rel="noopener" class="text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">
GitHub ↗
</a>
</div>
<details class="sm:hidden agent:hidden">
<summary class="transition-button cursor-pointer">Menu</summary>

<div class="absolute w-60 bg-white dark:bg-zinc-950 shadow z-10 right-0 flex flex-col items-end gap-2 p-4">
<a href="/writers" class="p-4 text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Write content-md</a>
<a href="/consumers" class="p-4 text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Read content-md</a>
<a href="/specification" class="p-4 text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Specification</a>
<x-nav-link href="/cli" :active="$page->isActive('cli')" >CLI</x-nav-link>
<x-nav-link href="/writers" :active="$page->isActive('writers')">Write</x-nav-link>
<x-nav-link href="/consumers" :active="$page->isActive('consumers')">Read</x-nav-link>
<x-nav-link href="/specification" :active="$page->isActive('specification')">Specification</x-nav-link>
<a href="{{ $page->github }}" target="_blank" rel="noopener noreferrer" class="p-4 text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">
GitHub ↗
</a>
Expand Down
14 changes: 14 additions & 0 deletions source/badge-flat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions source/badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading