Skip to content

Add support for subshell functions#78

Closed
jbrubake wants to merge 23 commits intoreconquest:masterfrom
jbrubake:detect-subshell-funcs
Closed

Add support for subshell functions#78
jbrubake wants to merge 23 commits intoreconquest:masterfrom
jbrubake:detect-subshell-funcs

Conversation

@jbrubake
Copy link
Copy Markdown

Functions in the form func () ( ... ) are documented just like the more common {} version.

Use the actual header name (do not remove underscores)
# - `function_name () {`
# - `function_name {`
/^[[:blank:]]*(function[[:blank:]]+)?([a-zA-Z0-9_\-:-\\.]+)[[:blank:]]*(\([[:blank:]]*\))?[[:blank:]]*\{/ \
/^[[:blank:]]*(function[[:blank:]]+)?([a-zA-Z0-9_\-:-\\.]+)[[:blank:]]*(\([[:blank:]]*\))?[[:blank:]]*[({]/ \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to escape it?

/^[[:blank:]]*(function[[:blank:]]+)?([a-zA-Z0-9_\-:-\\.]+)[[:blank:]]*(\([[:blank:]]*\))?[[:blank:]]*[\{\(]/ \

Copy link
Copy Markdown
Author

@jbrubake jbrubake Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quote the { and (? No, it's a bracket expression so they are treated literally. You can quote them if using gawk but I don't think that works as expected if using another awk

rafmartom and others added 22 commits February 26, 2025 13:04
Fix underscores in github markdown links
- Choose header level used for functions depending on section nesting:
  - h2 for top-level
  - h3 for functions contained in sections
  - sections themselves are h2
  - sub-sections coming from annotations will be one level deeper than
the corresponding function
- Introduce `@endsection` to leave active section nesting again.
- `@section` blocks now support `@see`, `@set` and `@example`
- `@section` blocks also appear in TOC, contained functions will be
nested in TOC as well
- Sections are not bound to process_function/render_docblock anymore.
They can also be used when there is no more function following after
them. All that's needed is one none-comment line afterwards.
- added some tests to verify the new behavior

Bugfix:
Reset variable "description" whenever its value was assigned (and thus
consumed) to a `@section` or `@file` block to prevent it from being
inherited/used by the next function as well.
Rework and enhance `@section`

- Choose header level used for functions depending on section nesting:
  - h2 for top-level
  - h3 for functions contained in sections
  - sections themselves are h2
  - sub-sections coming from annotations will be one level deeper than
the corresponding function
- Introduce `@endsection` to leave active section nesting again.
- `@section` blocks now support `@see`, `@set` and `@example`
- `@section` blocks also appear in TOC, contained functions will be
nested in TOC as well
- Sections are not bound to process_function/render_docblock anymore.
They can also be used when there is no more function following after
them. All that's needed is one none-comment line afterwards.
- added some tests to verify the new behavior

Bugfix:
Reset variable "description" whenever its value was assigned (and thus
consumed) to a `@section` or `@file` block to prevent it from being
inherited/used by the next function as well.
allow to mark entire sections as `@internal`
* introduce literal blocks (no space trimming)
* Create md-literal-lines.test.sh
* Update README.md
Functions in the form `func () ( ... )` are documented just like
the more common `{}` version.
@jbrubake jbrubake force-pushed the detect-subshell-funcs branch from 353628a to cde2263 Compare March 12, 2026 20:39
@jbrubake jbrubake closed this by deleting the head repository Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants