Videlais.libtwee 1.0.4

dotnet add package Videlais.libtwee --version 1.0.4
                    
NuGet\Install-Package Videlais.libtwee -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Videlais.libtwee" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Videlais.libtwee" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Videlais.libtwee" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Videlais.libtwee --version 1.0.4
                    
#r "nuget: Videlais.libtwee, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Videlais.libtwee@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Videlais.libtwee&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Videlais.libtwee&version=1.0.4
                    
Install as a Cake Tool

<a name="readme-top"></a>

libtwee

.NET Build NuGet Version NuGet Downloads Code Coverage License: MIT .NET 9.0

A C# library for creating and parsing current and historic Twine file formats.

Table of Contents

<ol> <li><a href="#installation">Installation</a></li> <li><a href="#quick-start">Quick Start</a></li> <li><a href="#story-compilation">Story Compilation</a></li> <li><a href="#format-support">Format Support</a></li> <li><a href="#support-functionality">Support Functionality</a></li> <li><a href="#contributing">Contributing</a></li> <li><a href="#license">License</a></li> </ol>

Installation

NuGet Package Manager

Install-Package Videlais.libtwee

.NET CLI

dotnet add package Videlais.libtwee

Package Reference

<PackageReference Include="Videlais.libtwee" Version="1.0.0" />

Quick Start

using libtwee;

// Parse a Twee 3 file
var story = Twee.Parse(tweeContent);

// Convert to Twine 2 HTML
var html = story.ToTwine2HTML();

// Generate a new IFID
var ifid = Babel.GenerateTwineIFID();

Documentation

📚 Complete Documentation - Comprehensive guides and API reference

Building Documentation Locally

# Install DocFX (if not already installed)
dotnet tool install -g docfx

# Build documentation
./build-docs.sh

# Or manually:
cd docs && docfx docfx.json

Requirements

  • .NET 9.0 or higher

Story Compilation

The process of story compilation converts human-readable content, what is generally called a story, into a playable format such as HyperText Markup Language (HTML). The result is then presented as links or other visual, interactive elements for another party to interact with to see its content.

The term compilation is used because different parts of code are put together in a specific arrangement to enable later play. As part of Twine-compatible HTML, this means combining JavaScript code (generally a "story format") with story HTML data.

Playable formats are the following and require external story formats[^1] to enable play:

  • Twine 2 HTML
  • Twine 1 HTML

More human-readable formats include:

  • Twee 3[^2]
  • Twine 2 JSON[^3]

From 2009 to 2015, Twine 1 supported a now historical format named TWS. libtwee does not support this.

Twine 2 supports exporting a collection of stories (known as a library) in the Twine 2 Archive HTML format.

[^1]: Story formats can be found in the Story Format Archive (SFA).

[^2]: Twee exists in three versions. The first existed between 2006 to 2009 and was part of Twine 1. The move to Twine 2 in 2009 dropped support and the story compilation tools Twee2 and Tweego adopted their own extensions and modifications. Beginning in 2017, work was done to unite the different projects. This resulted in Twee 3 in March 2021.

[^3]: In October 2023, JavaScript Object Notation (JSON) was added as a supported community format for story compilation tools.

Format Support

Format Input Output
Twine 1 HTML (2006 - 2015) Yes Partial support.
Twine 1 TWS (2009 - 2015) Not supported Not supported.
Twine 2 HTML (2015 - Present) Yes Yes
Twine 2 Archive HTML (2015 - Present) Yes Yes
Twee 3 (2021 - Present) Yes Yes
Twine 2 JSON (2023 - Present) Yes Yes

Note: Round-trip translations can present problems because of required fields and properties per format. Some metadata may be added or removed based on the specification being followed.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Support Functionality

Multiple Twine formats support using an IFID to identify one work from another.

The Babel class contains methods for verifying and generating a Twine-compatible IFID:

// Generate a new IFID
string ifid = Babel.GenerateIFID();

// Validate an existing IFID
bool isValid = Babel.ValidateIFID("12345678-1234-1234-1234-123456789ABC");

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Setup

  1. Clone the repository
  2. Ensure you have .NET 9.0 SDK installed
  3. Run dotnet restore to install dependencies
  4. Run dotnet build to build the project
  5. Run dotnet test to run the test suite

Code Coverage

This project maintains high code coverage standards. Run the following to generate a coverage report:

./coverage.sh

<p align="right">(<a href="#readme-top">back to top</a>)</p>

License

Distributed under the MIT License. See LICENSE for more information.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 89 3/30/2026
1.0.3 467 12/9/2025
1.0.2 157 10/17/2025
1.0.1 146 10/17/2025
1.0.0 185 2/1/2025