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
Single style for output of examples #776
Comments
|
I like using the following, as this way multi-line output aligns well and it's clear that it's output. # OUTPUT:
# result1
# result2
# result3
# result4I'm against using # OUTPUT: «result1result2result3result4» |
|
You don't type the result at all. You copy-pasta them from camelia into the docs because you tested the example against camelia to make sure they hold true. The OUTPUT: «result» form allows easy parsing, I do agree that ¶ would have been a better pick because more ppl will be familiar with that symbol. We could change that automatically for html-output. I'm sorry but the "I don't know how to ... on my phone"-argument is to selfish to be relevant to hopefully millions of readers of docs.perl6.org. |
|
I agree that multi-line output should normally be on multiple lines. As for the It feels like «» are slightly redundant. So: say qw{1 2 3 4}; # OUTPUT: (1 2 3 4).say for qw{1 2 3 4};
# OUTPUT:
# 1
# 2
# 3
# 4↑ I see no problem here whatsoever. It is parseable and it looks great. Comparing that to this: say qw{1 2 3 4}; # OUTPUT: «(1 2 3 4)»↑ Meh, «» look a bit weird. |
|
I can replace every "write" occurrence with "paste result(and maybe add "OUTPUT:" word or something like this)" in original post if it matters. |
So you hope for millions of readers but how many contributors do you envision? Your argumentation seems to assume all the docs will be written by a handful of nerds who know all about entering Unicode on any device that falls into their hands and who not only regularly hang out on IRC, but also are connected when they make a contribution. My comments aren't about selfishness, but about pointing out that the proposed format alienates contributors by raising the knowledge required for making a contribution and reduces the amount of drive-by contributions we will get. |
|
I have no problem requiring unicode -- we're not going to hand out commit bits to everyone. The core contributors can keep things clean, and people contributing docs can do their best based on our submission guidelines when we have them. Perl 6 has always encouraged unicode where it makes sense, and we should, IMO, continue that trend in the docs (again, where it makes sense) @zoffixznet, if you're having trouble with the glyphs on this page (like ), I'm sure we can help you get that working (and then include that in a how to guide for getting people up and running with unicode) |
|
|
If it's going to be added to some guide, throw in |
|
See also comments in #51. |
|
It's a disaster. :) Most of the errors come from missing |
|
As a prototype I made Signature.pod6 compile. Took only two hours. I had to remove FormattingCodes from examples because the parser adds newlines and spaces at spots where they don't belong. In HTML they are not visible (they may pop up on copypasta tho) because spaces and newlines on inline tags are not rendered by the browser. With that change it works quite nicely. I found 8 bugs in those examples. If that rate hold for all .pod6 we are looking about 300 odd bugs. :) I'm not happy with having to add EVAL to two examples to catch compile time exceptions. Having EVAL blogs around each code block defies the purpose tho, as we want exit codes > 0 so make can complain properly. |
|
The EVAL problem is solved with: |
|
edbad254e0 this commit adds last bits to the Type/ section work. And, actually, I opened this issue to discuss how exactly we should format our output. There are many words(and I really appreciate everyone opinions), but no certain result, so my final thought is like this:
Any comments? |
|
I would recommend picking a single style. If we have more than one style, we have to write and maintain more code, and more documentation. I recommend this style, with 2 variants; one for dealing with output, and one for just the last value, in case the example doesn't deal with stdio. With this approach then we can have other comments that aren't being tested. I don't have a preference on the actual quotes; I think we can use any valid matching quote pair. (or a smaller whitelisted subset) |
|
Let us(or, rather, just lazy me) reanimate this! So, basically, judging by
Any opposite thoughts? |
|
No? Just go for it! |
|
Actually, we don't need the third clause, see https://irclog.perlgeek.de/perl6/2017-02-01#i_14023735 |
|
With #1165 #1176 #1181 the first goal is done. Also, I think it will be great to mention such major change to CONTRIBUTE.md(when it will be written) in some global news source for contributors(not everyone re-read contribution guidelines every day and we don't want to ruin our unified style quickly) like perl 6 weekly(?). cast @gfldex. And this hell will be closed soon. |
|
The test is written and soon will be PR'ed. |
|
The original goal was achieved. Closed. |

See #761 (comment)
TL;DR: right now we don't have a single "official" output format for our examples, and everyone who writes documentation uses their own style. It's bad if we want to test our examples result automatically in the future. Our current formatting variants:
#-> result# result# OUTPUT: «result»# OUTPUT: resultThe text was updated successfully, but these errors were encountered: