Files
FixIt/layouts/_partials/function/camel-case.html
T
Cell 2c0b48370b feat(gen-docs): add Hugo partials docs generation (#809)
* feat(gen-docs): add documentation generation package with SassDoc and TypeDoc support

Add new `@hugo-fixit/gen-docs` package that parses Hugo config (hugo.toml) and generates
documentation. Includes SassDoc annotations for SCSS variables and mixins, TypeDoc config
for TypeScript source docs, and a `.sassdocrc` configuration file.

* docs(readme): add browsers support section

* feat(gen-docs): add Hugo partials docs generation and fix config empty sections

- Add partial-parser.ts: parses Hugo partial comment blocks (@param/@return/@example)
- Add partials.ts renderer: generates grouped Markdown with param tables
- Add `partials` subcommand with -t/-o options for template injection
- Fix config-parser: empty TOML sections (library.js/library.css) now retain descriptions
- Fix config-parser: correctly distinguish section-level vs key-level comments
- Update README with partials subcommand documentation
2026-07-21 12:19:07 +08:00

20 lines
614 B
HTML

{{- /*
Convert a snake_case string to camelCase.
Strategy: split by "_", capitalize first letter of each part (except first), then concatenate
@param {String} . - The snake_case string
@return {String} The camelCase string
@example
// "max_shown_lines" -> "maxShownLines"
{{- partial "function/camel-case.html" "max_shown_lines" -}}
*/ -}}
{{- $parts := split . "_" -}}
{{- $result := index $parts 0 -}}
{{- range $i, $part := $parts -}}
{{- if gt $i 0 -}}
{{- $result = printf "%s%s%s" $result (upper (substr $part 0 1)) (substr $part 1) -}}
{{- end -}}
{{- end -}}
{{- return $result -}}