airbnb / DeepLinkDispatch

A simple, annotation-based library for making deep link handling better on Android
http://nerds.airbnb.com/deeplinkdispatch/
4.39k stars 406 forks source link

Deep links docs generation #174

Closed ghost closed 7 years ago

ghost commented 7 years ago

1 Added code to generate deep link docs. 1.a unit test? 2 Added gradle task in the sample project to show the usage. 3 Will update README.md accordingly to explain usage when 2 has been finalized.

kxfang commented 7 years ago

Hey, apologies for the misunderstanding -- I'd actually been talking to Jingwei about this change.

The motivation behind #142 is that we have some internal wiki pages meant for consumption by non-engineers that documents which deep links are supported by the app and what each deep link does.

However those pages are always out of date because people forget to update them. Thus we'd like to generate some output files with basic formatting for the documentation, and then we can either:

felipecsl commented 7 years ago

I see, ok that makes more sense now, thanks for clarifying! Do you have an example of how the generated file would look like?

ghost commented 7 years ago

(also added on the review)

The location of the output file is specified in the gradle of the Sample project, currently at ${buildDir}/doc/deeplinks.md. And I think explanation should be added to README.md about this function.

And this is how the output look like now:

CustomPrefixesActivity: https://airbnb.com/users CustomPrefixesActivity: https://airbnb.com/user/{id} CustomPrefixesActivity: library://dld/library_deeplink CustomPrefixesActivity: library://dld/library_deeplink/{lib_id} MainActivity#intentForTaskStackBuilderMethods: http://example.com/deepLink/{id}/{name}/{place} MainActivity#intentForParamDeepLinkMethod: dld://host/somePath/{arbitraryNumber} MainActivity: dld://classDeepLink MainActivity: http://example.com/foo{arg} MainActivity: dld://example.com/deepLink MainActivity#intentForComplexMethod: dld://host/somePathOne/{arbitraryNumber}/otherPath

On the other side, @felipecsl, if it's valuable to add deep link description to the java file, I can add that as well(or in another change)

ghost commented 7 years ago

Synced with @kxfang on the output, there was a miss understanding, his idea was to generate a file with link -> java doc mapping: https://airbnb.com/user/{id} | Takes user to the homepage. | (optional) Class#MethodName

I'll update the change and make another request.

ghost commented 7 years ago

ugh... I missed:

Let's wait to see if Felipe has any feedback before going ahead with any changes though :)

@felipecsl feel free to make comments, I'm open to make more changes.

felipecsl commented 7 years ago

Overall solution looking good, just minor formatting/style etc.

ghost commented 7 years ago

@felipecsl what's the plan to release this change? Then we can pull it and use it.

felipecsl commented 7 years ago

You can use it as version 4.0.0-SNAPSHOT as soon as the Travis build finishes

ghost commented 7 years ago

Hey @felipecsl: what's the plan for 4.0 release? Asking because SNAPSHOTs slow down the building process and it's already super slow for us. No rush though.

felipecsl commented 7 years ago

We don't have specific plans yet. Just curious, why does it slow down the process for you?

ghost commented 7 years ago

Snapshots require a connection to the server and will be refreshed frequently + our project is huge.