Skip to content

Merge upstream and sync multi-language documentation#5

Merged
RainPPR merged 3 commits into
mainfrom
merge-upstream-and-sync-docs-12394254122672464635
Jul 2, 2026
Merged

Merge upstream and sync multi-language documentation#5
RainPPR merged 3 commits into
mainfrom
merge-upstream-and-sync-docs-12394254122672464635

Conversation

@RainPPR

@RainPPR RainPPR commented Jul 2, 2026

Copy link
Copy Markdown
Member

This PR merges the latest changes from the upstream repository jaywhj/mkdocs-document-dates into our branch. It resolves several merge conflicts in the core logic and project configuration while ensuring our custom improvements (like timezone normalization and HTML escaping) are preserved. Additionally, it synchronizes the documentation assets and files from upstream and organizes them into a multi-language setup with a landing page, avoiding direct conflicts in the future.


PR created automatically by Jules for task 12394254122672464635 started by @RainPPR


Summary by cubic

Merged upstream v3.8.7 of mkdocs-document-dates, added bilingual docs with a language landing page, and kept our timezone normalization and HTML escaping. Also removed legacy tooling and updated the mkdocs pin.

  • New Features

    • English and Chinese docs with a language landing page (docs/index.md); nav updated in properdocs.yml.
    • Moved demo GIFs to docs/assets/* and fixed README image paths.
    • Added docs/schema.json for config schema/validation.
  • Dependencies

    • Pinned mkdocs to >=1.6,<2.
    • Dropped legacy setup.py (use pyproject.toml only).
    • Removed verify_docs.py Playwright smoke test.

Written for commit fc3f621. Summary will update on new commits.

Review in cubic

- Merged upstream 'jaywhj/mkdocs-document-dates' (v3.8.7)
- Resolved conflicts in pyproject.toml, plugin.py, and utils.py
- Preserved local timezone handling and HTML escaping logic
- Synced English and Chinese documentation from upstream
- Configured a documentation landing page in docs/index.md
- Updated properdocs.yml with the new documentation structure
- Verified changes with unit tests and documentation builds

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds comprehensive English and Chinese documentation, a JSON schema, and verification scripts for the mkdocs-document-dates plugin, alongside a legacy setup.py script. The review feedback highlights critical alignment issues between setup.py and pyproject.toml regarding dependencies and Python version requirements. Additionally, it identifies a bug in the Playwright verification script that masks failures in CI/CD pipelines, and points out broken anchor links in the English documentation due to uppercase headers.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread setup.py Outdated
Comment on lines +17 to +21
install_requires=[
"mkdocs>=1.6,<=1.6.1",
"properdocs>=1.6.5",
"babel>=2.16"
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

There is a significant discrepancy between the dependencies specified in setup.py and pyproject.toml:

  1. pyyaml>=6.0 is required by the plugin (imported in plugin.py) and listed in pyproject.toml, but is completely missing from setup.py's install_requires.
  2. properdocs is listed as a required dependency in setup.py, but is only an optional (docs) dependency in pyproject.toml.
  3. mkdocs is restricted to <=1.6.1 in setup.py, but allowed up to <2 in pyproject.toml.

Please align the dependencies in setup.py with those in pyproject.toml to ensure consistent installation environments and prevent runtime ImportErrors.

Suggested change
install_requires=[
"mkdocs>=1.6,<=1.6.1",
"properdocs>=1.6.5",
"babel>=2.16"
],
install_requires=[
"mkdocs>=1.6,<2",
"pyyaml>=6.0",
"babel>=2.16"
],

Comment thread setup.py Outdated
"static/config/*"
],
},
python_requires=">=3.7",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There is a discrepancy in the minimum Python version requirement: pyproject.toml specifies requires-python = ">=3.9", while setup.py specifies python_requires=">=3.7".

Please align setup.py to require >=3.9 to match pyproject.toml and prevent installation on unsupported Python versions.

Suggested change
python_requires=">=3.7",
python_requires=">=3.9",

Comment thread verify_docs.py Outdated
Comment on lines +23 to +24
except Exception as e:
print(f"Error: {e}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The script catches all exceptions, prints them, and then exits normally (with exit code 0). In CI/CD pipelines or automated verification steps, this will cause the step to report success even if the verification failed.

Please re-raise the exception in the except block so that failures are correctly detected by automated workflows.

Suggested change
except Exception as e:
print(f"Error: {e}")
except Exception as e:
print(f"Error: {e}")
raise

Comment thread docs/document-dates-en.md

#### Customization

Customizable via `avatar` field in [Enhanced author configuration](#Enhanced-author-configuration) (supports URL paths and local file paths).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The anchor link [Enhanced author configuration](#Enhanced-author-configuration) uses uppercase letters. Standard Markdown parsers (including Python-Markdown used by MkDocs) slugify headers to lowercase (e.g., #enhanced-author-configuration). This will result in a broken link when rendered.

Please update the anchor to lowercase.

Suggested change
Customizable via `avatar` field in [Enhanced author configuration](#Enhanced-author-configuration) (supports URL paths and local file paths).
Customizable via `avatar` field in [Enhanced author configuration](#enhanced-author-configuration) (supports URL paths and local file paths).

Comment thread docs/document-dates-en.md
...
```

Refer to [Reading Time Estimation](#Reading-Time-Estimation) for reading time calculation rules.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The anchor link [Reading Time Estimation](#Reading-Time-Estimation) uses uppercase letters. Standard Markdown parsers slugify headers to lowercase (e.g., #reading-time-estimation). This will result in a broken link when rendered.

Please update the anchor to lowercase.

Suggested change
Refer to [Reading Time Estimation](#Reading-Time-Estimation) for reading time calculation rules.
Refer to [Reading Time Estimation](#reading-time-estimation) for reading time calculation rules.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Merge upstream v3.8.7 and reorganize multilingual documentation

📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Reorganize docs into English/Chinese pages with a language landing page.
• Sync upstream documentation content/assets and update README image references.
• Add packaging and docs tooling (legacy setup.py, schema, Playwright verification).
Diagram

graph TD
  R["Repository"] --> D["properdocs.yml nav"] --> B["Docs build (ProperDocs/MkDocs)"] --> I["docs/index.md"] --> L["Language docs (en/zh)"]
  R --> M["README / README_zh"] --> L
  R --> P["Packaging metadata"] --> X{{"Build / Publish"}}
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Adopt MkDocs i18n (static-i18n) layout
  • ➕ Scales to more languages with less manual linking
  • ➕ Standardized URL structure (e.g., /en/, /zh/) and nav per locale
  • ➕ Reduces risk of divergence between languages via shared structure
  • ➖ Requires introducing and configuring an additional plugin
  • ➖ May force docs directory restructuring (en/ and zh/ trees)
2. Keep upstream docs synced via subtree/submodule
  • ➕ Clear separation between upstream docs and local customizations
  • ➕ Simplifies future upstream pulls and conflict resolution
  • ➖ More operational overhead (subtree updates, submodule workflows)
  • ➖ Harder to integrate small local doc tweaks directly
3. Single-source docs with translation overlays
  • ➕ Minimizes duplication of shared sections
  • ➕ Encourages consistent updates across languages
  • ➖ Requires a translation workflow/tooling
  • ➖ Harder to review if translations are generated/managed outside Git

Recommendation: The current approach (explicit en/zh pages + a landing page + updated nav) is a pragmatic, low-dependency way to prevent future merge conflicts while keeping docs discoverable. If the project expects additional locales or frequent doc churn, consider migrating to a standard MkDocs i18n plugin to reduce manual cross-linking and duplication.

Files changed (10) +1703 / -17

Tests (1) +28 / -0
verify_docs.pyAdd Playwright script to screenshot-verify docs pages +28/-0

Add Playwright script to screenshot-verify docs pages

• Adds an async Playwright-based script that opens the locally served docs site, navigates to English/Chinese pages, and captures screenshots. Useful as a lightweight manual/CI sanity check for the multilingual documentation navigation.

verify_docs.py

Documentation (6) +1620 / -16
README.mdPoint README images at docs/assets +2/-2

Point README images at docs/assets

• Updates embedded image links to reference the synchronized GIFs under docs/assets. Keeps the README aligned with the new documentation asset layout.

README.md

README_zh.mdPoint Chinese README images at docs/assets +2/-2

Point Chinese README images at docs/assets

• Updates embedded image links to reference the synchronized GIFs under docs/assets. Mirrors the English README asset path change for consistency.

README_zh.md

document-dates-en.mdAdd full English documentation page +684/-0

Add full English documentation page

• Introduces the upstream-synced English documentation content, including configuration, feature explanations, and developer API references. Uses local assets paths for images and embeds mermaid diagrams describing metadata loading order.

docs/document-dates-en.md

document-dates-zh.mdAdd full Chinese documentation page +683/-0

Add full Chinese documentation page

• Introduces the upstream-synced Simplified Chinese documentation equivalent to the English page. Includes the same major sections (configuration, loading order, APIs) localized for Chinese readers.

docs/document-dates-zh.md

index.mdConvert docs index into language selector landing page +4/-12

Convert docs index into language selector landing page

• Replaces the previous feature/usage stub with a short landing page that links to English and Chinese documentation pages. Establishes a stable entrypoint for multilingual docs navigation.

docs/index.md

schema.jsonAdd JSON schema for document-dates plugin configuration +245/-0

Add JSON schema for document-dates plugin configuration

• Adds a JSON Schema describing plugin configuration keys (type/locale/date formats/toggles/readtime/recently-updated). Intended to support validation and better editor/docs tooling for configuration.

docs/schema.json

Other (3) +55 / -1
properdocs.ymlAdd multilingual docs pages to ProperDocs navigation +2/-0

Add multilingual docs pages to ProperDocs navigation

• Extends the nav to include explicit links to English and Chinese documentation pages. Ensures the docs site sidebar exposes both locales from the landing page and nav.

properdocs.yml

pyproject.tomlNormalize dependency list formatting +1/-1

Normalize dependency list formatting

• Adjusts formatting of the mkdocs dependency line (comma normalization) to match upstream/project style expectations. No functional dependency change implied.

pyproject.toml

setup.pyAdd legacy setuptools fallback setup.py +52/-0

Add legacy setuptools fallback setup.py

• Adds a setup.py that first attempts PEP-517/pyproject-based setup, then falls back to a legacy setuptools configuration if needed. Defines entry points and package data patterns for plugin assets and hook installer scripts.

setup.py

@qodo-code-review

qodo-code-review Bot commented Jul 2, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Legacy setup deps diverge ✓ Resolved 🐞 Bug ≡ Correctness
Description
setup.py’s legacy_setup() declares a different set of runtime dependencies than pyproject.toml
and the actual package imports (notably missing pyyaml while importing yaml, and making
properdocs mandatory). If the fallback path is used, installs can succeed with an
incomplete/incorrect environment and then fail at runtime or force unnecessary constraints.
Code

setup.py[R17-21]

+        install_requires=[
+            "mkdocs>=1.6,<=1.6.1",
+            "properdocs>=1.6.5",
+            "babel>=2.16"
+        ],
Evidence
The fallback dependency list in setup.py differs from the declared project dependencies and omits
a library the code imports at module import time (yaml), which can cause runtime failures if the
fallback path is used.

setup.py[17-46]
pyproject.toml[5-27]
mkdocs_document_dates/plugin.py[1-14]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`setup.py` contains a `legacy_setup()` fallback with dependency/version metadata that does not match `pyproject.toml` or runtime imports.

## Issue Context
- The repo’s canonical metadata is in `pyproject.toml` (PEP 621).
- `legacy_setup()` is intended as a fallback, but currently:
 - Omits `pyyaml` even though the package imports `yaml`.
 - Pins `mkdocs` to `<=1.6.1` (more restrictive than `mkdocs>=1.6,<2`).
 - Makes `properdocs` a hard runtime dependency even though it’s an optional docs extra in `pyproject.toml`.
 - Uses a different `python_requires` than `pyproject.toml`.

## Fix Focus Areas
- setup.py[4-46]
- setup.py[49-52]
- pyproject.toml[5-27]

### What to change
- Prefer removing the legacy fallback entirely (recommended) and rely on `pyproject.toml` + `setuptools.build_meta`.
- If you must keep `legacy_setup()`, make it match `pyproject.toml`:
 - Add `pyyaml>=6.0`.
 - Change `mkdocs>=1.6,<=1.6.1` to `mkdocs>=1.6,<2`.
 - Remove `properdocs` from mandatory `install_requires` (keep it as an optional/docs extra only).
 - Set `python_requires` to `>=3.9` to match `pyproject.toml`.
- Narrow the `try/except` around `setup()` (or avoid it), so real packaging errors aren’t silently converted into a different dependency set.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Brittle .html language links 🐞 Bug ⚙ Maintainability
Description
The new bilingual docs hardcode cross-language links to document-dates-*.html, while the site nav
and sources are .md. This is fragile across different URL output modes and can produce broken
cross-language navigation in the generated site.
Code

docs/document-dates-en.md[R7-9]

+<p align="center">
+English | <a href="document-dates-zh.html">简体中文</a>
+</p>
Evidence
The docs pages explicitly link to .html, while the documentation configuration registers the pages
by their .md sources; this mismatch is a common cause of broken intra-site links when URL
rewriting/directory URLs are enabled.

docs/document-dates-en.md[7-13]
docs/document-dates-zh.md[7-13]
properdocs.yml[12-15]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Docs pages hardcode `.html` cross-language links, which can break depending on the site’s URL mode.

## Issue Context
The nav is configured with markdown sources, so it’s safer to link using markdown-to-markdown links that the site builder can rewrite.

## Fix Focus Areas
- docs/document-dates-en.md[7-9]
- docs/document-dates-zh.md[7-9]

### What to change
- Replace the raw HTML `.html` links with markdown links to the `.md` pages, e.g.:
 - In `document-dates-en.md`: `English | [简体中文](document-dates-zh.md)`
 - In `document-dates-zh.md`: `[English](document-dates-en.md) | 简体中文`
- Alternatively, use site-relative links consistent with your chosen URL mode, but avoid hardcoding `.html` unless the build is explicitly configured to output flat `.html` files.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread setup.py Outdated
Comment thread docs/document-dates-en.md
Comment on lines +7 to +9
<p align="center">
English | <a href="document-dates-zh.html">简体中文</a>
</p>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. Brittle .html language links 🐞 Bug ⚙ Maintainability

The new bilingual docs hardcode cross-language links to document-dates-*.html, while the site nav
and sources are .md. This is fragile across different URL output modes and can produce broken
cross-language navigation in the generated site.
Agent Prompt
## Issue description
Docs pages hardcode `.html` cross-language links, which can break depending on the site’s URL mode.

## Issue Context
The nav is configured with markdown sources, so it’s safer to link using markdown-to-markdown links that the site builder can rewrite.

## Fix Focus Areas
- docs/document-dates-en.md[7-9]
- docs/document-dates-zh.md[7-9]

### What to change
- Replace the raw HTML `.html` links with markdown links to the `.md` pages, e.g.:
  - In `document-dates-en.md`: `English | [简体中文](document-dates-zh.md)`
  - In `document-dates-zh.md`: `[English](document-dates-en.md) | 简体中文`
- Alternatively, use site-relative links consistent with your chosen URL mode, but avoid hardcoding `.html` unless the build is explicitly configured to output flat `.html` files.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@RainPPR RainPPR merged commit 97f3e36 into main Jul 2, 2026
11 of 12 checks passed
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.

1 participant