Wiki source code of SCM Macro
Last modified by Vincent Massol on 2026/01/13 14:06
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
![]() |
24.2 | 1 | Macro to use when referencing code in a scm. |
| 2 | |||
| 3 | Examples: | ||
| 4 | |||
| 5 | {{code}} | ||
![]() |
14.6 | 6 | {{scm/}} |
![]() |
5.1 | 7 | |
![]() |
8.1 | 8 | {{scm project="xwiki-rendering"/}} |
![]() |
5.1 | 9 | |
![]() |
6.1 | 10 | {{scm project="xwiki-commons" path="xwiki-commons-core/pom.xml"/}} |
![]() |
8.1 | 11 | |
| 12 | {{scm branch="stable-3.1.x" path="xwiki-platform-core/pom.xml"/}} | ||
![]() |
10.1 | 13 | |
![]() |
21.1 | 14 | {{scm path="xwiki-platform-core/pom.xml"/}} |
| 15 | |||
![]() |
14.6 | 16 | {{scm branch="stable-3.1.x" path="xwiki-platform-core/pom.xml"}}With **label**{{/scm}} |
![]() |
17.1 | 17 | |
| 18 | {{scm branch="stable-3.1.x" path="xwiki-platform-core/pom.xml" raw="true"/}} | ||
![]() |
24.2 | 19 | {{/code}} |
![]() |
18.1 | 20 | |
![]() |
24.2 | 21 | Results: |
| 22 | |||
| 23 | {{scm/}} | ||
| 24 | |||
| 25 | {{scm project="xwiki-rendering"/}} | ||
| 26 | |||
| 27 | {{scm project="xwiki-commons" path="xwiki-commons-core/pom.xml"/}} | ||
| 28 | |||
| 29 | {{scm branch="stable-3.1.x" path="xwiki-platform-core/pom.xml"/}} | ||
| 30 | |||
| 31 | {{scm path="xwiki-platform-core/pom.xml"/}} | ||
| 32 | |||
| 33 | {{scm branch="stable-3.1.x" path="xwiki-platform-core/pom.xml"}}With **label**{{/scm}} | ||
| 34 | |||
| 35 | {{scm branch="stable-3.1.x" path="xwiki-platform-core/pom.xml" raw="true"/}} | ||
| 36 | |||
![]() |
18.1 | 37 | = Parameters |
| 38 | |||
![]() |
20.1 | 39 | |= Parameter name |= Default value |= Description |
![]() |
18.1 | 40 | | user | xwiki | the github user |
![]() |
20.1 | 41 | | project | xwiki-platform | the repository name in the provided user |
![]() |
18.1 | 42 | | branch | master | the branch or tag |
![]() |
23.1 | 43 | | raw | false | UI or raw content |
![]() |
18.1 | 44 | | path | empty string | the resource in the repository |

