Skip to content

Export routeros-docs-links.json as a CI artifact for LSP consumersΒ #4

@mobileskyfi

Description

@mobileskyfi

Feature: Lightweight docs-link export for downstream tools

Found during lsp-routeros-ts rosetta alignment research β€” see docs/rosetta-alignment.md.

Problem

lsp-routeros-ts (and other tools) want to show πŸ“š [Documentation](url) links in hover tooltips and textDocument/documentLink responses. The full 200 MB ros-help.db is too large to bundle, and the MCP server is too heavy as a runtime dependency.

Proposed solution

Build and publish a routeros-docs-links.json file as a GitHub Release asset in CI (release.yml). Approximate size: ~551 dir-type commands Γ— ~120 bytes β‰ˆ 15 KB gzipped.

Schema:

[
  {
    "path": "/ip/firewall/filter",
    "url": "https://help.mikrotik.com/docs/spaces/ROS/pages/328229/Filter",
    "title": "Filter",
    "description": null
  }
]

SQL to generate it:

SELECT c.path, c.description, p.title, p.url
FROM commands c
JOIN pages p ON p.id = c.page_id
WHERE c.type = 'dir'
ORDER BY c.path;

Related: add command_path to properties table

While at it, denormalizing a command_path column onto the properties table would make property-by-path lookups O(1) instead of a two-hop join β€” useful for hover arg descriptions.

ALTER TABLE properties ADD COLUMN command_path TEXT;
UPDATE properties p SET command_path = c.path
FROM commands c WHERE c.page_id = p.page_id AND c.type = 'dir';

Consumers

  • lsp-routeros-ts: hover doc links, textDocument/documentLink provider
  • tikbook: could surface doc links in notebook cell context
  • Any tool that wants to map a RouterOS path to its help URL without loading the full DB

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions