1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/mirrors-iLogtail

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
How-to-genernate-plugin-doc.md 1.5 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
henryzhx8 Отправлено 28.12.2023 14:58 64b884c

How to generate plugin doc?

Usage

The upper case with comment tag (exported) field names would be auto extracted. When some field tags with json, yaml or mapstructure, the original name would be override by the previous sequence. Also,the default value set in the init function would be extracted as the default value column.

type TestDoc struct {
 Field1 int               `json:"field_1" comment:"field one"`
 Field2 string            `json:"field_2" comment:"field two"`
 Field3 int64             `json:"field_3" mapstructure:"field_33" comment:"field three"`
 Field4 []string          `json:"field_4" comment:"field four"`
 Field5 map[string]string `json:"field_5" comment:"field five"`
 ignoreField string
}

func (t TestDoc) Description() string {
 return "this is a test doc demo"
}
# test-plugin
## Description
this is a test doc demo
## Config
|  field   |   type   |   description   | default value   |
| ---- | ---- | ---- | ---- |
|field_1|int|field one|1|
|field_2|string|field two|"filed 2"|
|field_33|int64|field three|3|
|field_4|[]string|field four|["field","4"]|
|field_5|map[string]string|field five|{"k":"v"}|

Register to the doc center

Commands

  1. execute make docs to generate plugin docs. Notice: Please run the commands under the OS if your contribute plugin only supports the specific OS, such as linux.
  2. Because history documentation needs to be replenished constantly,you should purpose only append your plugins to plugin-list.md and only your plugin doc is tracked by git.

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/mirrors-iLogtail.git
git@api.gitlife.ru:oschina-mirror/mirrors-iLogtail.git
oschina-mirror
mirrors-iLogtail
mirrors-iLogtail
main