The yw2html Python script runs through all chapters and scenes of a yWriter 6/7 project and fills HTML templates.
- Python 3.4 or newer
- yWriter 6 or yWriter 7
The yw2html Software comes as a zipfile yw2html_<version number>.zip.
usage: yw_to_html.pyw [-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.
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
-
character_template.html (applied to characters)
-
location_template.html (applied to locations)
-
item_template.html (applied to items)
-
html_footer.html
-
part_template.html (chapter header; applied to chapters marked "section beginning")
-
chapter_template.html (chapter header; applied to all "used" and "normal" chapters unless a "part template" exists)
-
unused_chapter_template.html (chapter header; applied to chapters marked "unused" or "do not export")
-
notes_chapter_template.html (chapter header; applied to chapters marked "notes")
-
todo_chapter_template.html (chapter header; applied to chapters marked "todo")
-
chapter_end_template.html (chapter footer; applied to all "used" and "normal" chapters)
-
unused_chapter_end_template.html (chapter footer; applied to chapters marked "unused" or "do not export")
-
notes_chapter_end_template.html (chapter footer; applied to chapters marked "notes")
-
todo_chapter_end_template.html (chapter footer; applied to chapters marked "todo")
- scene_template.html (applied to "used" scenes within "normal" chapters)
- unused_scene_template.html (applied to "unused" scenes)
- notes_scene_template.html (applied to scenes marked "notes")
- todo_scene_template.html (applied to scenes marked "todo")
- scene_divider.html (lead scenes, beginning from the second in chapter)
There are two options:
- $Placeholder
- ${Placeholder}
-
$Title - Project title
-
$Desc - Project description, html-formatted
-
$AuthorName - Author's name
-
$FieldTitle1 - Rating names: field 1
-
$FieldTitle2 - Rating names: field 2
-
$FieldTitle3 - Rating names: field 3
-
$FieldTitle4 - Rating names: field 4
-
$ID - Chapter ID,
-
$ChapterNumber - Chapter number (in sort order),
-
$Title - Chapter title
-
$Desc - Chapter description, html-formatted
-
$ID - Scene ID,
-
$SceneNumber - Scene number (in sort order),
-
$Title - Scene title
-
$Desc - Scene description, html-formatted
-
$WordCount - Scene word count
-
$WordsTotal - Accumulated word count including the current scene
-
$LetterCount - Scene letter count
-
$LettersTotal - Accumulated letter count including the current scene
-
$Status - Scene status (Outline, Draft etc.)
-
$SceneContent - Scene content, html-formatted
-
$FieldTitle1 - Rating names: field 1
-
$FieldTitle2 - Rating names: field 2
-
$FieldTitle3 - Rating names: field 3
-
$FieldTitle4 - Rating names: field 4
-
$Field1 - Scene rating: field 1
-
$Field2 - Scene rating: field 2
-
$Field3 - Scene rating: field 3
-
$Field4 - Scene rating: field 4
-
$Date - Specific scene date
-
$Time - Specific scene time
-
$Day - Time scene begins: day
-
$Hour - Time scene begins: hour
-
$Minute - Time scene begins: minute
-
$LastsDays - Amount of time scene lasts: days
-
$LastsHours - Amount of time scene lasts: hours
-
$LastsMinutes - Amount of time scene lasts: minutes
-
$ReactionScene - A(ction) or R(eaction)
-
$Goal - The scene protagonist's goal, html-formatted
-
$Conflict - The scene conflict, html-formatted
-
$Outcome - The scene outcome, html-formatted
-
$Tags - Comma-separated list of scene tags
-
$Characters - Comma-separated list of characters assigned to the scene
-
$Viewpoint - Viewpoint character
-
$Locations - Comma-separated list of locations assigned to the scene
-
$Items - Comma-separated list of items assigned to the scene
-
$Notes - Scene notes, html-formatted
-
$ID - Character ID
-
$Title - Character's name
-
$FullName - Character's full name)
-
$AKA - Alternative name
-
$Status - Major/minor character
-
$Tags - Character tags
-
$Desc - Character description
-
$Bio - The character's biography
-
$Goals - The character's goals in the story
-
$Notes - Character notes)
-
$ID - Location ID
-
$Title - Location's name
-
$AKA - Alternative name
-
$Desc - Location description
-
$Tags - Location tags
-
$ID - Item ID
-
$Title - Item's name
-
$AKA - Alternative name
-
$Desc - Item description
-
$Tags - Item tags
