Skip to content

Sample code in Dart API reference not correctly formatted #2570

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

Closed
DartBot opened this issue Apr 15, 2012 · 6 comments
Closed

Sample code in Dart API reference not correctly formatted #2570

DartBot opened this issue Apr 15, 2012 · 6 comments
Milestone

Comments

@DartBot
Copy link

DartBot commented Apr 15, 2012

This issue was originally filed by [email protected]


What steps will reproduce the problem?
Sample code that is part of either class or method documentation is
not correctly formatted. Please check sample codes at the
following adresses:
http://api.dartlang.org/dart_core/Expect.html#throws
http://api.dartlang.org/dart_core/Future.html
http://api.dartlang.org/io/InputStream.html

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.


Attachment:
dart-future-sample-code-not-correctly-formatted.png (13.91 KB)

@kasperl
Copy link

kasperl commented Apr 16, 2012

Added Area-Site, Triaged labels.

@sethladd
Copy link
Contributor

sethladd commented Jun 1, 2012

Removed Area-Site label.
Added Area-DartDoc label.

@munificent
Copy link
Member

These can be easily fixed by using Markdown code blocks (i.e. indent four spaces) instead of [: ... :] style, which currently only works for inline code.


Added this to the M1 milestone.

@DartBot
Copy link
Author

DartBot commented Sep 8, 2012

This comment was originally written by [email protected]


The given examples are currently fixed, e.g. Future in r8569.

I searched for other examples of two-space indented code blocks in doc comments, and found only this one:
http://api.dartlang.org/docs/continuous/dart_core/Completer.html

Gory details of that:

find . -name '.dart' -print
| xargs pcregrep -M ' [
] {2,4}\S.\n [] {2,4}\S'
2>&1 | tee log.txt

// two-space indent used for code block.
dart/lib/core/future.dart (on Completer)
runtime/lib/byte_array.dart (on ByteArray, which isn't in API docs)

// two-space indent used for list items.
tests/co19/src/{many tests} (co19 isn't trying to use Markdown)
runtime/bin/http_parser.dart
runtime/bin/mime_multipart_parser.dart
utils/testrunner/testrunner.dart
lib/mirrors/mirrors.dart (hanging indent on "-" bullets)

// used in a doc comment that doesn't generate docs.
pkg/unittest/unittest.dart
pkg/intl/date_format.dart

// other / unsure of the intent.
tools/testing/dart/status_expression.dart: one-space indent

// ignoring.
frog/*


Set owner to [email protected].

@DartBot
Copy link
Author

DartBot commented Sep 11, 2012

This comment was originally written by [email protected]


Completer fixed to use a code block by https://chromiumcodereview.appspot.com/10905165/

(Well, it comes out as three code blocks, but I think that's a bug in dartdoc,
http://code.google.com/p/dart/issues/detail?id=5054 )

@DartBot
Copy link
Author

DartBot commented Sep 11, 2012

This comment was originally written by [email protected]


Added Fixed label.

@DartBot DartBot added this to the M1 milestone Sep 11, 2012
dart-bot pushed a commit that referenced this issue Aug 11, 2020
> git log --oneline 04b054b62cc437cf23451785fdc50e49cd9de139..master
0d185a39 (HEAD -> master, origin/master, origin/HEAD) Push null-safety forwards to 2.11 (#2604)
56f9f27f Hide outdated --mode flag (#2603)
61ce6f81 Avoid double loop (#2605)
fa6e57d7 (disable_mixed_mode_validation) Fix outdated latest ordering (#2598)
6549e4aa Remove unused dependency from pubspec.yaml (#2592)
61543d07 Don't look for external package foo during testing (#2599)
590b448f Fixed license headers (#2595)
04e0601e Don't show entries for dev-dependencies in outdated --json --no-dev-dependencies (#2591)
8c3778c4 Configure GitHub move app (#2578)
eec7beca (top_level_command) Pass --(no-)sound-null-safety arg through to VM. (#2542)
152e4740 Warn about publishing in mixed mode (#2583)
0b7a3abe Removed april fools toys (#2325)
b74a5b73 Actually print hints (#2582)
8ec3a66d (pub2) Fix outdated --no-color (#2572)
7bb3d4e6 Use getSdkPath() in NullSafetyAnalysis (#2573)
3c578f24 Drop the "magic" package concept (#2577)
0e967ff0 Remove unused function (#2570)
988fefef Remove dependency overrides (#2568)

Change-Id: I58bf14234ed55bf9d825de60a40ded1d65281195
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158003
Reviewed-by: Jonas Jensen <[email protected]>
Commit-Queue: Sigurd Meldgaard <[email protected]>
This issue was closed.
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

No branches or pull requests

4 participants