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 7644ab838d
2 changed files with 21 additions and 53 deletions

View file

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

View file

@ -48,33 +48,7 @@ int main(void)
''' '''
``` ```
(Note: Use standard triple backticks in actual files) (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
```
## Usage ## Usage
@ -82,9 +56,9 @@ project/
``` ```
-h, --help Show help message -h, --help Show help message
-e, --ext <ext> Extension to filter -e, --ext <ext> Extension to extract (c, h, py, etc.)
-t, --transpile File mode: transpile <input> -i, --input <file> Input file (default: stdin)
-o <file> Output file -o, --output <file> Output file (default: stdout)
-m, --map <file> Generate line mapping file -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 ```bash
# Basic transpilation # 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 # 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 ### Makefile Integration
@ -115,30 +92,19 @@ BUILD_DIR = build
SRC_DIR = src SRC_DIR = src
$(BUILD_DIR)/%.c: $(SRC_DIR)/%.c.md $(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.
``` For file `main.c.md` with `-e c`:
File: main.c.md (extension = c) - ` ```c ` blocks are extracted
- ` ```python ` blocks are ignored
- ` ``` ` blocks (no language) are ignored
'''c <- extracted (c == c) Multiple matching code blocks are concatenated with a blank line separator.
int foo(void);
'''
'''bash <- ignored (bash != c)
echo "hello"
'''
''' <- ignored (no extension)
some text
'''
```
Multiple code blocks are concatenated with a blank line separator.
## Line Mapping ## Line Mapping
@ -151,6 +117,7 @@ source lines (`.c.md`) and output lines (`.c`). This enables:
## Status ## Status
**v1.0.0** - Initial stable release
## License ## License