You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce dynamic language inference for code blocks
The hook now automatically infers the markdown language identifier from the source file extension
instead of hardcoding `php`. This allows proper syntax highlighting for GraphQL, JavaScript,
TypeScript, and many other file types in the README.
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ The hook automatically stages the updated README.md if changes are detected, ens
38
38
39
39
### Syncing Source Code
40
40
41
-
To sync a code example with a source file, add a comment before your code block:
41
+
To sync a code example with a source file, add a comment before your code block. The language identifier (e.g., `php`, `graphql`, `javascript`) is automatically inferred from the file extension:
42
42
43
43
````markdown
44
44
<!-- source: examples/demo.php -->
@@ -47,6 +47,8 @@ To sync a code example with a source file, add a comment before your code block:
47
47
```
48
48
````
49
49
50
+
The hook supports a wide range of file extensions including `.php`, `.graphql`, `.gql`, `.js`, `.ts`, `.json`, `.yml`, `.yaml`, `.sql`, and many more.
0 commit comments