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

add .map, .flat, .concise, and .summary for Backtrace #2797

Merged
merged 4 commits into from May 17, 2019
Merged

add .map, .flat, .concise, and .summary for Backtrace #2797

merged 4 commits into from May 17, 2019

Conversation

lukasvalle
Copy link
Contributor

add .map, .flat, .concise, and .summary for Backtrace as list missed in #2632

doc/Type/Backtrace.pod6 Outdated Show resolved Hide resolved
doc/Type/Backtrace.pod6 Outdated Show resolved Hide resolved
doc/Type/Backtrace.pod6 Outdated Show resolved Hide resolved
doc/Type/Backtrace.pod6 Outdated Show resolved Hide resolved
@lukasvalle lukasvalle requested a review from Altai-man May 17, 2019 15:20
Copy link
Contributor

@JJ JJ left a comment

Choose a reason for hiding this comment

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

Please check out the comments I've made.

doc/Type/Backtrace.pod6 Outdated Show resolved Hide resolved
doc/Type/Backtrace.pod6 Outdated Show resolved Hide resolved
doc/Type/Backtrace.pod6 Outdated Show resolved Hide resolved
doc/Type/Backtrace.pod6 Outdated Show resolved Hide resolved
doc/Type/Backtrace.pod6 Outdated Show resolved Hide resolved
doc/Type/Backtrace.pod6 Outdated Show resolved Hide resolved
@Altai-man
Copy link
Member

Let's see. Please, wait a little, I will build docs now and will write some explanations...

@Altai-man
Copy link
Member

Altai-man commented May 17, 2019

Ok, so firstly I built docs using instructions at https://github.com/perl6/doc#building-the-html-documentation
Secondly, I had to install cpan-minus and install Mojolicious dependency to run it locally.

Then make run and opening the page in browser at localhost:3000 address.
2019-05-17-223209_1920x1080_scrot
^ here you can see how your changes look like (without highlighting enabled): the explanation lines and output are placed in a big code block, which is not good.

To improve the situation, we can:
1)Remove indentation from lines that are not planned to be in the code block, but rather that should be displayed as normal text(such as "This program" and "results in"), as was suggested.
2)The program code indentation ls left as is.
3)The output is not a Perl 6 code, so should be marked as a code(to get monospace font), but text, so we mark it with =for code :lang<text> directive.

For example, one of methods after an edit looks this way:

    multi method map(Backtrace:D: &block --> Seq:D)

It invokes &code for each element and gathers the return values in a sequence and returns it.

This program:

    sub inner { Backtrace.new.map({ say "{$_.file}: {$_.line}" }); }
    sub outer { inner; }
    outer;

results in:

=for code :lang<text>
SETTING::src/core/Backtrace.pm6: 85
SETTING::src/core/Backtrace.pm6: 85
test.p6: 1
test.p6: 2
test.p6: 3
test.p6: 1

=head2 method flat

Note that for the text block, indentation is absent, because =for code directive already treats the next lines as code and if there will be indentation, it will be present in the rendered docs, which is less than awesome.

After another make html-nohighlight and make run, I can check the changes:

2019-05-17-225715_1920x1080_scrot

^ results. With highlighting on the real site enabled, there will be a clear separation between the code and the result's listing.

I have fixed this pull request committing the changes, so you can check them.

Thanks a lot for your contribution! If there are any questions, don't hesitate to ask.

I have sent a pull request with my changes and this PR can be merged now.

@Altai-man Altai-man merged commit 3bbea96 into Raku:master May 17, 2019
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.

None yet

3 participants