mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-03 22:19:03 +00:00
Add @linonetwo’s missing change notes (#9409)
* docs (cherry picked from commit eb5d2c50c0e45712eafda0b0e79bd1816b5f8a5b) (cherry picked from commit eecfd35336964c756547f9ea622566f8bab02709) * typo (cherry picked from commit d9129bcaf3f4face613b3f6ccfe06ce6ed45b2d5)
This commit is contained in:
36
editions/tw5.com/tiddlers/releasenotes/5.4.0/#8258.tid
Normal file
36
editions/tw5.com/tiddlers/releasenotes/5.4.0/#8258.tid
Normal file
@@ -0,0 +1,36 @@
|
||||
title: $:/changenotes/5.4.0/#8258
|
||||
description: Add ability to serialize WikiText AST nodes back to wikitext strings
|
||||
tags: $:/tags/ChangeNote
|
||||
change-type: feature
|
||||
change-category: developer
|
||||
links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/8258
|
||||
github-contributors: linonetwo
|
||||
|
||||
This PR introduces a new utility `$tw.utils.serializeWikitextParseTree()` that can convert WikiText Abstract Syntax Tree (AST) nodes back into wikitext strings.
|
||||
|
||||
There is also a utility `serializeAttribute` for a single attribute node, like an attribute of a widget.
|
||||
|
||||
!! Use Cases
|
||||
|
||||
* Programmatically manipulating wikitext content by modifying the AST, and use this to write it back
|
||||
* Building WYSIWYG editors
|
||||
* Creating wikitext formatters and linters
|
||||
|
||||
!! Implementation
|
||||
|
||||
* New core plugin `tiddlywiki/wikitext-serialize` containing most of the logic
|
||||
* Separate serialize handlers for each WikiText rule as `module-type: wikiruleserializer`
|
||||
* Test suite with tag `$:/tags/wikitext-serialize-test-spec`
|
||||
* It uses each parser's name as rule (`nextMatch.rule.name`), each AST node that needs serialization has a `type` property matching the rule name
|
||||
|
||||
!! Example Usage
|
||||
|
||||
```javascript
|
||||
// Parse a tiddler's wikitext to AST
|
||||
var parseTree = $tw.wiki.parseTiddler("MyTiddler").tree;
|
||||
|
||||
// Serialize AST back to wikitext string
|
||||
var wikitextString = $tw.utils.serializeWikitextParseTree(parseTree).trimEnd();
|
||||
```
|
||||
|
||||
This feature offers new tools for JS plugin developers. It is not a user-facing change.
|
||||
15
editions/tw5.com/tiddlers/releasenotes/5.4.0/#9078.tid
Normal file
15
editions/tw5.com/tiddlers/releasenotes/5.4.0/#9078.tid
Normal file
@@ -0,0 +1,15 @@
|
||||
title: $:/changenotes/5.4.0/#9078
|
||||
description: Web server get-file route now supports HTTP Range headers and streaming
|
||||
tags: $:/tags/ChangeNote
|
||||
change-type: enhancement
|
||||
change-category: nodejs
|
||||
links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9078
|
||||
github-contributors: linonetwo
|
||||
|
||||
The web server's `get-file` route now supports HTTP Range requests and file streaming, enabling better loading and playback of large media files.
|
||||
|
||||
!! Features
|
||||
|
||||
* HTTP Range header: Enables partial content delivery with `206 Partial Content` responses, which is used when the user drags the progress bar in video/audio playback
|
||||
* Streaming file delivery: Browsers can now properly seek and stream video files from the `/files/` directory. Files are read using Node.js streams for better performance and memory efficiency.
|
||||
* Resumable downloads: To save interrupted downloads
|
||||
Reference in New Issue
Block a user