2023-03-15 10:11:08 +00:00
|
|
|
# Obsidian Source Code Note Plugin
|
2023-03-11 05:57:51 +00:00
|
|
|
|
2023-03-11 06:35:31 +00:00
|
|
|
[中文文檔](./README-zh.md)
|
2023-03-11 05:57:51 +00:00
|
|
|
|
2023-03-11 06:35:31 +00:00
|
|
|
Technical Support [AntV X6](https://x6.antv.antgroup.com/)
|
2023-03-11 05:57:51 +00:00
|
|
|
|
2023-03-11 06:35:31 +00:00
|
|
|
## Functionality
|
2023-03-11 05:57:51 +00:00
|
|
|
|
2023-03-11 06:35:31 +00:00
|
|
|
- Parse the code blocks in Obsidian notes, draw the graphs of the method call links, and keep the code blocks in the canvas for easy viewing
|
|
|
|
|

|
2023-03-11 05:57:51 +00:00
|
|
|
|
2023-03-11 06:35:31 +00:00
|
|
|
## How to use
|
2023-03-11 05:57:51 +00:00
|
|
|
|
2023-03-11 06:35:31 +00:00
|
|
|
### 1. In the code comments section of Markdown's code block, write the relevant information with the keyword
|
2023-03-11 05:57:51 +00:00
|
|
|
|
2023-03-11 06:35:31 +00:00
|
|
|
| Supported keywords | Effect |
|
2023-03-11 05:57:51 +00:00
|
|
|
| ------------ |-----------------------------|
|
2023-03-11 06:35:31 +00:00
|
|
|
| @class | Name of the class corresponding to the method |
|
|
|
|
|
| @function | Method Name |
|
|
|
|
|
| @call | Call the related method, multiple methods are supported. Format: class name @ method name |
|
2023-03-11 05:57:51 +00:00
|
|
|
|
2023-03-11 06:35:31 +00:00
|
|
|
**Example**
|
2023-03-11 05:57:51 +00:00
|
|
|
|
|
|
|
|
```Java
|
|
|
|
|
/**
|
|
|
|
|
* Register metadata string.
|
|
|
|
|
*
|
|
|
|
|
* @class ShenyuClientHttpRegistryController
|
|
|
|
|
* @function registerMetadata(@RequestBody final MetaDataRegisterDTO metaDataRegisterDTO)
|
|
|
|
|
* @call RegisterClientServerDisruptorPublisher @ publish(final DataTypeParent data)
|
|
|
|
|
*
|
|
|
|
|
* @param metaDataRegisterDTO the meta data register dto
|
|
|
|
|
* @return the string
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/register-metadata")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String registerMetadata(@RequestBody final MetaDataRegisterDTO metaDataRegisterDTO) {
|
|
|
|
|
// 通过 Publisher 注册 元数据对象
|
|
|
|
|
publisher.publish(metaDataRegisterDTO);
|
|
|
|
|
return ShenyuResultMessage.SUCCESS;
|
2023-03-10 09:44:58 +00:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-03-11 05:57:51 +00:00
|
|
|
```Java
|
|
|
|
|
/**
|
|
|
|
|
* Register metadata string.
|
|
|
|
|
*
|
|
|
|
|
* @class RegisterClientServerDisruptorPublisher
|
|
|
|
|
* @function publish(final DataTypeParent data)
|
|
|
|
|
*
|
|
|
|
|
* @param metaDataRegisterDTO the meta data register dto
|
|
|
|
|
* @return the string
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public void publish(final DataTypeParent data) {
|
|
|
|
|
// 获取 DisruptorProvider
|
|
|
|
|
DisruptorProvider<Collection<DataTypeParent>> provider = providerManage.getProvider();
|
|
|
|
|
// 调用 DisruptorProvider 的 onData 方法,发送数据
|
|
|
|
|
provider.onData(Collections.singleton(data));
|
2023-03-10 09:44:58 +00:00
|
|
|
}
|
|
|
|
|
```
|
2023-03-11 06:35:31 +00:00
|
|
|
### 2. Click the button to the left of Obsidian to open the canvas
|