Skip to content

Commit

Permalink
Merge pull request #113 from shalousun/master
Browse files Browse the repository at this point in the history
docs: Optimize the usage instructions for the @mock tag
  • Loading branch information
shalousun authored Sep 7, 2024
2 parents 79b42b8 + 7c5eb69 commit 7b037f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/en/guide/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ public class InvoiceController {
```

### 2. `@mock`
The `@mock` tag is used to set custom display values for basic type fields in objects. Once set, `smart-doc` will no longer generate random values for you.
This facilitates direct output of delivery documents through `smart-doc`. `smart-doc` treats the attribute value of the `@mock` tag by unescape any literals in `{@mock String}`.
If line breaks are needed in the content, do not use `\n`; simply perform line breaks directly within the comment.

```java
public class SimpleUser {
Expand Down
3 changes: 3 additions & 0 deletions docs/zh/guide/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ public class InvoiceController {


### 2. `@mock`
`@mock` `tag`用于在对象基本类型字段设置自定义文档展示值。设置值后`smart-doc`不再帮你生成随机值。
方便可以通过`smart-doc`直接输出交付文档。`smart-doc`会将`@mock`标签的属性值做将`{@mock String}`中的任何字面量取消转义。
如果内容需要换行不要使用`\n`, 就直接在注释里做换行。

```java
public class SimpleUser {
Expand Down

0 comments on commit 7b037f0

Please sign in to comment.