From 7644ab838d109320e8206179ab38bbe16e31fc72 Mon Sep 17 00:00:00 2001 From: lohhiiccc <96543753+lohhiiccc@users.noreply.github.com> Date: Mon, 12 Jan 2026 10:55:28 +0100 Subject: [PATCH] chore: release v1.0.0 Initial stable release of c-md transpiler. --- Makefile | 1 + README.md | 73 +++++++++++++++---------------------------------------- 2 files changed, 21 insertions(+), 53 deletions(-) diff --git a/Makefile b/Makefile index 8508b2a..e83136d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ NAME = c-md +VERSION = 1.0.0 TEST_BIN= c-md.test .DEFAULT_GOAL := all diff --git a/README.md b/README.md index c5da68b..9b83f58 100644 --- a/README.md +++ b/README.md @@ -48,44 +48,18 @@ int main(void) ''' ``` -(Note: Use standard triple backticks in actual files) - -## Project Structure - -c-md supports mixed projects with both documented (`.c.md`) and regular (`.c`) files: - -``` -project/ - srcs/ - main.c.md <- documented source - legacy.c <- regular source - includes/ - api.h.md <- documented header - types.h <- regular header - build/ - srcs/ - main.c <- transpiled - legacy.c <- symlinked - includes/ - api.h <- transpiled - types.h <- symlinked - objs/ - *.o - maps/ - main.map <- line mapping (for tooling) - api.map -``` +(Note: Use standard triple backticks ` ``` ` in actual files) ## Usage ### Options ``` --h, --help Show help message --e, --ext Extension to filter --t, --transpile File mode: transpile --o Output file --m, --map Generate line mapping file +-h, --help Show help message +-e, --ext Extension to extract (c, h, py, etc.) +-i, --input Input file (default: stdin) +-o, --output Output file (default: stdout) +-m, --map Generate line mapping file ``` ### Pipe Mode (stdin/stdout) @@ -102,10 +76,13 @@ cat main.c.md | c-md -e c -m build/maps/main.map > main.c ```bash # Basic transpilation -c-md -e c -t main.c.md -o build/main.c +c-md -i main.c.md -o build/main.c # With line mapping -c-md -e c -t main.c.md -o build/main.c -m build/maps/main.map +c-md -i main.c.md -o build/main.c -m build/maps/main.map + +# Extension auto-inferred from filename +c-md -i main.c.md -o build/main.c ``` ### Makefile Integration @@ -115,30 +92,19 @@ BUILD_DIR = build SRC_DIR = src $(BUILD_DIR)/%.c: $(SRC_DIR)/%.c.md - c-md -e c -t $< -o $@ -m $(BUILD_DIR)/maps/$*.map + c-md -i $< -o $@ -m $(BUILD_DIR)/maps/$*.map ``` -## Code Block Rules +## Code Block Filtering -Only code blocks with a matching extension are extracted: +The transpiler extracts only code blocks matching the specified extension. -``` -File: main.c.md (extension = c) +For file `main.c.md` with `-e c`: +- ` ```c ` blocks are extracted +- ` ```python ` blocks are ignored +- ` ``` ` blocks (no language) are ignored -'''c <- extracted (c == c) -int foo(void); -''' - -'''bash <- ignored (bash != c) -echo "hello" -''' - -''' <- ignored (no extension) -some text -''' -``` - -Multiple code blocks are concatenated with a blank line separator. +Multiple matching code blocks are concatenated with a blank line separator. ## Line Mapping @@ -151,6 +117,7 @@ source lines (`.c.md`) and output lines (`.c`). This enables: ## Status +**v1.0.0** - Initial stable release ## License