Converter between yWriter and novelWriter
This project is maintained by peter88213
The yw2nw Python script converts yWriter 7 projects to new novelWriter projects and vice versa.
You can either
usage: yw2nw.py [-h] [-d] [--silent] Sourcefile
Sourcefile
The path of the .nwx or .yw7 file.
-h, --help
show this help message and exit
-d, --double_linebreaks
paragraph breaks are represented by double line breaks in novelWriter
--silent
suppress error messages and the request to confirm overwriting
Topic | yWriter | novelWriter |
---|---|---|
Novel 1st level | ||
“Part” (novelWriter) | Chapter marked as beginning of a new section | Text with a first level heading |
Part synopsis | Chapter description | Text prefixed by % synopsis : |
Novel 2nd level | ||
Chapter | Chapter | Text with a second level heading |
Chapter synopsis | Chapter description | Text prefixed by % synopsis : |
Novel 3rd level | ||
Scene | Scene | Text with a third level heading |
Scene synopsis | Scene description | Text prefixed by % synopsis : |
Novel 4th level | ||
“Section” (novelWriter) | Scene appended to the previous without divider | Text with a fourth level heading |
Section synopsis | Scene description | Text prefixed by % synopsis : |
State of completion | Scene status | Status (max. 6 conv., sect./scenes only) |
Validity | Scene is used/unused | Scene is active/not active |
Characters | ||
Character | Character | Character (tagged) |
Character full name | Character full name | First level heading in the character file |
Character short name | Character name | Text prefixed by @tag : |
Character alternative name | Character aka | Text prefixed by %aka : |
Character importance | Major/minor character | Status (max. 2 converted, customizable) |
Character biography | Character bio | Text with a ## Bio heading |
Character goals | Character goals | Text with a ## Goals heading |
Notes about a Character | Character notes | Text with a ## Notes heading |
Point of view reference | Scene viewpoint character | Text in scene prefixed by @pov : |
Character reference | Scene character | Text in scene prefixed by @character : |
Story world | ||
Location | Location | Location (tagged) |
Location name | Location name | Text prefixed by @tag : |
Location alternative name | Location aka | Text prefixed by %aka : |
Location description | Location description | Text body below the first heading |
Location reference | Scene location entry | Text prefixed by @location : |
Item | Item | Item (tagged) |
Item name | Item name | Text prefixed by @tag : |
Item alternative name | Item aka | Text prefixed by %aka : |
Item description | Item description | Text body below the first heading |
Item reference | Scene item entry | Text prefixed by @object : |
Tools | ||
Notes | “Notes” type scene | “Notes” file |
You can override the default settings by providing a configuration file. Be always aware that faulty entries may cause program errors or unreadable projects.
The global configuration file is placed in the configuration directory in your user profile. It is applied to any project. Its entries override yw2nw’s built-in constants. This is the path:
c:\Users\<user name>\.pywriter\yw2nw\config\yw2nw.ini
The setup script installs a sample configuration file containing yw2nw’s default values. You can modify or delete it.
The yw2nw distribution comes with a sample configuration file located in the sample
subfolder. It contains yw2nw’s default settings and options. This file is also automatically copied to the global configuration folder during installation. You best make a copy and edit it.
#
number sign. In the example, they refer to the code line immediately above.This is the configuration explained:
[OPTIONS]
double_linebreaks = Yes
# "Yes" -- In novelWriter, paragraphs are separated by double line breaks,
# as is supported by novelWriter's document export.
# "No" -- In novelWriter, paragraphs are separated by single line breaks,
# as is common in prose texts.
# Note: "No" is overridden by the "-d" command line parameter.
[SETTINGS]
outline_status = ('Outline', 'New', 'Notes')
# This novelWriter status are converted to yWriter "Outline"
# scene status.
draft_status = ('Draft', 'Started', '1st Draft')
# This novelWriter status are converted to yWriter "Draft"
# scene status.
first_edit_status = ('1st Edit', '2nd Draft')
# This novelWriter status are converted to yWriter "1st Edit"
# scene status.
second_edit_status = ('2nd Edit', '3rd Draft')
# This novelWriter status are converted to yWriter "2nd Edit"
# scene status.
done_status = ('Done', 'Finished')
# This novelWriter status are converted to yWriter "Done"
# scene status.
scene_status = ('None', 'Outline', 'Draft', '1st Edit', '2nd Edit', 'Done')
# This status are used when creating a new novelWriter project from
# yWriter.
# You can rename them, but the number of tuple entries must not change.
major_character_status = ('Major', 'Main')
# This novelWriter status are converted to yWriter "Major" character
# importance.
character_notes_heading = ## Notes
# Heading for novelWriter character text that is converted to yWriter
# character notes.
character_goals_heading = ## Goals
# Heading for novelWriter character text that is converted to yWriter
# character goals.
character_bio_heading = ## Bio
# Heading for novelWriter character text that is converted to yWriter
# character bio.
ywriter_aka_keyword = aka
# Keyword for 'aka' pseudo tag in novelWriter character text, signifying
# an alternative name.
# Usage: "%aka: <character's alternative name>"
# One aka per character.
ywriter_tag_keyword = tag
# Keyword for 'tag' pseudo tag in novelWriter character text, signifying
# a yWriter tag.
# Usage: "%tag: <character, location, or scene tag>"
# If there are multiple tags assigned, put each one on its own line.
By default, yw2nw converts a Markdown subset according to the following specificatiions:
By default, double line breaks are considered paragraph breaks, as is the Markdown standard supported by novelWriter’s document export. In this case, single blank lines in yWriter scenes are Markdown-encoded by three blank lines.
You can change the converter’s behavior by changing the double_linebreaks setting in the configuration file to “No”. Then single line breaks are considered paragraph breaks, as is common in prose texts.
NOTE: double_linebreaks = No is not compliant with novelWriter’s standard, so you better don’t use this option if you want to use novelWriter’s built-in document export.
Standard Markdown behavior can be enforced by setting the command line parameter -d.
# One hash character at the start of the line
## Two hash characters at the start of the line
_single underscores_
Note : A _
surrounded with spaces will be treated as a literal underscore.
**double asterisks**
~~double swung dashes~~
The setup script installs yw2nw.py in the user profile. This is the installation path on Windows:
c:\Users\<user name>\.pywriter\yw2nw