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

lib/parser: Separate Markdown code from reStructuredText #5240

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wenzeslaus
Copy link
Member

This restores the original 'rest' file for reStructuredText output so that it is in a separate function (and file) from Markdown. The reStructuredText output is removed from the Markdown code. While this currently introduces some duplication, it allows for further modifications of Markdown without a need to modify the reStructuredText at the same time. Even now, there are significant differences between the outputs due to the differences in syntax (headings, images, command line option lists). Anyway, the reStructuredText is scheduled for removal since the initial addition of the Markdown build, so a separate file will be easy to remove later (and this is basically a first step in the removal).

This restores the original 'rest' file for reStructuredText output so that it is in a separate function (and file) from Markdown. The reStructuredText output is removed from the Markdown code. While this currently introduces some duplication, it allows for further modifications of Markdown without a need to modify the reStructuredText at the same time. Even now, there are significant differences between the outputs due to the differences in syntax (headings, images, command line option lists). Anyway, the reStructuredText is scheduled for removal since the initial addition of the Markdown build, so a separate file will be easy to remove later (and this is basically a first step in the removal).
@github-actions github-actions bot added C Related code is in C libraries labels Feb 28, 2025
@wenzeslaus
Copy link
Member Author

Hm, just fixing missing void in fun prototype and only macOS build reported -Werror,-Wstrict-prototypes. I didn't check the workflow files yet. Is this expected?

2025-02-28T22:31:14.8856250Z parser_md.c:23:21: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
2025-02-28T22:31:14.8932860Z    23 | static void usage_md();
2025-02-28T22:31:14.8964640Z       |                     ^
2025-02-28T22:31:14.8964990Z       |                      void
2025-02-28T22:31:14.8965540Z parser_md.c:35:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
2025-02-28T22:31:14.8966040Z    35 | void usage_md()
2025-02-28T22:31:14.8966290Z       |              ^
2025-02-28T22:31:14.8966520Z       |               void
2025-02-28T22:31:14.8966750Z 2 errors generated.
2025-02-28T22:31:14.8967050Z make[3]: *** [OBJ.aarch64-apple-darwin20.0.0/parser_md.o] Error 1

@echoix
Copy link
Member

echoix commented Mar 1, 2025

It's the only one running clang, and they find different things. We had Travis, but it was an older clang version anyways.

/*!
\brief Print module usage description in reStructuredText format.
*/
void G__usage_rest(void)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are the names inconsistent now?

Copy link
Member Author

Choose a reason for hiding this comment

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

The API is the same in both cases G__usage_rest and G__usage_markdown. The only difference is that G__usage_markdown calls static usage_md while G__usage_rest provides the implementation directly. I just kept code structure which is also common elsewhere, but it is not needed here now. I can clean that up so that there is no jump from the API function to static function and there is only one function. That will raise less questions.

@wenzeslaus wenzeslaus requested a review from petrasovaa March 3, 2025 20:25
@wenzeslaus wenzeslaus enabled auto-merge (squash) March 3, 2025 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C libraries
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants