-
Notifications
You must be signed in to change notification settings - Fork 124
Use highlight js #1489
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
Use highlight js #1489
Conversation
3bc7986
to
8dee2ba
Compare
Aligning with similar change in dartdoc: dart-lang/dartdoc#1489
FYI: just pushed an `oops' commit that adds swift, obj-c, and java (for Flutter interop packages) Will cleanup/rebase once approved |
Thoughts @jcollins-g and @devoncarew ? |
Aligning with similar change in dartdoc: dart-lang/dartdoc#1489
0ddecd2
to
a589c97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change could use at least some screenshots demonstrating the change in appearance, but ideally a navigable example of something complicated like the SDK serving somewhere so we can see the new look and feel.
@@ -0,0 +1,99 @@ | |||
/* | |||
|
|||
github.com style (c) Vasily Polovnyov <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please indicate somewhere in LICENSE/README where this and other new third-party libraries included come from (including URLs) and their licensing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -797,7 +797,6 @@ class MarkdownDocument extends md.Document { | |||
} | |||
|
|||
bool specifiesLanguage = pre.classes.isNotEmpty; | |||
pre.classes.add('prettyprint'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you mention a bit more about how this is replaced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettyprint
was used by the pretty print library to find elements to style at runtime.
highlight.js
looks at all code blocks with language-XYZ
– no prettyprint needed
@@ -57,5 +57,5 @@ else | |||
(cd testing/test_package_small; dart -c ../../bin/dartdoc.dart) | |||
|
|||
# Run the tests. | |||
pub run grinder test | |||
pub run test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments on this commit: 90a379d
// using straight-up VM here | ||
return Dart.runAsync('test/all.dart', vmArgs: ['--checked']); | ||
// `pub run test` is a bit slower than running an `test_all.dart` script | ||
// But it provides more useful output in the case of failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you be more specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments on this commit: 90a379d
testing/test_package/lib/fake.dart
Outdated
@@ -496,7 +496,7 @@ class BaseForDocComments { | |||
/// | |||
/// Reference to a top-level const in another library [incorrectDocReferenceFromEx] | |||
/// | |||
/// Reference to prefixed-name from another lib [css.theOnlyThingInTheLibrary] xx | |||
/// Reference to prefixed-name from another lib [example_prefixed.incorrectDocReferenceFromEx] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does css.theOnlyThingInTheLibrary still fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That member was removed – but since this test was skipped, it didn't change output.
Just picked something that already existed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The member isn't actually gone, so this test should pass (assuming we didn't have the bug it is testing for).
@jcollins-g here's the before/after For the original bug, the new style is much more clean about comments vs ID selectors. Before After |
As is tradition
It may be a bit slower, but * It provides more helpful errors on failure * It captures all declared tests * `all.dart` was missing `utils_test.dart` for example
a589c97
to
dd3d83d
Compare
Sorry. Had to do a rebase fix – but went back to the original
…On Tue, Sep 12, 2017 at 10:11 AM, jcollins-g ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In testing/test_package/lib/fake.dart
<#1489 (comment)>:
> @@ -496,7 +496,7 @@ class BaseForDocComments {
///
/// Reference to a top-level const in another library [incorrectDocReferenceFromEx]
///
- /// Reference to prefixed-name from another lib [css.theOnlyThingInTheLibrary] xx
+ /// Reference to prefixed-name from another lib [example_prefixed.incorrectDocReferenceFromEx]
The member isn't actually gone, so this test should pass (assuming we
didn't have the bug it is testing for).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1489 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABCip3iit6kO4HaXJLfBLi_z8vNN7Rpks5shrtQgaJpZM4PIM5q>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit. Otherwise, looks good and the screenshots definitely show the improvement here. Thanks!
test/model_test.dart
Outdated
docsAsHtml, contains('<code>css.theOnlyThingInTheLibrary</code>')); | ||
docsAsHtml, | ||
contains( | ||
'<p>Reference to prefixed-name from another lib <code>css.theOnlyThingInTheLibrary</code> xx</p>')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this has " xx" on the end?
dd3d83d
to
82390a1
Compare
@jcollins-g – FYI. I removed the fixed test. In the test case, the link is still broken....but in the full output, the link is there. Zero clue why. |
No description provided.