为了更好地在Mkdocs中展示,分享,收藏蓝图片段,我开发了这个工具。
https://github.com/kisspread/uebp
同时,还有一个 obsidian 的插件,可以在 obsidian 中直接使用,方便写笔记。
https://github.com/kisspread/uebp-obsidian
以下是一些用法和测试用例。
A MkDocs plugin that renders Unreal Engine Blueprint nodes in your documentation. Based on the excellent blueprintue-self-hosted-edition project.
Features
- Render Unreal Engine Blueprint nodes in your MkDocs documentation
- Support both local blueprint text and blueprintue.com links
- Interactive node visualization with pan and zoom
- Node connection visualization
- Copy button for blueprint text
Installation
Install the package with pip:
pip install mkdocs-blueprintue
Usage
The plugin supports three ways to include blueprints in your markdown:
1. Code Block (Recommended)
This format supports editor code folding and syntax highlighting. You can optionally specify a custom height:
```uebp height="500px"
Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_0"
FunctionReference=(MemberName="PrintString",bSelfContext=True)
NodePosX=0
NodePosY=0
NodeGuid=A0000000000000000000000000000000
End Object
```
The height parameter is optional and can be specified in:
- Pixels:
height="500px"
- Em units:
height="30em"
- Viewport height:
height="50vh"
If not specified, a default height of 643px will be used.
2. Inline Blueprint Text
For shorter blueprints, you can use the inline syntax:
![uebp]{{{Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_0" ... End Object}}}
Note: The inline syntax cannot be used inside code blocks.
3. Blueprintue.com Links
You can embed blueprints from blueprintue.com using their share links:
For example:
![uebp]{{{https://blueprintue.com/render/your-blueprint-id/}}}
Configuration
You can configure the plugin in your mkdocs.yml
:
plugins:
- blueprintue:
css_path: 'custom/css/path' # Optional: custom path to CSS files
js_path: 'custom/js/path' # Optional: custom path to JavaScript files
Acknowledgements
This plugin is based on blueprintue-self-hosted-edition, a fantastic project that provides the core functionality for rendering Unreal Engine Blueprint nodes. We are grateful to the original authors for their excellent work.
The blueprint rendering functionality has been extracted and adapted from the original project to work as a MkDocs plugin, while maintaining the same high quality and interactive features of the original implementation.
Some Test Cases for Development
0. Code Block Style
1.Code block Style In Item
- test
2. Don't affect other code blocks
// Copyright Epic Games, Inc. All Rights Reserved.
#include "LyraConfirmationScreen.h"
#if WITH_EDITOR
#include "CommonInputSettings.h"
#include "Editor/WidgetCompilerLog.h"
#endif
// Create Attribute set
UPCGParamData* ParamData = NewObject<UPCGParamData>();
// Create an int32 attribute
FPCGMetadataAttribute<int32>* Attribute = ParamData->Metadata->CreateAttribute<int32>(TEXT("ChosenPointsNum"), NumberOfElementsToKeep, true, true);
// Assign value
Attribute->SetValue(ParamData->Metadata->AddEntry(), NumberOfElementsToKeep);
3. No conversion inside code blocks
![uebp]{{{node text}}}