Skip to content

Commit 7e5d3a6

Browse files
committed
feat(with-automd): separator option
1 parent f627d63 commit 7e5d3a6

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/a
4848

4949
<!-- /automd -->
5050

51-
---
52-
53-
<!-- automd:with-automd -->
51+
<!-- automd:with-automd separator -->
5452

53+
---
5554
_🤖 docs are auto updated with [automd](https:/automd.unjs.io) (last updated: Tue Feb 20 2024)_
5655

5756
<!-- /automd -->

docs/2.generators/with-automd.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The `with-automd` generator generates a benner that notifies docs are updated wi
1515

1616
<!-- automd:with-automd lastUpdate=now -->
1717

18+
---
1819
_🤖 docs are auto updated with [automd](https:/automd.unjs.io) (last updated: now)_
1920

2021
<!-- /automd -->
@@ -24,3 +25,4 @@ The `with-automd` generator generates a benner that notifies docs are updated wi
2425
## Arguments
2526

2627
- `lastUpdate`: Can override last updated time. Use `no-lastUpdate` to disable.
28+
- `no-separator`: Disable addition of separator `---`

src/generators/with-automd.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ export const withAutomd = defineGenerator({
1010

1111
const emoji = args.emoji === false ? "" : "🤖 ";
1212

13+
const lines: string[] = [];
14+
15+
if (args.separator !== false) {
16+
lines.push("---");
17+
}
18+
19+
lines.push(
20+
`_${emoji}docs are auto updated with [automd](https:/automd.unjs.io)${lastUpdate}_`,
21+
);
22+
1323
return {
14-
contents: `_${emoji}docs are auto updated with [automd](https:/automd.unjs.io)${lastUpdate}_`,
24+
contents: lines.join("\n"),
1525
};
1626
},
1727
});

test/fixture/OUTPUT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ import { foo, bar } from "https://esm.sh/pkg";
103103

104104
<!-- automd:with-automd -->
105105

106+
---
106107
_🤖 docs are auto updated with [automd](https:/automd.unjs.io) (last updated: Tue Feb 20 2024)_
107108

108109
<!-- /automd -->

test/transform.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ describe("transform", () => {
9090
b
9191
<!-- automd:with-automd lastUpdate=now -->
9292
93+
---
9394
_🤖 docs are auto updated with [automd](https:/automd.unjs.io) (last updated: now)_
9495
9596
<!-- /automd -->

0 commit comments

Comments
 (0)