Skip to content

Commit 694fca1

Browse files
committed
feat: Add rehype.codeBlocks option
1 parent 3366a19 commit 694fca1

File tree

11 files changed

+387
-183
lines changed

11 files changed

+387
-183
lines changed

.github/workflows/test-e2e.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches:
99
- main
10+
- feat/code-blocks
1011

1112
permissions:
1213
contents: read
@@ -51,6 +52,10 @@ jobs:
5152
"accessToken": "${{ secrets.CONFLUENCE_PAT }}"
5253
}
5354
}
55+
rehype: |
56+
{
57+
"codeBlocks": true
58+
}
5459
log-level: debug
5560

5661
test-e2e:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
#### Deprecated
1212
#### Removed
1313

14+
## [2.4.0] - 2025-11-25
15+
16+
### Added
17+
18+
* feat: Add support for code blocks rendering in Confluence pages. Add `rehype.codeBlocks` option to enable this feature (bumps @telefonica/markdown-confluence-sync to 2.3.0)
19+
1420
## [2.3.0] - 2025-10-20
1521

1622
### Added

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ docs/
7878
"accessToken": "${{ secrets.CONFLUENCE_PAT }}"
7979
}
8080
}
81+
rehype: |
82+
{
83+
"codeBlocks": true
84+
}
8185
```
8286
8387
> [!TIP]
@@ -125,6 +129,10 @@ For example:
125129
"accessToken": "${{ secrets.CONFLUENCE_PAT }}"
126130
}
127131
}
132+
rehype: |
133+
{
134+
"codeBlocks": true
135+
}
128136
```
129137

130138
### Flat operation mode
@@ -206,6 +214,7 @@ The action accepts a configuration file in the root of the repository, and it ca
206214
| `confluence-notice-message` | Notice message to add at the beginning of the Confluence pages | No | `<p><strong>AUTOMATION NOTICE: This page is synced automatically, changes made manually will be lost</strong></p>` |
207215
| `confluence-notice-template` | Template string to use for the notice message | No | |
208216
| `confluence-dry-run` | Dry run mode: Do not update Confluence pages. Only log pages to sync | No | `false `|
217+
| `rehype` | Rehype configuration as a stringified JSON (supports multiline). Refer to the [Markdown Confluence Sync docs](https://github.com/Telefonica/confluence-tools/tree/main/components/markdown-confluence-sync#configuration) | No | |
209218
| `dry-run` | Process markdown files without sending them to the `confluence-sync` library. Useful to early detection of possible errors in configuration, markdown files, etc. Note that, requests that would be made to Confluence won't be logged, use `confluence-dry-run` for that, which also connects to Confluence to calculate the requests to do | No | |
210219
| `log-level` | Log level: `silent`, `silly`, `debug`, `verbose`, `info`, `warn`, `error` | No | `info` |
211220
| `cwd` | Current working directory. Path from where resolve `docs-dir`, `files-pattern`, `ignore`, and search for the configuration file. It must be relative to the repository folder | No | Repository root (`.`) |
@@ -235,7 +244,10 @@ module.exports = {
235244
},
236245
spaceKey: "MY-SPACE",
237246
rootPageId: "my-root-page-id"
238-
}
247+
},
248+
rehype: {
249+
codeBlocks: true,
250+
},
239251
}
240252
```
241253

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ inputs:
6868
'Log create, update or delete requests to Confluence instead of really
6969
making them'
7070
type: boolean
71+
rehype:
72+
description: 'Rehype configuration as a stringified JSON'
73+
multiline: true
74+
type: string
7175
dry-run:
7276
description: 'Process the markdown files and configuration without connecting to Confluence'
7377
type: boolean

cspell/missing.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
commonmark
22
frontmatter
33
opensource
4+
rehype
45
syncrc

0 commit comments

Comments
 (0)