Wiki source code of SCM Macro

Last modified by Vincent Massol on 2024/04/09

Hide last authors
Vincent Massol 24.2 1 Macro to use when referencing code in a scm.
2
3 Examples:
4
5 {{code}}
Thomas Mortagne 14.6 6 {{scm/}}
Thomas Mortagne 5.1 7
Thomas Mortagne 8.1 8 {{scm project="xwiki-rendering"/}}
Thomas Mortagne 5.1 9
Thomas Mortagne 6.1 10 {{scm project="xwiki-commons" path="xwiki-commons-core/pom.xml"/}}
Thomas Mortagne 8.1 11
12 {{scm branch="stable-3.1.x" path="xwiki-platform-core/pom.xml"/}}
Thomas Mortagne 10.1 13
Thomas Mortagne 21.1 14 {{scm path="xwiki-platform-core/pom.xml"/}}
15
Thomas Mortagne 14.6 16 {{scm branch="stable-3.1.x" path="xwiki-platform-core/pom.xml"}}With **label**{{/scm}}
Thomas Mortagne 17.1 17
18 {{scm branch="stable-3.1.x" path="xwiki-platform-core/pom.xml" raw="true"/}}
Vincent Massol 24.2 19 {{/code}}
Thomas Mortagne 18.1 20
Vincent Massol 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
Thomas Mortagne 18.1 37 = Parameters
38
Thomas Mortagne 20.1 39 |= Parameter name |= Default value |= Description
Thomas Mortagne 18.1 40 | user | xwiki | the github user
Thomas Mortagne 20.1 41 | project | xwiki-platform | the repository name in the provided user
Thomas Mortagne 18.1 42 | branch | master | the branch or tag
Thomas Mortagne 23.1 43 | raw | false | UI or raw content
Thomas Mortagne 18.1 44 | path | empty string | the resource in the repository

Get Connected