dart-lang / dartdoc

API documentation tool for Dart.
https://pub.dev/packages/dartdoc
BSD 3-Clause "New" or "Revised" License
473 stars 118 forks source link

Some classes not hyperlinked #1152

Closed Hixie closed 8 years ago

Hixie commented 8 years ago

If you look at: http://docs.flutter.io/flutter/gestures/GestureBinding-class.html

It says "Implements: HitTestable, HitTestDispatcher, HitTestTarget", but those classes aren't hyperlinked. This is weird, since they are also listed in the sidebar, and there they are hyperlinks.

Source: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/gestures/binding.dart

Hixie commented 8 years ago

http://docs.flutter.io/flutter/material/ThemeData/ThemeData.html shows this also. All the properties mentioned in the body of the constructor description should be hyperlinks but aren't.

Source: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/theme_data.dart

Hixie commented 8 years ago

Here's a particularly bad case: http://docs.flutter.io/flutter/widgets/CustomPainter/paint.html

Notice how Canvas.drawImage gets hyperlinked but Canvas.drawImageRect doesn't. Both are exported, both exist, both are in the docs. What the heck?

Source for CustomPainter: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/rendering/proxy_box.dart

Source for Canvas: https://github.com/flutter/engine/blob/master/sky/engine/core/dart/painting.dart

Hixie commented 8 years ago

cc @devoncarew

keertip commented 8 years ago

@Hixie, can you provide a link to the source code?

Hixie commented 8 years ago

The script that generates the docs is: https://github.com/flutter/flutter/blob/master/infra/docs.sh

I've updated the comments on this bug with links to the files that contain the classes in question.

devoncarew commented 8 years ago

Perhaps something to do with the markdown resolver? The items the get resolved here:

screen shot 2016-05-06 at 12 38 39 pm

are on the first line of the markdown list; the ones that don't are on the following lines.

https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/rendering/proxy_box.dart#L1424

eseidel commented 8 years ago

This diff will make the resolver work:

diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart
index a227f1a..72651a2 100644
--- a/packages/flutter/lib/src/rendering/proxy_box.dart
+++ b/packages/flutter/lib/src/rendering/proxy_box.dart
@@ -1476,7 +1476,7 @@ abstract class CustomPainter {
   ///    paint delegate, giving it the new [ImageInfo] object.
   ///
   /// 3. In your delegate's [paint] method, call the [Canvas.drawImage],
-  ///    [Canvas.drawImageRect], or [Canvas.drawImageNine] methods to paint the
+  ///   [Canvas.drawImageRect], or [Canvas.drawImageNine] methods to paint the
   ///    [ImageInfo.image] object, applying the [ImageInfo.scale] value to
   ///    obtain the correct rendering size.
   void paint(Canvas canvas, Size size);

I think this might be the bug: https://github.com/dart-lang/markdown/blob/157b8403ef065d25012b50c81311d9c262484c6d/lib/src/document.dart#L39

:)

eseidel commented 8 years ago

@kevmoo might know if my analysis above re: the possible package:markdown bug is correct. :) Probably my next step should be to write a unittest for markdown and see.

kevmoo commented 8 years ago

@eseidel plausible. A unittest would be nice.

devoncarew commented 8 years ago

Some of the earlier items in this bug are fixed; I'll take a look at the markdown related one.

Hixie commented 8 years ago

I still see this e.g. in: https://docs.flutter.io/flutter/material/OverlayEntry-class.html

(Draggable and AnimatedPositioned aren't hyperlinked, despite being listed in the index on the same page)

sethladd commented 8 years ago

What version of dartdoc did we use to build the docs.flutter.io? There used to be a comment in HTML files with the version number, but I can't find it?

devoncarew commented 8 years ago

The version is written into index.html; flutter docs are built w/ the last published version of dartdoc (these generated docs are up-to-date w/ the tool).

From looking at the source, the entries that we can't resolve really aren't resolvable w/ the file's imports. We'd need to either import the draggable and animatedpositioned libs into widgets/overlay.dart, or implement something like https://github.com/dart-lang/dartdoc/issues/1153. Let's track the fix in #1153.