Each format page now has the one structure: What it is, Read more (with the Wikipedia page of the tool or format), How to use it (the import and export steps and the REST API as its subsections), How the numbers are calculated (the format's own limits and the limits every import has), How it works in WeKan (the import method, the export routes, the format's own code and tests, then the format details) and Commits. The import path is All Boards / Add Board / Import / Import board, as the code draws it; dead links are replaced or unlinked. Thanks to xet7 !
9.8 KiB
HTML
What it is
WeKan exports a board as an HTML archive: a .zip with a web page of the
board as it is shown on the screen, the files the page needs to open without
the WeKan server, and the board's WeKan JSON export. The page can be opened
in any web browser, offline, to read the board. HTML is export only.
Read more
- Wikipedia: HTML, the markup language
- HTML Living Standard: the page format
- File System Access API,
showSaveFilePicker: how the browser asks where to save the archive
See also: format coverage, all formats.
How to use it
Each task has its own steps below: importing one board, importing many boards at once, exporting one board, exporting all boards at once, and the same from a script through the REST API.
How to import
There is no HTML import. The web page is a picture of the board made of the
screen's HTML, not a data format, so WeKan does not read it back. The archive
also holds the board's WeKan JSON export, under data/; that file can be
imported with All Boards → Add Board → Import → Import board → WeKan (see
WeKan JSON).
How to import many boards at once
There is nothing to import: HTML has no import.
How to export
- In WeKan, open the board, and show it the way you want it in the page: the view, filters and collapsed lists are taken as they are on the screen.
- Open Board Settings → Export. The HTML entry is offered only for a whole board, not for a swimlane, list or card.
- Choose HTML. WeKan first draws every card of every list (the board
normally draws only the cards near the screen), then builds the archive in
the browser. In a browser that supports it, you are asked where to save
the
.zip; otherwise it downloads. - Unzip the archive and open
index.htmlin a web browser.
How to export all boards at once
This is not available for HTML. The archive is a document of one board, made from the board on the screen, so Export all boards does not offer it. Export each board from its own menu, or use Export all boards with WeKan JSON instead.
REST API
There is no REST route for the HTML archive: it is built in the browser from
the board on the screen. The JSON inside it is the board's WeKan JSON export,
GET /api/boards/BOARDID/export?authToken=TOKEN.
How the numbers are calculated
This format has no numbers of its own: it has no limits, counts or defaults beyond those of the export it belongs to.
How it works in WeKan
This format's own code: client/lib/exportHTML.js.
The tests that pin it: tests/clientLazyLoading.test.cjs, tests/exportBoardPopupOrder.test.cjs, tests/exportHTMLXss.test.cjs.
The details of the format, what is kept and how it is tested are below.
Format details
From the format coverage audit, for PDF, HTML and SVG:
- Authoritative shape: export-only rendered views.
- Required coverage: every selected visible section, Unicode, safe links and images, pagination and deterministic filenames; these are presentations, not lossless re-import formats.
What the current code does (client/lib/exportHTML.js):
- The archive is named after the board's title, with every character other than letters a-z, digits, spaces, hyphens and underscores removed, spaces turned into hyphens, and at most 100 characters. Without a usable title the board's id is used. Everything is inside one folder of the same name.
index.htmlis a copy of the page as shown, with the board sidebar, the header's buttons, open popups, the add-list and add-card forms, and the edit, delete and open buttons removed. Every link becomes plain text, and nothing on the page can be edited.- Clicking a card in the page opens a box with the card's title and the text shown on its minicard. The text is inserted as text, so a card title that contains markup cannot run as code in the page.
data/BOARDID.jsonis the board's WeKan JSON export.style/holds the page's stylesheets. Web fonts other than Font Awesome are removed and replaced by the system's sans-serif font; Font Awesome's fonts are inwebfonts/, so icons show.- Images used by the page are saved in folders named after their tag (for
example
img/), and card covers incovers/. The page points to these copies.
The step that adds data/BOARDID.json fetches the board's JSON export
(/api/boards/BOARDID/export) with your login token. It used to read the URL
off a JSON link in the export popup that the shared export popup no longer
has, which stopped the export at that step; it builds the URL itself now.
What is kept
| WeKan | HTML archive |
|---|---|
| The board as shown: swimlanes, lists, minicards, labels, badges | index.html |
| Card covers and other images on the page | covers/ and image folders |
| The board's styles and icons | style/, webfonts/ |
| The whole board as data | data/BOARDID.json (WeKan JSON) |
What is not kept
- Anything not on the screen when the export starts: a filtered-out card, a view that is not open, and the opened-card details beyond what the minicard shows.
- Links, which become plain text, and every editing control.
- Web fonts other than Font Awesome.
- The page cannot be imported back; use the JSON file in
data/for that.
How it is built and tested
client/lib/exportHTML.jsbuilds the archive; it is loaded only when HTML is clicked (client/components/sidebar/sidebar.js,click .html-export-board). The.zipis written withfflate, a file at a time.- The menu entry is
htmlinclient/components/boards/exportScope.js. - Unit tests:
tests/exportHTMLXss.test.cjs(card text reaches the page only as text),tests/clientLazyLoading.test.cjs(the exporter is loaded only on click),tests/exportBoardPopupOrder.test.cjs(the menu entry). - There is no Playwright case for the HTML archive.
Commits
- Website: import and export WordPress, Ghost, Blogger, static and HTML sites, and the board as a website at a public
- Asana: html_notes, approval states and comment likes come across
- Fix GitHub code scanning code-quality findings
- Text exports such as OPML are made from checked values, not stripped as HTML
- Stream a Trello .zip import from a temporary file, its attachments into storage
- Import and export many boards at once for every format, and document each format in its own directory
- Fix board JSON exports containing HTML card text
- Revert Legacy HTML4 browser interface and parity changes
- Add shared HTML4 import source picker
- Share the server ZIP reader with Trello imports
- Lazy-load browser export code
- Security tests: say which vulnerability you guard, and check the list
- Board bar: a long board title moves ALL the buttons to the second row
- Fix ExportBleed: stored XSS in HTML board exports via a card-title second parse
- Export board to HTML .zip: stream to disk and include every card
- Fix Impersonate User. Show/Edit Avatar at Admin Panel/People/People
- Fix client runtime regressions after Meteor 3 migration
- Feat: download webfonts as well
- Fix: export HTML currently exports JS popups
- Card Details Popup, every "Sub-Popup" must use .back() instead of .close()
- Fix(scrollbar): remove custom scrollbar
- Exports now work at #3173 at least for small boards. TODO: Fix EdgeHTML to work, before I can release this
- Added an API to get the cards for a specific custom field value
- Prettifier fixes
- Export Board to Zip file