Skip to content

[Java.Interop.Tools.JavaSource] Add {@ docRoot} support #930

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 1 commit into from
Jan 24, 2022

Conversation

pjcollins
Copy link
Member

@pjcollins pjcollins commented Dec 10, 2021

@pjcollins
Copy link
Member Author

This has generated the following docs diff:
https://gist.github.com/pjcollins/14b246c8c2a97336184d3bb3328c619a

There are still some issues to sort out.

@pjcollins pjcollins changed the title [WIP] @docRoot and @inheritDoc improvements [Java.Interop.Tools.JavaSource] Add {@docRoot} support Jan 4, 2022
@pjcollins pjcollins marked this pull request as ready for review January 21, 2022 21:29
@pjcollins pjcollins requested a review from jonpryor January 21, 2022 21:29
@pjcollins
Copy link
Member Author

Latest docs diff for these changes (as compared to a recent partial update for API 32) - https://gist.github.com/pjcollins/355c3acb20c509c00cfffebe30744082

Partially fixes: dotnet#907

Support for `{@ docRoot}` has been added, and an additional
parser for `<a href/>` elements has been added to convert
these to `<see/>` elements.
@pjcollins pjcollins changed the title [Java.Interop.Tools.JavaSource] Add {@docRoot} support [Java.Interop.Tools.JavaSource] Add {@ docRoot} support Jan 23, 2022
</remarks>
</member>",
IntelliSenseXml = $@"<member>
<param name=""manifest"">The value of the <see href=""{DocRootPrefixExpected}guide/topics/manifest/manifest-element.html#vcode""><c>android:versionCode</c></see> manifest attribute.</param>
Copy link
Contributor

Choose a reason for hiding this comment

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

<see href="…"/> is a valid construct? I wonder when that happened…

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it happened in 2017. Now I feel old. mono/api-doc-tools@fb07047

@jonpryor
Copy link
Contributor

jonpryor commented Jan 24, 2022

WIP commit message:

Partially fixes: https://github.com/xamarin/java.interop/issues/907

Context: https://docs.microsoft.com/en-us/dotnet/api/android.app.backup.backupagent.onrestore?view=xamarin-android-sdk-12#Android_App_Backup_BackupAgent_OnRestore_Android_App_Backup_BackupDataInput_System_Int64_Android_OS_ParcelFileDescriptor_
Context: https://docs.microsoft.com/en-us/dotnet/api/android.animation.animatorlisteneradapter.onanimationend?view=xamarin-android-sdk-12#definition

Original support for the [`{@docRoot}` inline Javadoc tag][0] in
commit 7574f166 was a "TODO"; `{@docRoot}` would expand to
`[TODO: @docRoot]`, resulting in documentation containing such
monstrosities as:

> The value of the
> <a href="[TODO: @docRoot]guide/topics/manifest/manifest-element.html#vcode">android:versionCode</a>
> manifest attribute…

Add support for the `{@docRoot}` inline tag, along with grammar
support for `<a href="…">…</a>` elements.  This allows:

	<a href="{@docRoot}/example/path">description</a>

to be converted into:

	<see href="http://example.com/example/path">description</see>

The value of `{@docRoot}` is expanded into
`XmldocSettings.DocRootValue`, which comes from the
`/api/javadoc-metadata/link/@docroot` element in "Javadoc XML"
created by `java-source-utils.jar` (7574f166), via the new
`java-source-utils.jar --doc-root-url URL` option:

	java -jar java-source-utils.jar \
	  --doc-root-url https://developer.android.com/ \
	  --doc-url-prefix https://developer.android.com/reference \
	  --doc-url-style developer.android.com/reference@2020-Nov \
	

TODO: Update the [`@(JavaSourceJar)` Build action][1] so that e.g.
`%(JavaSourceJar.DocRootUrl)` item metadata will be used as the
`java-source-utils.jar --doc-root-url` value.

[0]: https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#docRoot
[1]: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-items#javasourcejar

@jonpryor jonpryor merged commit 13def0e into dotnet:main Jan 24, 2022
@pjcollins pjcollins deleted the convert-html branch January 31, 2022 15:30
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Java.Interop.Tools.JavaSource] Don't emit [TODO: * ] in summaries
2 participants