Skip to content

Conversation

astashov
Copy link
Contributor

Added them to the _source_code partial, so every time we show the source code for something, it will have the Crossdart link.

/cc @sethladd

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@astashov
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@sethladd
Copy link
Contributor

Cool!

Can you add a command-line option to toggle this?

@astashov
Copy link
Contributor Author

Sure!

Copy link
Contributor

Choose a reason for hiding this comment

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

we would like this to be https or relative (//www.crossdart)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do //www.crossdart, thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

can you host crossdart on SSL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I host it on Google Cloud Storage (it's a static site), so I just need to buy SSL certificate, that's it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, google cloud storage doesn't allow for custom certs + custom DNS :(

You could put cloudfront in front.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh really? Okay, I need to look into it then. Thanks for advice.

@astashov
Copy link
Contributor Author

Okay, so, crossdart.info now supports HTTPS (https://crossdart.info). Unfortunately, I couldn't figure out how to make it work with CloudFront and GCS, so I moved everything to S3+CloudFront+Route53.

Also, added a CLI flag to turn Crossdart on.

@sethladd, PTAL.

@sethladd
Copy link
Contributor

Hi!

OK, we got our build in order and tests should be passing on our buildbots. Please take a moment to rebase and send up a new diff. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use a type annotation here? top-level variables should be typed. Thanks!

@astashov astashov force-pushed the add-crossdart-links branch from 573ab0a to de1bffe Compare August 29, 2015 01:58
@astashov
Copy link
Contributor Author

Rebased. It's weird - Travis CI complains that I have to run dartfmt -w lib/src/model.dart, but when I run it, it doesn't make any changes. Any idea why? Maybe I miss some dartfmt config file or something like that?

@devoncarew
Copy link
Member

Travis is running 1.12.0-dev.5.10 for that build. I'm guessing that the dev formatter produces slightly different code than the stable formatter. Are you on stable? That could be it -

@sethladd
Copy link
Contributor

What @devoncarew said. dartfmt changed its style between releases.

Now that 1.12 is out, we'll turn on stable-channel testing again and everyone can and should be using 1.12's dartfmt.

Sorry for the issues!

@astashov
Copy link
Contributor Author

Yup, just noticed, already upgrading our projects to Dart 1.12.0. Null-aware operators FTW! :)
Will check this one out tonight.

@astashov astashov force-pushed the add-crossdart-links branch 2 times, most recently from d1ef0ea to 74c8aad Compare September 1, 2015 14:18
@astashov
Copy link
Contributor Author

astashov commented Sep 1, 2015

Okay, Travis is now green, I squashed everything into one commit, and ready to go! :)

@astashov astashov force-pushed the add-crossdart-links branch 3 times, most recently from 271830e to a911554 Compare September 1, 2015 18:07
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I missed this before. Can you add some tests for this?

We don't need to test the generated HTML but it would be nice to test the output of calling element.documentation and element.documentationAsHtml with this option on and off.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, will add.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. Apologies for not catching that before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem :) Added tests, PTAL.

@astashov astashov force-pushed the add-crossdart-links branch from bfc8265 to 617fd09 Compare September 2, 2015 16:03
@sethladd
Copy link
Contributor

sethladd commented Sep 2, 2015

Nice! lgtm once we fix the failing test on windows.

Actually, can you fix the test failing on windows?

00:10 +135 ~1 -1: Method .crossdartHtmlTag() it returns a Crossdart link when Crossdart suppo
    rt is enabled
    Expected: contains '//crossdart.info/p/test_package/0.0.1'
      Actual: '<a class=\'crossdart\' href=\'/C:/projects/dartdoc/test_package/lib/example.dart.html#line-73\'>Link to Cro
    ssdart</a>'

    package:test                expect
    test\model_test.dart 860:9  main.<fn>.<fn>.<fn>

@astashov
Copy link
Contributor Author

astashov commented Sep 2, 2015

Okay, let me try that.

@astashov astashov force-pushed the add-crossdart-links branch 6 times, most recently from f38ebd1 to 9ffbfef Compare September 3, 2015 14:42
@astashov astashov force-pushed the add-crossdart-links branch 2 times, most recently from f41c916 to 46229a6 Compare September 3, 2015 15:23
@astashov
Copy link
Contributor Author

astashov commented Sep 3, 2015

All green now, PTAL, @sethladd!

@astashov
Copy link
Contributor Author

Ping? :)

@sethladd
Copy link
Contributor

Ack, sorry I missed this. Looks like you need to rebase. And then we'll merge it.

@sethladd
Copy link
Contributor

Friendly ping. Care to rebase this so we can merge? Thanks!

Added them to the _source_code partial, so every time we show the source
code for something, it will have the Crossdart link.

Also, added --add-crossdart cli option.
Unfortunately, I couldn't find any global config entity in DartDoc, and
passing addCrossdart bool through all the code down to SourceCodeMixin
seems to be too dirty and awkward.

So I created the Config class, which for now contains only one field
(addCrossdart), and use that class in SourceCodeMixin to decide whether
I should add crossdart url or not.

The protocol and domain for crossdart link is '//', so it'd match the
currently used protocol.
@astashov
Copy link
Contributor Author

Rebased! Sorry for delay.

sethladd added a commit that referenced this pull request Sep 29, 2015
@sethladd sethladd merged commit 595b7e6 into dart-lang:master Sep 29, 2015
@sethladd
Copy link
Contributor

Super cool, thanks!

This was referenced Sep 29, 2015
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

Successfully merging this pull request may close these issues.

4 participants