Skip to content

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

Merged
merged 5 commits into from
Sep 12, 2017
Merged

Use highlight js #1489

merged 5 commits into from
Sep 12, 2017

Conversation

kevmoo
Copy link
Member

@kevmoo kevmoo commented Aug 31, 2017

No description provided.

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Aug 31, 2017
@kevmoo kevmoo force-pushed the use_highlight_js branch 3 times, most recently from 3bc7986 to 8dee2ba Compare August 31, 2017 04:03
kevmoo added a commit to dart-lang/pub-dev that referenced this pull request Aug 31, 2017
Aligning with similar change in dartdoc: dart-lang/dartdoc#1489
@kevmoo
Copy link
Member Author

kevmoo commented Aug 31, 2017

FYI: just pushed an `oops' commit that adds swift, obj-c, and java (for Flutter interop packages)

Will cleanup/rebase once approved

@kevmoo
Copy link
Member Author

kevmoo commented Aug 31, 2017

Thoughts @jcollins-g and @devoncarew ?

mkustermann pushed a commit to dart-lang/pub-dev that referenced this pull request Sep 1, 2017
Aligning with similar change in dartdoc: dart-lang/dartdoc#1489
Copy link
Contributor

@jcollins-g jcollins-g left a 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]>
Copy link
Contributor

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.

Copy link
Member Author

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');
Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the change?

Copy link
Member Author

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.
Copy link
Contributor

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?

Copy link
Member Author

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

@@ -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]
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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).

@kevmoo
Copy link
Member Author

kevmoo commented Sep 12, 2017

@jcollins-g here's the before/after

For the original bug, the new style is much more clean about comments vs ID selectors.

Before

screenshot_before

After

screenshot

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
@kevmoo
Copy link
Member Author

kevmoo commented Sep 12, 2017 via email

Copy link
Contributor

@jcollins-g jcollins-g left a 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!

docsAsHtml, contains('<code>css.theOnlyThingInTheLibrary</code>'));
docsAsHtml,
contains(
'<p>Reference to prefixed-name from another lib <code>css.theOnlyThingInTheLibrary</code> xx</p>'));
Copy link
Contributor

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?

@kevmoo kevmoo merged commit 82390a1 into master Sep 12, 2017
@kevmoo kevmoo deleted the use_highlight_js branch September 12, 2017 18:08
@kevmoo
Copy link
Member Author

kevmoo commented Sep 12, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants