{"id":18464306,"url":"https://github.com/projectdiscovery/yamldoc-go","last_synced_at":"2025-04-07T12:10:44.123Z","repository":{"id":45648745,"uuid":"365024435","full_name":"projectdiscovery/yamldoc-go","owner":"projectdiscovery","description":"A documentation generator for YAML as code","archived":false,"fork":false,"pushed_at":"2025-03-31T00:18:36.000Z","size":104,"stargazers_count":21,"open_issues_count":9,"forks_count":4,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-31T11:04:39.529Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projectdiscovery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-06T20:05:09.000Z","updated_at":"2025-01-31T10:50:39.000Z","dependencies_parsed_at":"2025-02-25T06:10:40.502Z","dependency_job_id":"38740896-2e39-4ee8-a9a7-4d4011f96e91","html_url":"https://github.com/projectdiscovery/yamldoc-go","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fyamldoc-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fyamldoc-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fyamldoc-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fyamldoc-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectdiscovery","download_url":"https://codeload.github.com/projectdiscovery/yamldoc-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648977,"owners_count":20972945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T09:09:23.986Z","updated_at":"2025-04-07T12:10:44.104Z","avatar_url":"https://github.com/projectdiscovery.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yamldoc-go\n\nA standalone version of the YAML Code Documentation approach described at https://www.talos-systems.com/blog/documentation-as-code/. All credits goes to original authors.\n\n\n### Changes\n\n- Added support for example name based comments\n- Fixed a panic with embedded structs and added support for them.\n- Complete rewrite of docgen using [dst](https://github.com/dave/dst) to support multi-package structure organization.\n  \n### Usage\n\nThe general recommendation is, all the structures for a single type should be in a single file.\n\nThe following go:generate command will generate docs for a specified file.\n\n```bash\n//go:generate dstdocgen -path ~/projectdiscovery/nuclei/v2/pkg/templates -structure Template -output output.go\n$ go generate pkg/\u003cpath_to_file\u003e.go\n```\n\nBelow is an example struct with all supported annotation as examples.\n\n```go\nkubeletExtraMountsExample = []specs.Mount{\n\t\t{\n\t\t\tSource:      \"/var/lib/example\",\n\t\t\tDestination: \"/var/lib/example\",\n\t\t\tType:        \"bind\",\n\t\t\tOptions: []string{\n\t\t\t\t\"rshared\",\n\t\t\t\t\"rw\",\n\t\t\t},\n\t\t},\n\t}\n\n...\n\ntype Config struct {\n    // description: |\n    //   Indicates the schema used to decode the contents.\n    // values:\n    //   - v1alpha1\n    ConfigVersion string `yaml:\"version\"`\n    // description: |\n    //   Enable verbose logging.\n    // values:\n    //   - true\n    //   - yes\n    //   - false\n    //   - no\n    ConfigDebug bool `yaml:\"debug\"`\n    //   description: |\n    //     The `image` field is an optional reference to an alternative kubelet image.\n    //   examples:\n    //     - value: '\"docker.io/\u003corg\u003e/kubelet:latest\"'\n    KubeletImage string `yaml:\"image,omitempty\"`\n    //   description: |\n    //     The `extraArgs` field is used to provide additional flags to the kubelet.\n    //   examples:\n    //     - name: Description for this example\n    //       value: \u003e\n    //         map[string]string{\n    //           \"key\": \"value\",\n    //         }\n    KubeletExtraArgs map[string]string `yaml:\"extraArgs,omitempty\"`\n    //   description: |\n    //     The `extraMounts` field is used to add additional mounts to the kubelet container.\n    //   examples:\n    //     - value: kubeletExtraMountsExample\n    KubeletExtraMounts []specs.Mount `yaml:\"extraMounts,omitempty\"`\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Fyamldoc-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectdiscovery%2Fyamldoc-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Fyamldoc-go/lists"}