Skip to content

Commit 2efa4f5

Browse files
committed
feat: installation
1 parent 188fde2 commit 2efa4f5

File tree

6 files changed

+342
-3
lines changed

6 files changed

+342
-3
lines changed

docs/en-US/handbook/action-template-print/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ The Template Printing plugin is a powerful tool that allows you to edit template
1515
- **Formatter Support**: Provides conditional output, date formatting, number formatting, and other functions to enhance the readability and professionalism of documents.
1616
- **Efficient Output Formats**: Supports direct generation of PDF files for easy sharing and printing.
1717

18+
## Installation
19+
20+
<embed src="./install.md"></embed>
21+
1822
## Configuration Instructions
1923

2024
### Activating Template Printing
@@ -1776,7 +1780,7 @@ No. | Name
17761780

17771781
---
17781782

1779-
# Conditioned Output
1783+
## Conditioned Output
17801784

17811785
Carbone provides a series of condition-based output formatters to **hide** or **display** specified content in templates based on specific conditions. Depending on business needs, you can choose **`drop`/`keep`** (concise usage) or **`showBegin`/`showEnd`**, **`hideBegin`/`hideEnd`** (suitable for large sections of content).
17821786

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
2+
### 安装插件
3+
4+
参考 [商业插件的安装与升级](/welcome/getting-started/plugin)
5+
6+
### 安装 LibreOffice(可选)
7+
8+
生成 PDF 必须安装 LibreOffice,[请前往官网下载](
9+
https://www.libreoffice.org/download/download-libreoffice)。Docker 版本,可以直接在 `./storage/scripts` 目录下,编写一段脚本。
10+
11+
```bash
12+
mkdir ./storage/scripts
13+
vim install-libreoffice.sh
14+
```
15+
16+
`install-libreoffice.sh` 的内容如下:
17+
18+
```sh
19+
#!/bin/bash
20+
21+
# Define variables
22+
INSTALL_DIR="/opt/libreoffice24.8"
23+
DOWNLOAD_URL="https://download.documentfoundation.org/libreoffice/stable/24.8.4/deb/x86_64/LibreOffice_24.8.4_Linux_x86-64_deb.tar.gz"
24+
25+
# Check if LibreOffice is already installed
26+
if [ -d "$INSTALL_DIR" ]; then
27+
echo "LibreOffice is already installed, skipping installation."
28+
exit 0
29+
fi
30+
31+
# Update APT sources
32+
tee /etc/apt/sources.list > /dev/null <<EOF
33+
deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free
34+
deb-src http://mirrors.aliyun.com/debian/ bookworm main contrib non-free
35+
deb http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free
36+
deb-src http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free
37+
deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free
38+
deb-src http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free
39+
deb http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free
40+
deb-src http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free
41+
EOF
42+
43+
# Update APT and install dependencies
44+
apt-get update
45+
46+
apt-get install -y \
47+
libfreetype6 \
48+
fontconfig \
49+
libgssapi-krb5-2 \
50+
libxml2 \
51+
libnss3 \
52+
libdbus-1-3 \
53+
libcairo2 \
54+
libxslt1.1 \
55+
libglib2.0-0 \
56+
libcups2 \
57+
libx11-xcb1 \
58+
ttf-mscorefonts-installer \
59+
fonts-wqy-zenhei
60+
61+
rm -rf /var/lib/apt/lists/*
62+
63+
cd /app/nocobase/storage/scripts
64+
65+
# Download and install LibreOffice if not already present
66+
if [ ! -d "./libreoffice" ]; then
67+
rm -rf libreoffice.tar.gz
68+
wget --no-check-certificate -O libreoffice.tar.gz $DOWNLOAD_URL
69+
if [ $? -ne 0 ]; then
70+
echo "Failed to download LibreOffice."
71+
exit 1
72+
fi
73+
rm -rf libreoffice && mkdir libreoffice
74+
tar -zxvf libreoffice.tar.gz -C ./libreoffice --strip-components=1
75+
if [ $? -ne 0 ]; then
76+
echo "Failed to extract LibreOffice."
77+
exit 1
78+
fi
79+
fi
80+
81+
# Install LibreOffice
82+
dpkg -i libreoffice/DEBS/*.deb
83+
84+
ln -s /opt/libreoffice24.8/program/soffice.bin /usr/bin/libreoffice
85+
libreoffice --version
86+
87+
if [ $? -ne 0 ]; then
88+
echo "Failed to install LibreOffice."
89+
exit 1
90+
fi
91+
92+
echo "LibreOffice installation completed successfully."
93+
```
94+
95+
重启 app 容器
96+
97+
```bash
98+
docker compose restart app
99+
# 查看日志
100+
docker compose logs app
101+
```
102+
103+
检测是否安装成功
104+
105+
```bash
106+
$ docker compose exec app bash -c "libreoffice --version"
107+
108+
LibreOffice 24.8.4.2 bb3cfa12c7b1bf994ecc5649a80400d06cd71002
109+
```

docs/ja-JP/handbook/action-template-print/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ The Template Printing plugin is a powerful tool that allows you to edit template
1515
- **Formatter Support**: Provides conditional output, date formatting, number formatting, and other functions to enhance the readability and professionalism of documents.
1616
- **Efficient Output Formats**: Supports direct generation of PDF files for easy sharing and printing.
1717

18+
## インストール
19+
20+
<embed src="./install.md"></embed>
21+
1822
## Configuration Instructions
1923

2024
### Activating Template Printing
@@ -1776,7 +1780,7 @@ No. | Name
17761780

17771781
---
17781782

1779-
# Conditioned Output
1783+
## Conditioned Output
17801784

17811785
Carbone provides a series of condition-based output formatters to **hide** or **display** specified content in templates based on specific conditions. Depending on business needs, you can choose **`drop`/`keep`** (concise usage) or **`showBegin`/`showEnd`**, **`hideBegin`/`hideEnd`** (suitable for large sections of content).
17821786

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
2+
### 安装插件
3+
4+
参考 [商业插件的安装与升级](/welcome/getting-started/plugin)
5+
6+
### 安装 LibreOffice(可选)
7+
8+
生成 PDF 必须安装 LibreOffice,[请前往官网下载](
9+
https://www.libreoffice.org/download/download-libreoffice)。Docker 版本,可以直接在 `./storage/scripts` 目录下,编写一段脚本。
10+
11+
```bash
12+
mkdir ./storage/scripts
13+
vim install-libreoffice.sh
14+
```
15+
16+
`install-libreoffice.sh` 的内容如下:
17+
18+
```sh
19+
#!/bin/bash
20+
21+
# Define variables
22+
INSTALL_DIR="/opt/libreoffice24.8"
23+
DOWNLOAD_URL="https://download.documentfoundation.org/libreoffice/stable/24.8.4/deb/x86_64/LibreOffice_24.8.4_Linux_x86-64_deb.tar.gz"
24+
25+
# Check if LibreOffice is already installed
26+
if [ -d "$INSTALL_DIR" ]; then
27+
echo "LibreOffice is already installed, skipping installation."
28+
exit 0
29+
fi
30+
31+
# Update APT sources
32+
tee /etc/apt/sources.list > /dev/null <<EOF
33+
deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free
34+
deb-src http://mirrors.aliyun.com/debian/ bookworm main contrib non-free
35+
deb http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free
36+
deb-src http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free
37+
deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free
38+
deb-src http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free
39+
deb http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free
40+
deb-src http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free
41+
EOF
42+
43+
# Update APT and install dependencies
44+
apt-get update
45+
46+
apt-get install -y \
47+
libfreetype6 \
48+
fontconfig \
49+
libgssapi-krb5-2 \
50+
libxml2 \
51+
libnss3 \
52+
libdbus-1-3 \
53+
libcairo2 \
54+
libxslt1.1 \
55+
libglib2.0-0 \
56+
libcups2 \
57+
libx11-xcb1 \
58+
ttf-mscorefonts-installer \
59+
fonts-wqy-zenhei
60+
61+
rm -rf /var/lib/apt/lists/*
62+
63+
cd /app/nocobase/storage/scripts
64+
65+
# Download and install LibreOffice if not already present
66+
if [ ! -d "./libreoffice" ]; then
67+
rm -rf libreoffice.tar.gz
68+
wget --no-check-certificate -O libreoffice.tar.gz $DOWNLOAD_URL
69+
if [ $? -ne 0 ]; then
70+
echo "Failed to download LibreOffice."
71+
exit 1
72+
fi
73+
rm -rf libreoffice && mkdir libreoffice
74+
tar -zxvf libreoffice.tar.gz -C ./libreoffice --strip-components=1
75+
if [ $? -ne 0 ]; then
76+
echo "Failed to extract LibreOffice."
77+
exit 1
78+
fi
79+
fi
80+
81+
# Install LibreOffice
82+
dpkg -i libreoffice/DEBS/*.deb
83+
84+
ln -s /opt/libreoffice24.8/program/soffice.bin /usr/bin/libreoffice
85+
libreoffice --version
86+
87+
if [ $? -ne 0 ]; then
88+
echo "Failed to install LibreOffice."
89+
exit 1
90+
fi
91+
92+
echo "LibreOffice installation completed successfully."
93+
```
94+
95+
重启 app 容器
96+
97+
```bash
98+
docker compose restart app
99+
# 查看日志
100+
docker compose logs app
101+
```
102+
103+
检测是否安装成功
104+
105+
```bash
106+
$ docker compose exec app bash -c "libreoffice --version"
107+
108+
LibreOffice 24.8.4.2 bb3cfa12c7b1bf994ecc5649a80400d06cd71002
109+
```

docs/zh-CN/handbook/action-template-print/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
- **格式化器支持**:提供条件输出、日期格式化、数字格式化等功能,提升文档的可读性和专业性。
1616
- **高效的输出格式**:支持直接生成 PDF 文件,方便分享和打印。
1717

18+
## 安装
19+
20+
<embed src="./install.md"></embed>
21+
1822
## 配置说明
1923

2024
### 激活模板打印功能
@@ -1778,7 +1782,7 @@ Ford, Chevrolet
17781782

17791783
---
17801784

1781-
# 条件输出(Conditioned output)
1785+
## 条件输出(Conditioned output)
17821786

17831787
Carbone 提供了一系列条件输出的格式化器,用于在模板中根据特定条件**隐藏****显示**指定内容。可根据业务需求选择**`drop`/`keep`**(简洁用法)或者**`showBegin`/`showEnd`****`hideBegin`/`hideEnd`**(适用于大段内容)等。
17841788

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
2+
### 安装插件
3+
4+
参考 [商业插件的安装与升级](/welcome/getting-started/plugin)
5+
6+
### 安装 LibreOffice(可选)
7+
8+
生成 PDF 必须安装 LibreOffice,[请前往官网下载](
9+
https://www.libreoffice.org/download/download-libreoffice)。Docker 版本,可以直接在 `./storage/scripts` 目录下,编写一段脚本。
10+
11+
```bash
12+
mkdir ./storage/scripts
13+
vim install-libreoffice.sh
14+
```
15+
16+
`install-libreoffice.sh` 的内容如下:
17+
18+
```sh
19+
#!/bin/bash
20+
21+
# Define variables
22+
INSTALL_DIR="/opt/libreoffice24.8"
23+
DOWNLOAD_URL="https://download.documentfoundation.org/libreoffice/stable/24.8.4/deb/x86_64/LibreOffice_24.8.4_Linux_x86-64_deb.tar.gz"
24+
25+
# Check if LibreOffice is already installed
26+
if [ -d "$INSTALL_DIR" ]; then
27+
echo "LibreOffice is already installed, skipping installation."
28+
exit 0
29+
fi
30+
31+
# Update APT sources
32+
tee /etc/apt/sources.list > /dev/null <<EOF
33+
deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free
34+
deb-src http://mirrors.aliyun.com/debian/ bookworm main contrib non-free
35+
deb http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free
36+
deb-src http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free
37+
deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free
38+
deb-src http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free
39+
deb http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free
40+
deb-src http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free
41+
EOF
42+
43+
# Update APT and install dependencies
44+
apt-get update
45+
46+
apt-get install -y \
47+
libfreetype6 \
48+
fontconfig \
49+
libgssapi-krb5-2 \
50+
libxml2 \
51+
libnss3 \
52+
libdbus-1-3 \
53+
libcairo2 \
54+
libxslt1.1 \
55+
libglib2.0-0 \
56+
libcups2 \
57+
libx11-xcb1 \
58+
ttf-mscorefonts-installer \
59+
fonts-wqy-zenhei
60+
61+
rm -rf /var/lib/apt/lists/*
62+
63+
cd /app/nocobase/storage/scripts
64+
65+
# Download and install LibreOffice if not already present
66+
if [ ! -d "./libreoffice" ]; then
67+
rm -rf libreoffice.tar.gz
68+
wget --no-check-certificate -O libreoffice.tar.gz $DOWNLOAD_URL
69+
if [ $? -ne 0 ]; then
70+
echo "Failed to download LibreOffice."
71+
exit 1
72+
fi
73+
rm -rf libreoffice && mkdir libreoffice
74+
tar -zxvf libreoffice.tar.gz -C ./libreoffice --strip-components=1
75+
if [ $? -ne 0 ]; then
76+
echo "Failed to extract LibreOffice."
77+
exit 1
78+
fi
79+
fi
80+
81+
# Install LibreOffice
82+
dpkg -i libreoffice/DEBS/*.deb
83+
84+
ln -s /opt/libreoffice24.8/program/soffice.bin /usr/bin/libreoffice
85+
libreoffice --version
86+
87+
if [ $? -ne 0 ]; then
88+
echo "Failed to install LibreOffice."
89+
exit 1
90+
fi
91+
92+
echo "LibreOffice installation completed successfully."
93+
```
94+
95+
重启 app 容器
96+
97+
```bash
98+
docker compose restart app
99+
# 查看日志
100+
docker compose logs app
101+
```
102+
103+
检测是否安装成功
104+
105+
```bash
106+
$ docker compose exec app bash -c "libreoffice --version"
107+
108+
LibreOffice 24.8.4.2 bb3cfa12c7b1bf994ecc5649a80400d06cd71002
109+
```

0 commit comments

Comments
 (0)