- go to Confluence
Administration
- go to
User Macros
page underConfiguration
part - click on
Create a User Macro
to add a new macro - create
RTL Section
macro- use
rtl-section
asMacro Name
- use
RTL Section
asMacro Title
- you can use this picture as icon
- reference: https://jira.atlassian.com/browse/CONFSERVER-1373
- use
Rendered
Macro Body Processing type - use the following template:
- use
## @noparamsa workaround for writing Right to Left texts
<div style="direction: rtl; unicode-bidi: inherit;">${body}</div>
- while editing the text, from
Insert more content
selectOther macros
- search for
RTL Section
and select it - click
Insert
- Add RTL Persian or Arabic texts
- create
LTR Section
macro same asRTL Section
- use
ltr-section
asMacro Name
- use
LTR Section
asMacro Title
- use
Rendered
Macro Body Processing type - you can use this picture as icon
- use the following template:
- use
## @noparamsa workaround for writing Right to Left texts
<div style="direction: ltr; unicode-bidi: inherit;">${body}</div>
Now insert a LTR Section
macro inside your RTL Section
macros whenever needed.
RTL will not work in editing environment. To fix this:
- go to Confluence
Administration
- go to
Stylesheet
page underLook and Feel
part - click on
Edit
to add new CSS rules - Add the following lines and click on
Save
table.wysiwyg-macro[data-macro-name="rtl-section"] {
direction: rtl;
text-align: justify;
}
table.wysiwyg-macro[data-macro-name="ltr-section"] {
direction: ltr;
text-align: initial;
}
Default fonts may not looks good in Persian or Arabic. You can use any font you want, e.g. Vazir font.
- go to Confluence
Administration
- go to
Stylesheet
page underLook and Feel
part - click on
Edit
to add new CSS rules - Add the following lines and click on
Save
@font-face {
font-family: Vazir;
src: url('https://cdn.jsdelivr.net/gh/rastikerdar/[email protected]/dist/Vazir.ttf') format('truetype');
}
@font-face {
font-family: "Vazir Code";
src: url('https://cdn.rawgit.com/rastikerdar/vazir-code-font/v1.1.2/dist/Vazir-Code.ttf') format('truetype');
}
#title-text, .wiki-content {
font-family: Vazir;
}
.wiki-content {
text-align: justify;
text-indent: 1em;
}
code {
font-family: "Vazir Code";
background: rgba(0,0,0,0.03);
border: 1px solid #dfe1e5;
border-radius: 3px;
padding: 1px 6px;
}