Skip to content

Improve docs UX: homepage redesign, navigation, and per-page actions#316

Open
King31T wants to merge 8 commits intotronprotocol:masterfrom
King31T:ai_friendly
Open

Improve docs UX: homepage redesign, navigation, and per-page actions#316
King31T wants to merge 8 commits intotronprotocol:masterfrom
King31T:ai_friendly

Conversation

@King31T
Copy link
Copy Markdown
Contributor

@King31T King31T commented May 4, 2026

Summary

  • Redesign the homepage with role-based entry cards and a topic index (docs/index.md).
  • Enable several Material theme UX improvements: code block copy button, search share button, navigation.indexes (section index.md as landing page), per-page "last updated" date, Chinese UI strings, and per-page "edit this page / view source" actions.
  • Fix an unterminated @media block in extra.css; restore the right-side TOC by disabling toc.integrate.
  • Update gh-pages.yml for the new build requirements.

Commits

  • Enable navigation.indexes for section index pages
  • Redesign homepage with role-based entry cards and topic index
  • Add share button to search box
  • Enable copy button on code blocks
  • Show per-page last-updated date and switch UI strings to Chinese
  • Close unterminated @media block in extra.css
  • Restore right-side TOC by disabling toc.integrate
  • Add edit_uri and enable per-page edit/view source actions

Test plan

  • Run mkdocs serve locally and confirm the homepage, role cards, and topic index render correctly.
  • Verify the code block copy button works and the search share button copies a URL with the query string.
  • Confirm second-level sections that contain index.md behave as expected with navigation.indexes enabled.
  • Each page shows a last-updated date and the UI strings appear in Chinese.
  • "Edit this page / view source" links point to the correct repo paths.
  • Right-side TOC scroll-tracking and highlight work as expected.
  • CI / gh-pages deployment succeeds.

abn2357 added 8 commits May 4, 2026 11:38
Set edit_uri to edit/master/docs/ and add repo_name so Material renders
the top-bar repository link with a friendly label. Enable
content.action.edit and content.action.view to expose pencil and eye
icons on every page, letting readers jump directly to the source on
GitHub or open it in the web editor.
Comment out toc.integrate so the table of contents returns to its own
right-hand sidebar, freeing the left sidebar to carry only site
navigation. Add navigation.tracking and toc.follow so the URL anchor
and the right-side TOC stay in sync with the current section while
scrolling, which matters most on long API pages such as
docs/api/json-rpc.md and docs/api/http.md.

Custom scripts (toc.js, nav-toc.js) and related styles are left in
place; their cleanup will be evaluated in a follow-up.
The mobile footer override at the bottom of docs/stylesheets/extra.css
opened a @media screen and (max-width: 44.984375em) block but never
closed it. Browsers were lenient enough to render the page correctly,
but any rule appended after this point would silently fall inside the
media query and only apply on narrow viewports. Add the missing brace
so future additions behave as expected.
Add mkdocs-git-revision-date-localized to surface a clock icon and
localized date at the bottom of every page, so readers can tell whether
content describes an older java-tron release or a current one. Switch
theme.language to zh so Material's surrounding labels render in
Chinese as well: the timestamp tooltip becomes 最后更新, prev/next
captions become 上一页/下一页, the search placeholder becomes 搜索, and
the edit/view-source action tooltips are translated.

Update the GitHub Pages workflow to fetch the full git history; without
fetch-depth: 0 the plugin would resolve every page's mtime to the build
moment instead of the file's last commit. Pin the plugin to 1.5.1 to
match the project's convention of explicit version pins.
Add content.code.copy to the Material features list so every code block
gets a clipboard icon in the top-right corner. The site is dominated by
HTTP, gRPC, and JSON-RPC request samples; a copy button removes the
fiddly manual-select step readers face today on long curl payloads.
The button tooltip and copied confirmation render in Chinese
automatically thanks to the language: zh setting added earlier.
Enable search.share so the search dialog renders a share icon next to
the query input. Clicking it copies the current page URL with the
active query appended as ?q=..., which makes it easier to send a
teammate a link that opens directly on a specific search result.
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.

2 participants