chore: release v1.0.0

Initial stable release of c-md transpiler.
This commit is contained in:
lohhiiccc 2026-01-12 10:55:28 +01:00
parent 3d9a0f4e87
commit 9a0a69ada1
2 changed files with 21 additions and 53 deletions

View file

@ -1,4 +1,5 @@
NAME = c-md
VERSION = 1.0.0
TEST_BIN= c-md.test
.DEFAULT_GOAL := all

View file

@ -48,33 +48,7 @@ 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
@ -82,9 +56,9 @@ project/
```
-h, --help Show help message
-e, --ext <ext> Extension to filter
-t, --transpile File mode: transpile <input>
-o <file> Output file
-e, --ext <ext> Extension to extract (c, h, py, etc.)
-i, --input <file> Input file (default: stdin)
-o, --output <file> Output file (default: stdout)
-m, --map <file> Generate line mapping file
```
@ -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