ADFA-4739: Pipeline for producing template-based Kotlin documentation#21
ADFA-4739: Pipeline for producing template-based Kotlin documentation#21alexmmiller wants to merge 4 commits into
Conversation
…, generate and add templates to display it to database, optimize and insert Kotlin website media. Script to sync current kotlin-stdlib documentation against a newly-generated documentation set (for now, used to do pruning for ADFA-4737 https://appdevforall.atlassian.net/browse/ADFA-4737)
|
Claude says: Issues found
per ADFA-4737, only the .py files from the original working directory were copied here. templates/ and assets/ ... must be placed alongside these scripts before running populate_db.py. But the PR itself does include templates/{page.peb,nav.peb,nav.html}, assets/{docs.css,tabs.js,sidebar.js}, and config.json (added by the "Config/assets for pipeline test" commit). A reviewer or new user following the README literally would go hunting for files that are already sitting right there. Worth updating that note (or clarifying it only applied to the original copy-over before the pipeline-test commit added them).
python This is clearly a leftover from the author's local machine. It's harmless in that a wrong path just fails the os.path.isfile check, but it shouldn't ship as the default in a shared repo — either make it required (no default) or default to documentation.db in cwd, matching populate_db.py's convention.
python If one rename's new_name happens to equal another rename's old_name (e.g. foo.png → foo.webp from one optimization, and some unrelated foo.webp → foo-2.webp renamed elsewhere), the second substitution could re-match text that the first substitution just wrote, double-rewriting a reference that was never actually pointing at the second file. It's a narrow edge case (requires two renames whose old/new basenames chain), but since build_rename_map only guards against the same old name mapping to two different new names, not this chain scenario, it's worth at least a comment acknowledging the assumption (or building a single combined regex/dict-based single-pass substitution instead of N sequential replaces).
|
- README: templates/assets are already included in the repo, not left for the user to place separately. - sync_kdoc_json_to_db.py: default --db to documentation.db in cwd instead of a personal /home/alex path; add explicit BEGIN to match sibling scripts' transaction style. - insert_optimized_media.py: rewrite_pages now substitutes renamed image references in a single regex pass over each row's original text, instead of sequential str.replace calls on a mutating buffer, which could double-rewrite a reference if one rename's new name chained into another rename's old name. - run_e2e_pipeline_test.sh: add a verification step that reuses populate_db.py's own pruning logic to confirm blacklisted topic pages are actually absent from the database, replacing a weaker proxy check that only tested for k/html/wasm% paths. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
e2e_run_output.log Summary: == Summary == == Blacklist pruning verification == Done. Backups (populate_db.py, insert_optimized_media.py, and sync_kdoc_json_to_db.py |
Summary
An end-to-end pipeline for producing templated Kotlin documentation.
Changes
Kotlin website docs
kotlin-web-site/docs(Writerside Markdown) into JSON, build nav, optimize media, and insert everything intodocumentation.db, intoProcessDocs/ProcessKotlinDocs/ProcessKotlinWebsiteJSON/. Adds a README documenting each script's purpose, required inputs (kr.tree,webHelpImages.zip, config JSON), and end-to-end usage — includingpopulate_db.py --blacklisted-element-titles, the mechanism this ticket needs for pruning docs sections (e.g. Kotlin/Wasm) we don't want to ship.Kotlin-stdlib docs
sync_kdoc_json_to_db.pyscript into a new directoryscripts/sync_kotlin_stdlib_docs/, for syncing generated kotlin-stdlib docs against the database.Test plan for Kotlin website docs:
/home/alex/ADFA/KotlinWebsiteProcess/andDokka-plugin-kdoc2json/scripts/(no edits were made during the copy)populate_db.pywith--blacklisted-element-titlesagainst a scratch database