Export html from yWriter 7
This project is maintained by peter88213
The yw2html Python script runs through all chapters and scenes of a yWriter 7 project and fills HTML templates.
usage: yw_to_html.py [-h] [-t template-dir] [-s suffix] [--silent] Project
Project
yWriter project file
-h, --help
show a help message and exit
-t template-dir
template directory
-s suffix
suffix to output file name
--silent
suppress error messages and the request to confirm overwriting
If no template directory is set, templates are searched for in the yWriter project directory.
If no templates are found, the output file will be empty.
yw2html looks for a unused chapter named html templates. HTML templates can be placed there as scenes. The title of the scene is the same as the name of the template file would be, but without the .html extension. External HTML templates are overridden by internally defined templates, if any.
In the release zipfile, you find a yWriter sample project with internally defined HTML templates in the examples\add-on
subdirectory.
The downloaded zip file includes a directory named examples containing a template directory with example templates for different purposes and some example batch files showing the correct commands. You can launch the batch files by dragging and dropping your yWriter project on the icons. The results will be written to the yWriter project directory.
html_header.html
item_template.html (applied to items)
todo_chapter_template.html (chapter header; applied to chapters marked “todo”)
There are two options:
$AuthorBio - Information about the author
$FieldTitle4 - Rating names: field 4
$ChNumberRoman - Chapter number in Roman numbers (uppercase),
$Desc - Chapter description, html-formatted
$SceneNumber - Scene number (in sort order),
$Desc - Scene description, html-formatted
$LettersTotal - Accumulated letter count including the current scene
$SceneContent - Scene content, html-formatted
$Field4 - Scene rating: field 4
$LastsMinutes - Amount of time scene lasts: minutes
$Tags - Comma-separated list of scene tags
$Items - Comma-separated list of items assigned to the scene
$Notes - Scene notes, html-formatted
$ID - Character ID
$AKA - Alternative name
$Tags - Character tags
$ID - Location ID
$ID - Item ID