Skip to content

Conversation

frazze-jobb
Copy link
Contributor

No description provided.

@frazze-jobb frazze-jobb self-assigned this Sep 23, 2025
Copy link
Contributor

github-actions bot commented Sep 23, 2025

CT Test Results

    4 files    228 suites   1h 55m 19s ⏱️
3 732 tests 3 629 ✅ 103 💤 0 ❌
4 862 runs  4 733 ✅ 129 💤 0 ❌

Results for commit ae6b9e7.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

Copy link
Contributor

@kikofernandez kikofernandez left a comment

Choose a reason for hiding this comment

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

I believe we should add tests, similar to shell_docs_SUITE with the function docsmap.
Essentially, we want to test that we do not crash if we generate all man pages.

The main reason is that we may not crash when we test locally, but we may add some unsupported markdown that generates a new markdown AST node, and that one crashes the man page generation.

render_type(Module, D, #{}).

%% extract AST raw type specifications.
-spec extract_type_specs(atom()) -> term().
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
-spec extract_type_specs(atom()) -> term().
-spec extract_type_specs(module()) -> map().

@frazze-jobb frazze-jobb force-pushed the frazze/doc/reference_manual_to_man_page branch from 87c21c1 to a930d0c Compare September 24, 2025 10:32
@frazze-jobb frazze-jobb changed the base branch from master to maint September 24, 2025 10:32
@frazze-jobb frazze-jobb force-pushed the frazze/doc/reference_manual_to_man_page branch from a930d0c to 55121ed Compare September 24, 2025 11:06
@frazze-jobb frazze-jobb added the testing currently being tested, tag is used by OTP internal CI label Sep 25, 2025
@frazze-jobb frazze-jobb force-pushed the frazze/doc/reference_manual_to_man_page branch 7 times, most recently from eb40e71 to 2b60a7a Compare October 2, 2025 10:08
Comment on lines 62 to 69
%% Formats markdown as a roff man page.
-spec markdown_to_manpage(binary() | shell_docs:chunk_elements(), file:filename(), string()) -> binary().
markdown_to_manpage(Markdown, Path, Section) when is_binary(Markdown) ->
markdown_to_manpage(shell_docs_markdown:parse_md(Markdown), Path, Section);
markdown_to_manpage(MarkdownChunks, Path, Section) ->
Path1 = filename:absname(Path),
Copy link
Contributor

Choose a reason for hiding this comment

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

The only external entry point to this function is passing a binary(), which means it receives markdown.
I wonder if we really need an overloaded external function, or if we could instead expect a single input type for the Markdown variable, which simplifies the typing of the function

Comment on lines 191 to 206
format_p_item({code,_,Text}) ->
[~B"\fI",format_p_item(Text),~B"\fR"];
format_p_item({em,_,Text}) ->
[~B"\fB",format_p_item(Text),~B"\fR"];
format_p_item({i,_,Text}) ->
[~B"\fI",format_p_item(Text),~B"\fR"];
format_p_item({a,_,Text}) ->
[~B"\fI",format_p_item(Text),~B"\fR"];
format_p_item({strong,_,Text}) ->
["\\fB", format_p_item(Text), "\\fR"];
format_p_item([H|T]) ->
[format_p_item(H)|format_p_item(T)];
format_p_item([]) ->
[];
format_p_item(Text) when is_binary(Text) ->
escape_backslashes(Text).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion, take it or leave it :)
Just trying to remove some base case with the list comprehension, and removing some more function clauses, but feel free to ignore

Suggested change
format_p_item({code,_,Text}) ->
[~B"\fI",format_p_item(Text),~B"\fR"];
format_p_item({em,_,Text}) ->
[~B"\fB",format_p_item(Text),~B"\fR"];
format_p_item({i,_,Text}) ->
[~B"\fI",format_p_item(Text),~B"\fR"];
format_p_item({a,_,Text}) ->
[~B"\fI",format_p_item(Text),~B"\fR"];
format_p_item({strong,_,Text}) ->
["\\fB", format_p_item(Text), "\\fR"];
format_p_item([H|T]) ->
[format_p_item(H)|format_p_item(T)];
format_p_item([]) ->
[];
format_p_item(Text) when is_binary(Text) ->
escape_backslashes(Text).
format_p_item({Fi,_,Text}) when Fl =:= code;
Fl =:= i;
Fl =:= a->
[~B"\fI",format_p_item(Text),~B"\fR"];
format_p_item({Fb,_,Text}) when Fb =:= em;
Fb =:= strong->
[~B"\fB",format_p_item(Text),~B"\fR"];
format_p_item(Ls) when is_list(Ls)->
[format_p_item(H) || H <- Ls];
format_p_item(Text) when is_binary(Text) ->
escape_backslashes(Text).

@frazze-jobb frazze-jobb force-pushed the frazze/doc/reference_manual_to_man_page branch from 2b60a7a to ae6b9e7 Compare October 15, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation feature team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants