Repository navigation
docs: compile the code samples and publish the API reference - #2521
Open
mykola-mokhnach wants to merge 2 commits into
Open
mykola-mokhnach wants to merge 2 commits into
mykola-mokhnach wants to merge 2 commits into
Conversation
- docs-snippets subproject with compile-only samples, included into the pages with pymdownx.snippets; selenium-bridge.md and The-event_firing.md converted - fix the event firing page where it differed from the code (stale examples, decorator failure mode, AppiumWebElement, selenium-support requirement) - docsApi: merged Javadoc of core and selenium-bridge generated into docs/api and linked from the nav, so every docs version has its own API reference - docsCheckApiLinks and docsCheckInlineCode checks; legacy pages with inline Java are allow-listed until they are rewritten - docs workflow also runs on docs-snippets changes
mykola-mokhnach
requested review from
SrinivasanTarget,
saikrishna321 and
valfirst
as code owners
December 4, 2026 07:07
eglitise
reviewed
Dec 4, 2026
eglitise
reviewed
Dec 4, 2026
|
|
||
| `./gradlew docsApi` generates the merged Javadoc of the published modules into `docs/api` (not committed); the site | ||
| build and `docsServe` run it first, so every docs version contains the Javadoc of its own code. Link to it with a | ||
| relative URL, for example ``[`AppiumDriver`](api/io/appium/java_client/AppiumDriver.html)``. `docsCheck` fails if |
Contributor
There was a problem hiding this comment.
I wonder if these links should lead to HTML. Zensical recommends linking to the Markdown file (https://zensical.org/docs/authoring/markdown/#linking-between-pages) though I'm not sure such files would exist for the API.
Contributor
Author
There was a problem hiding this comment.
The Javadoc is generated HTML (docs/api is built by docsApi and git-ignored), so there are no Markdown sources to link to. The Markdown-link recommendation only applies between Markdown pages, and strict mode would not resolve .md targets for the API. That is why docsCheckApiLinks validates these .html links against the generated tree instead. Keeping them as relative .html links.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of the documentation plan: code samples that are compiled, and an API reference published with every docs version.
Compiled code samples
docs-snippetsGradle subproject with compile-only samples (depends on core,selenium-bridgeandselenium-support). Pages include them with--8<-- "File.java:section"(pymdownx.snippets; markers and indentation are stripped). A missing section fails the site build, and the main./gradlew buildcompiles the samples, so an API change that breaks an example fails the PR that made it.selenium-bridge.md(3 blocks) andThe-event_firing.md(4 blocks) are converted. The other pages still have inline blocks that are mostly stale (see the inventory); they are converted when they are rewritten.IOSDriver<?>(the class is no longer generic) andelement::click;(not valid Java);ClassCastException: withIOSDriver.classpassed it fails withAssertionError: Unable to create new proxy; the cast failure is what happens without the class argument, so the sample and the explanation are fixed accordingly;ElementAwareWebDriverListenerwrapsAppiumWebElement, notRemoteWebElement;EventFiringDecoratorneedsselenium-support.API reference
docsApigenerates one merged Javadoc (core +selenium-bridge; list inapiModules) into the git-ignoreddocs/api, and the nav links to it. It runs before the site build anddocsDeploy, so each docs version carries the Javadoc of its own code.-notimestampkeeps thedocs-sitehistory small.docsCheckApiLinkschecks theapi/...links in the pages itself.Guard
docsCheckInlineCodefails if a page outsidegradle/docs-legacy-inline-code.txthas a new multi-linejavablock that is not an include. The four pages that still have inline Java are on the list and leave it when they are rewritten.docs/Note-for-developers.md; the Docs workflow also runs ondocs-snippets/**.Notes
devdocs are published when docs files change, not on everysrc/mainchange, so thedevAPI reference can lag behind master until the next docs change or release.Testing
./gradlew docsCheckfrom a clean state (nodocs/api, nobuild/docs-site): green in about 6 seconds.ClassCastExceptionbehavior by running the sample against the current Selenium.