跳到正文
DEV Community· 王瑞·· 2 小時前AI 評分21

將 LeonidaRides 路線 JSON 匯出檔轉成離線 Markdown 清單

Turning a route JSON export into an offline Markdown checklist

AI 導讀

LeonidaRides 的 Python 工具可將路線 JSON 匯出檔離線轉成 Markdown 清單,供用戶在關閉地圖後閲讀;工具要求 Python 3.10 或以上,只使用標準程式庫。它接受 version 1 路線匯出檔及舊版 atlas wrapper,最多處理 40 個不重複停靠點、20 項前置條件和 30 個 HTTPS 參考連結,並拒絕完整工作區備份及格式錯誤資料。

正文

I wanted a route plan I could read after closing the map. That led to a small export utility for LeonidaRides, the independent GTA 6 planning site I’m building. The atlas, stop list and JSON export are free.

The Python companion and tests are public on GitHub. It converts one exported route into Markdown, entirely offline. It needs Python 3.10 or later and uses only the standard library.

Start with a narrow contract

A route export is a reading plan, not a game save. Its useful fields are small: a title, ordered point IDs, notes, prerequisites, a precision note and a finish check.

Here is a deliberately synthetic example:

{
  "format": "leonidarides-route",
  "version": 1,
  "route": {
    "title": "A short planning session",
    "stops": [
      {"pointId": "L7", "note": "Check access first"},
      {"pointId": "L2", "note": "Record what changed"}
    ],
    "finishCheck": "Keep the original JSON backup"
  }
}

The IDs in that example are placeholders, not recommended gameplay locations. Real exports contain the IDs of the stops you selected. The helper does not download a map database to turn those IDs into names.

Run:

python3 route_notes.py my-exported-route.json > my-session-checklist.md

The resulting checklist keeps the saved order:

# A short planning session

> Community waypoints. Check roads and access in-game. This list does not calculate driving directions or travel times.

## Stops in your saved order

1. [ ] `L7` — Check access first
2. [ ] `L2` — Record what changed

## Finish check

- [ ] Keep the original JSON backup

Open it in a text editor or Obsidian. There is no plugin to install. The Markdown file is a reading copy: checking a box does not sync back to the site, and it cannot be imported as a route. Keep the original JSON for that.

Validate before rendering

The converter accepts a version 1 route export and the earlier atlas wrapper with kind: "route". It rejects full workspace backups. Silently choosing one route from a larger backup would be an easy way to lose context.

The limits match the current route model: up to 40 unique stops, 20 prerequisites and 30 HTTPS references. Input reads stop at 2 MB. Unknown versions and malformed fields produce an error with exit code 2 instead of partial Markdown.

These checks are deliberately independent of live location lookup. The tool checks point-ID syntax and duplicates, but cannot prove that a location exists or is reachable. That remains a separate job for the atlas and the source references.

Treat notes as text

A note may contain brackets, HTML or a line beginning with a Markdown heading. Those should remain the person’s note, rather than turning into an embedded image or a different section of the document.

The renderer escapes HTML and Markdown punctuation and indents continuation lines. It never executes imported content, opens a source link or sends the file over the network. Source URLs with credentials are rejected. This is still your private text: review it before sharing the resulting file.

The repository includes ten tests covering saved order, an empty route, literal notes, the legacy wrapper, duplicate IDs, long notes, unsupported versions, workspace rejection, credential-bearing URLs and the finish/prerequisite sections:

python3 -m unittest discover -v

A separate output can be useful without pretending to be a backup

JSON serves restoration. Markdown serves reading and taking a plan into another tool. Keeping those jobs explicit made the utility easier to explain and test. It also avoided accounts, remote processing and a dependency chain for a task that can be done locally.

You can try the included synthetic file before using your own export. If you report an input-format issue, send a small redacted example rather than a recovery key or private account data.

Disclosure: I’m the maker of LeonidaRides. This article and the companion were prepared with AI assistance, then checked against the current export schema and runnable tests. This is independent planning software, with no Rockstar affiliation or game-save connection.

來源:DEV Community · dev.to