Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't put "-* no-capture-flag *-" on its own line #3702

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

d-torrance
Copy link
Member

@d-torrance d-torrance commented Mar 20, 2025

Otherwise, the documentation will be garbled.

When not-capturing an example, we remove any instances of the string "-* no-capture-flag *-". If this string is by itself on a line, then we end up with an empty line in the example input, which messes everything up.

One example is the findProgram docs. This is out of order:

     +----------------------------------------------------------------------------+
     |  i3 : findProgram "normaliz"                                               |
     |                                                                            |
     |  o3 = normaliz                                                             |
     |                                                                            |
     |  o3 : Program                                                              |
     +----------------------------------------------------------------------------+

     If cmd is not provided, then cmd is run with the common --version command
     line option.

After the change:

     If cmd is not provided, then name is run with the common --version command
     line option.

     +-------------------------------+
     |  i3 : findProgram "normaliz"  |
     |                               |
     |  o3 = normaliz                |
     |                               |
     |  o3 : Program                 |
     +-------------------------------+

It might be more elegant to also remove the newline in the special case where -* no-capture-flag *- is by itself on a line. Allowing -- no-capture-flag would be cool too. But that would require some fancier regexes. But right now, this only affects Macaulay2Doc. Maybe something to think about if/when we start capturing the other packages' examples.

@d-torrance d-torrance requested a review from mahrud March 20, 2025 14:51
Otherwise, the documentation will be garbled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant