No description
  • TypeScript 85%
  • JavaScript 14.2%
  • CSS 0.7%
  • Shell 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-30 11:17:04 +02:00
.husky Quality improvements: logo, pre-commit, tests, README, Pages deploy 2026-07-15 20:42:24 +02:00
demo update dependencies 2026-07-30 11:17:04 +02:00
locale translations 2026-07-24 04:27:52 +02:00
scripts update dependencies 2026-07-30 11:17:04 +02:00
src handle missing image id in translation table 2026-07-28 13:46:48 +02:00
static-libs switch to pnpm 2026-07-22 11:15:45 +02:00
test get cslBibSpec from BiblioJSON, drop bibliography manager dependency 2026-07-20 18:04:54 +02:00
.gitignore Add Codeberg Pages demo site 2026-06-27 23:08:12 +02:00
.mathlive_bundle_cache.json feat: re-export mathlive through @fiduswriter/document/mathlive 2026-07-04 22:11:57 +02:00
.prettierignore feat: re-export mathlive through @fiduswriter/document/mathlive 2026-07-04 22:11:57 +02:00
.prettierrc.json Add fwtoolkit lint/format setup 2026-07-02 22:24:51 +02:00
AGENTS.md update AGENTS.md 2026-07-22 13:08:47 +02:00
CHANGELOG.md Fix missing xmlns:wp namespace in exported DOCX 2026-07-03 22:36:52 +02:00
eslint.config.mjs Add fwtoolkit lint/format setup 2026-07-02 22:24:51 +02:00
jest.config.js get cslBibSpec from BiblioJSON, drop bibliography manager dependency 2026-07-20 18:04:54 +02:00
LICENSE first commit 2026-06-24 14:09:12 +02:00
package.json update dependencies 2026-07-30 11:17:04 +02:00
pnpm-lock.yaml translations 2026-07-24 04:27:52 +02:00
pnpm-workspace.yaml translations 2026-07-24 04:27:52 +02:00
README.md 0.1.0 2026-06-28 14:12:14 +02:00
schema.json update styles list 2026-07-18 11:35:29 +02:00
tsconfig.json Phase 2: convert format-specific core converters/renderers to TypeScript 2026-06-27 16:17:15 +02:00

@fiduswriter/document

@fiduswriter/document logo

This package contains the Fidus Writer document schema, importers and exporters.

Demo

Interactive examples running entirely in the browser are available at https://fiduswriter.codeberg.page/fiduswriter-document/

The demo site includes:

  • File converter — export a sample document (with editable JSON and bibliography) to JATS, HTML, LaTeX, Pandoc JSON, EPUB, DOCX, and ODT. DOCX and ODT exports support custom upload templates; built-in "Classic" (DOCX) and "Free" (ODT) templates are provided as defaults.
  • Schema viewer — browse all document nodes, marks, and their allowed content.
  • JATS bibliography generator — fill in a reference and preview the rendered JATS XML.
  • Import preview — drop a native .fidus file and inspect its JSON.

Usage

import {docSchema, FW_DOCUMENT_VERSION} from "@fiduswriter/document/schema"
import {DocxConvert} from "@fiduswriter/document/importer/docx/convert.js"
import {DOCXExporter} from "@fiduswriter/document/exporter/docx/index.js"

TypeScript

The package is fully written in TypeScript. Source files are compiled to dist/ on build and published with matching .d.ts declarations. The public import paths remain unchanged.

Development

npm install
npm run build      # compile TypeScript to dist/
npm run typecheck  # run tsc --noEmit
npm test           # run the Jest test suite
npm run deploy-pages  # build and push the demo site to Codeberg Pages

Dependencies

  • fwtoolkit — shared utilities (text helpers, network helpers, etc.)

Schema JSON

A JSON serialization of the schema is exported as schema.json and regenerated by the prepare / prepublishOnly scripts.

Tests

The test suite includes round-trip tests that import real DOCX files, run them through the exporters, and validate that the generated output files contain the required ZIP entries and well-formed XML.