在 Confluence
Cloud 中使用自定义库
当您在图表中定期重用复杂或特定形状时,自定义形状库可帮助您节省时间。
创建自定义库
-
编辑 Confluence
页面,键入{draw并选择Drawio以插入
draw.io 图表宏,然后创建一个新图表。或者,您可以在 draw.io 编辑器中打开现有图表。
-
单击文件
> 新库,然后选择要存储自定义库的位置。
-
浏览器将其存储在您的浏览器中,并且在您编辑图表时将自动可用。如果您清除浏览器数据,您的自定义形状库将被删除。
-
设备将您的库的副本另存为设备.xml上的文件。处理图表时需要加载形状库,但如果清除浏览器数据,此文件不会被删除。
-
输入形状库的名称。您可以将设备中的图像文件或图像 URL 拖到此对话框中,以便在保存之前将它们直接添加到新的自定义库中,或者单击添加图像以添加保存在设备上的文件。完成后单击保存。
您的新自定义形状库出现在便笺簿下方的左侧面板中。您现在可以将形状或选定的形状组从绘图画布拖到形状库中。
在自定义形状库中编辑形状
-
单击自定义库名称旁边的编辑铅笔图标。
-
单击形状下的名称并输入新名称。
-
单击要删除的形状右上角的十字。
-
完成后保存您的自定义库(单击Save)。
导出您的自定义形状库
-
单击自定义库名称旁边的编辑铅笔图标。
-
单击导出。
-
如果您愿意,请输入新文件名,然后选择是否将自定义库保存到您的设备或浏览器。
打开现有的自定义库
-
单击文件
> 打开库,然后选择存储自定义库文件的位置。下面介绍了存储在
Confluence Cloud 中的共享自定义库。
-
打开自定义库文件:
-
导航到您设备上的文件,然后单击选择。
-
单击存储在浏览器中的库的链接名称。
-
输入您的库文件在
Internet 上可用的 URL。
您的自定义库将在暂存器下方的左侧面板中打开。
在 Confluence Cloud
中提供 draw.io 自定义库
Confluence Cloud
管理员可以将自定义库添加到实例设置中的 draw.io 配置中。然后,用户可以在使用 draw.io 时加载这些自定义库。
当团队需要以相同样式创建图表,或者当他们需要使用相同的形状或形状组时,这很有用。
-
转到 Confluence
设置。在左侧的Atlassian
Marketplace部分中,单击draw.io
Configuration。
-
转到自定义库选项卡,然后单击添加库。
-
导航到您设备上的自定义库文件,选择它,然后单击选择。
现在用户可以打开您刚刚存储在
Confluence Cloud 中的共享自定义库。
在 draw.io
中打开一个共享的自定义库
要以用户身份打开自定义库,首先编辑或添加新的 draw.io 图表。
-
点击File
> Open Library from > Confluence Cloud。
-
单击以启用要打开的自定义库(或多个库)的复选框,然后单击OK。
您的自定义库出现在左侧面板的Scratchpad下。
从 Confluence Cloud
中删除共享的自定义库
-
转到 Confluence
设置。在左侧的Atlassian
Marketplace部分中,单击draw.io
Configuration。
-
转到自定义库选项卡,单击要删除的库的操作列中的叉号。
设置自定义默认形状库
作为管理员,您还可以通过在
draw.io 配置中添加一行来设置默认打开哪些形状库。
-
转到 Confluence
设置。在左侧的Atlassian
Marketplace部分中,单击draw.io
Configuration。
-
编辑 JSON 代码以包含defaultLibraries选项并列出您要默认打开的库。
-
如果您希望默认打开自定义库,请添加defaultCustomLibraries选项并以相同方式列出库。
{ "defaultLibraries": "general;uml;entity;",
"defaultCustomLibraries": ["marketing", "infographics"], }
-
完成 draw.io
配置后单击保存。
Use custom libraries in Confluence Cloud
Custom shape libraries help you save time when you regularly reuse complex or
specific shapes in your diagrams.
Create a custom library
-
Edit a Confluence page, type {draw and
select Drawio to insert a draw.io
diagram macro, and create a new diagram. Alternatively you can open an
existing diagram in the draw.io editor.
-
Click File
> New Library and select where you want to store your custom library.
-
Browser stores it in your browser, and it will be automatically
available whenever you edit diagrams. If
you clear your browser data, your custom shape library will be deleted.
-
Device saves a copy of your library as an .xml file
on your device. You will need to load your shape library when you work
on a diagram, but this file will not be deleted if you clear your
browser data.
-
Enter a name for your shape library. You
can drag image files from your device or image URLs into this dialog to add
them directly to your new custom library before you save it, or click Add
images to add files saved on your device. Click Save when
you are done.
Your new custom shape library appears in the left-hand panel below the
scratchpad. You can now drag shapes or selected groups of shapes from the
drawing canvas into the shape library.
Edit shapes in your custom shape library
-
Click the edit pencil icon next to the
name of your custom library.
-
Click on the name under a shape and
enter a new name.
-
Click the cross in the top right of
the shape you want to delete.
-
Save your custom library when you are
done (click Save).
Export your custom shape library
-
Click the edit pencil icon next to the
name of your custom library.
-
Click Export.
-
Enter a new filename if you would like,
and choose whether to save your custom library to your device or your
browser.
Open an existing custom library
-
Click File
> Open Library from and select the location where your custom library
file is stored. Shared custom libraries stored in Confluence Cloud are
covered below.
-
Open the custom library file:
-
Navigate to the file on your device,
and click Choose.
-
Click on the linked name of the
library stored in your browser.
-
Enter the URL where your library
file is available on the internet.
Your custom library will open in the left panel under the scratchpad.
Make a draw.io custom library available in Confluence Cloud
Confluence Cloud administrators can add custom libraries to the draw.io
Configuration in the instance’s settings. Users can then load these custom
libraries when they work with draw.io.
This is useful when teams need to create diagrams in the same style, or when
they need to work with the same shapes or shape groups.
-
Go to the Confluence Settings. In the Atlassian
Marketplace section on the left, click on draw.io
Configuration.
-
Go to the Custom
Libraries tab, then click on Add
Library.
-
Navigate to the custom library file on
your device, select it, then click Choose.
Now users can open the shared custom library you just stored in Confluence
Cloud.
Open a shared custom library in draw.io
To open a custom library as a user, first edit or add a new draw.io diagram.
-
Click File
> Open Library from > Confluence Cloud.
-
Click to enable the checkbox for the
custom library (or multiple libraries) you want to open, then click OK.
Your custom library appears under the Scratchpad in
the left panel.
Delete a shared custom library from Confluence Cloud
-
Go to the Confluence Settings. In the Atlassian
Marketplace section on the left, click on draw.io
Configuration.
-
Go to the Custom
Libraries tab, click on the cross in the Action column
for the library you want to delete.
Set custom default shape libraries
As an administrator, you can also set which shape libraries are opened by
default by adding a line to the draw.io configuration.
-
Go to the Confluence Settings. In the Atlassian
Marketplace section on the left, click on draw.io
Configuration.
-
Edit the JSON code to include the defaultLibraries option
and list which libraries you want to open by default.
-
If you want to have a custom library
open by default, add the defaultCustomLibraries option
and list the libraries in the same way.
{ "defaultLibraries": "general;uml;entity;",
"defaultCustomLibraries": ["marketing", "infographics"], }
-
Click Save when
you are finished with the draw.io configuration.