Skip to content

Commit

Permalink
Alpha fixes (#4)
Browse files Browse the repository at this point in the history
* Fix start up text error and edit read me file.

* More README.md editing.

* More README.md editing.

* More README.md editing.

* More README.md editing.

* Fix an syntax mistake
  • Loading branch information
creativeArtie authored Nov 4, 2017
1 parent 8c4ad90 commit 096b975
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 21 deletions.
146 changes: 144 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,147 @@
# JWriter
This is a writing software foucsed on writing for both fiction and non-fiction. It is simpiler to project like [FoucsWriter](https://gottcode.org/focuswriter/). This project is currently in alpha version, and will be optimized and will have more features.
Screen shots:

## About
JWriter a word processor with note taking and goal setting ablities. It is
foused for authors to write fiction and non-fiction alike. Notes can be put
into to the file anywhere yet allow easy to navigate to them. The goal settings
can be adjest as the document written.

Even though the markup language is made for this program, is very forgiving and
will highlight the syntax. In the future, there will be more support and will
have a [WYSIWYG mode](https://en.wikipedia.org/wiki/WYSIWYG). This make learning
the language as just a faster way to format and insert notes and agendas.

This project is currently in alpha version, and will be optimized and will have
more features.

## Markup

### Formats
There are four different formats. Formats can be combined, but are only restrict
to one line.

|Format |Code |
|---------|--------------|
|Italics |`\*Text\*` |
|Bold |`\*\*Text\*\*`|
|Underline|`\_Text\_` |
|Code |`\`Text\`` |

There are also [footnote (syntax `{^footnote}`), endnote (syntax `{*endnote}`)](#note-styles),
[links (syntax `<@reference id|link text>` or `<link path|link text>`)](#hyperlink),
[agenda (syntax `{! todo}`)](#agenda), and [citation (sytnax `{@id}`)](#notes).

## Sections
Each section had a heading or an outline point at the top of the section. This
markup language allows you to have no heading or outline, but the section has to
be at the top of file. An outline point is nested inside a section with an
heading, or is before the first section with headings.


### Heading and outline

A heading or an outline can have an [id](#id) that can be linked to a
different point of file. The syntax is `@category-id:` and it set before the
first text, other than the syntax used to indicated the heading and outline
style. Refers to the section by using [`<@id>`](#hyperlink).

There are six level for both headings and outlines.

A heading or an outline can also have a status with details, A status is
optional, and can be `#STUB`, `#DRAFT`, `#FINAL`, `#` (custom) and none. after
the status, there are details to go with the status. It will be at the end of
the line.

The syntax of a heading is:

= @category-id:Title for largest heading # status
== Title for heading 2 #DRAFT
======Smallest headings

The syntax of a outline is:

!# Largest outline point
!######Smallest outline pointe


### Main Line Styles

There are several types of line styles.

|Line styles |Syntax |Notes |
|-------------|----------|-----------------------------------------------------|
|Numbered | `# text` |Add tabs before `#` to increse level (up to six) |
|Bullet | `- text` |Add tabs before `-` to increse level (up to six) |
|Quote | `> text` | |
|Section Break| `***` |It has no text after the `*` or allow spaces anywhere|
|Paragaph | `text` |There is no symbol used at the beginning of the line |

### Note Styles
In addition there are footnote, and endnote, that can be referred to even
outside of the section that the line belongs in. Footnotes appears at end of a
page, while endnote appears at the end of either a section or a document.

All footnote and endnotes will have an [id](#id) and text before they can appear
in the printed document.

|Types |Line Syntax |In Text Syntax|
|-----------|------------|--------------|
|Footnote | `!^id:text`| `{^id}` |
|Endnote | `!*id:text`| `{*id}` |

Footnote will count by numbers, while endnot count by letters.

### Hyperlink

Hyperlinks can be link to a section or a webpage. If the referred link points to

A referred link needs a line somewhere with the following syntax:

!@id:webpage path

A referred link needs to have an [id](#id) and text before it can appears in the
printed document.

Both referred link and section links has the following sytnax: `<@id|text>` while
direct links has the following syntax: `<web page path| text>`. Text (include the
symbol `|` are optional, and will be replace by the web page path or the section
title if none is found.

### Agenda
Agenda marks parts of the document to be work on later. There are two types of
agendas, in text or a single line.

In text agenda uses the following syntax `{@text}` while a single line of agenda
uses the following syntax:

!! to do text

## Notes

Note has the following syntax:

!% @id: text
!% more text
!>source: sources

[Id](#id) and sources are optional, but both are required if the note is from
research and is being use as a citation.

Sources has requires two things:

- a line of formated text to appear in the word cited section at the end of
document or section which starts with `!>source:`
- a way to cite in text with start the line with one of the following:
- `!>in-text:` appears in the text
- `!>footnote:` appears as a footnote

## Id

Ids have an category and title. There are unlimited number of categories and
unlimited of nested subcategories avaiable. the categories and titles are sorted
in the alphabethical order and are not case sensitive. The syntax of an id is
`category-subcategory-...-title`.

## Screen shots
![Main Window](design/main.png)
![Stats Window](design/stats.png)
File renamed without changes.
Empty file added data/user-styles.properties
Empty file.
8 changes: 1 addition & 7 deletions src/com/creativeartie/jwriter/file/ManuscriptFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,14 @@ public static ManuscriptFile newFile() {
new RecordTable());
}

private ManuscriptFile(File file, ManuscriptDocument doc,
public ManuscriptFile(File file, ManuscriptDocument doc,
RecordTable table)
{
zipFile = Optional.ofNullable(file);
documentText = doc;
recordsFile = table;
}

public ManuscriptFile(File doc) throws IOException{
zipFile = Optional.empty();
documentText = new ManuscriptDocument(doc);
recordsFile = new RecordTable();
}

public void setSave(File file){
zipFile = Optional.of(file);
}
Expand Down
26 changes: 14 additions & 12 deletions src/com/creativeartie/jwriter/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,26 @@ public void start(Stage stage) throws Exception{
stage.setTitle(TEXTS.getString("MainWindow.Title"));

// testStatsWindow(stage);
// testMainWindow(stage);
jarMainWindow(stage);
openMainWindow(stage);
}

private void testMainWindow(Stage stage) throws Exception{
setupWindow(stage, new File("data/help-text.txt"));
private void openMainWindow(Stage stage) throws Exception{
ClassLoader classLoader = getClass().getClassLoader();
InputStream in = getClass().getResourceAsStream("/data/help-text.txt");
StringBuilder builder = new StringBuilder();
int read = in.read();
while (read != -1){
builder.append((char) read);
read = in.read();
}
setupWindow(stage, new ManuscriptFile(null,
new ManuscriptDocument(builder.toString()), new RecordTable()));
}

private void jarMainWindow(Stage stage) throws Exception{
File classPath = new File(System.getProperty("java.class.path"));
File file = new File(classPath.getParent(), "data/help-text.txt");
setupWindow(stage, file);
}

private void setupWindow(Stage stage, File file) throws Exception{
private void setupWindow(Stage stage, ManuscriptFile file) {
SceneWriterControl writer = new SceneWriterControl(stage);
Scene scene = new Scene(writer, 800, 600);
writer.setManuscriptFile(new ManuscriptFile(file));
writer.setManuscriptFile(file);
stage.setScene(scene);
stage.setMaximized(true);
stage.show();
Expand Down

0 comments on commit 096b975

Please sign in to comment.