No description
  • Rust 92.5%
  • PowerShell 7.5%
Find a file
ulysia 3b3fdfae9f Add Content Script (43200) export
Content Scripts render to <name>.ContentScript.md with the Groovy body in a
```groovy block. From extendeddata: scheduling becomes a Setting/Value table,
and the staticVars source (a json(...) block) is unwrapped into a ```json
block. The XMLexport URL now uses versioninfo=current.
2026-06-26 17:51:24 +02:00
.github/workflows Remove Python and Go; promote Rust to repo root 2026-06-15 09:26:18 +02:00
src Add Content Script (43200) export 2026-06-26 17:51:24 +02:00
.gitignore Remove Python and Go; promote Rust to repo root 2026-06-15 09:26:18 +02:00
build.rs Remove Python and Go; promote Rust to repo root 2026-06-15 09:26:18 +02:00
Cargo.lock Remove Python and Go; promote Rust to repo root 2026-06-15 09:26:18 +02:00
Cargo.toml Remove Python and Go; promote Rust to repo root 2026-06-15 09:26:18 +02:00
download_xml.ps1 Add version stamping, config.yml, packaging and release CI 2026-06-11 12:29:59 +02:00
README.md Remove Python and Go; promote Rust to repo root 2026-06-15 09:26:18 +02:00
sample.config.yml Add version stamping, config.yml, packaging and release CI 2026-06-11 12:29:59 +02:00
sample.env Add version stamping, config.yml, packaging and release CI 2026-06-11 12:29:59 +02:00

OpenText Content Server → Markdown export

Exports OpenText Content Server WebReports (subtype 30303) and LiveReports (subtype 299) to Markdown, preserving the folder tree, the report SQL / HTML body, inputs, params and constants, and cross-linking related reports with Obsidian-style wikilinks.

It reads an OTCS XMLexport of a folder (which returns the whole subtree in a single call) and renders one .md per report.

Install

Grab a prebuilt binary from the Releases page, or build from source with a Rust toolchain:

cargo build --release
./target/release/otcs-export        # otcs-export.exe on Windows

The result is a single self-contained binary (~1.6 MB) with no runtime dependencies. It reads config.yml / .env from the current working directory.

To bake the commit/branch into the version footer (otherwise it falls back to live git, or to the bare semver outside a checkout):

OTCS_GIT_COMMIT=$(git rev-parse HEAD) \
OTCS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) \
  cargo build --release

The semver is VERSION in src/buildinfo.rs.

Note: LiveReport SQL is reformatted with the sqlformat crate; %N parameter tokens are preserved.

Configure

Configuration comes from (highest precedence first):

  1. Environment variables — OTCS_BASE_URL, OTCS_COOKIE, INPUTS, OUT_DIR.
  2. config.yml (preferred — supports comments). Copy sample.config.yml.
  3. .env. Copy sample.env.
config.yml .env / env var meaning
otcs_base_url OTCS_BASE_URL cs.exe endpoint root
otcs_cookie OTCS_COOKIE LLCookie value or full Cookie header
inputs INPUTS node IDs and/or local:// paths (YAML list or CSV)
out_dir OUT_DIR output directory (per-input subfolder <id>/)

Inputs

Each input is either a numeric OTCS node id (fetched live) or a local:// path read from disk:

local://./file.xml      single file (relative)
local:///abs/file.xml   single file (absolute)
local://./input         every *.xml in a folder

Output for each input is written to out_dir/<id>/, mirroring the OTCS folder structure beneath it.

Downloading XML separately

download_xml.ps1 fetches the XMLexport for every numeric id in your config and writes ./xml/<id>.xml, so you can then point inputs at local://./xml. It reads the same config.yml / .env.

pwsh ./download_xml.ps1

Auth note

The OTCS REST API accepts the OTCSTicket header, but classic cs.exe?func=ll URLs (used by XMLexport) need the session cookie on OTDS-protected instances. Copy the LLCookie value (or the full Cookie header) from a logged-in browser session into otcs_cookie / OTCS_COOKIE.

Versioning

VERSION in src/buildinfo.rs holds the semver. Bump it and tag the commit vX.Y.Z; CI verifies the tag matches, bakes the commit/branch into the binary, and publishes a release with Linux and Windows binaries. Every exported file carries a footer with the exact semver-[commit (branch)](link) that produced it.