cengels / skywriter Goto Github PK
View Code? Open in Web Editor NEWA distraction-free writer designed for novelists that exports to Markdown for easy integration with version control.
License: GNU General Public License v3.0
A distraction-free writer designed for novelists that exports to Markdown for easy integration with version control.
License: GNU General Public License v3.0
To prevent the user from accidentally opening the slide-out outline sidebar when selecting text.
The QStringLiteral macro creates a statically known string during compile time and should therefore be preferred if it does not contain any dynamic information.
QStringLiteral()
to initialize an empty string. Use QString()
instead as it's more efficient.QStringLiteral()
multiple times with the same contents. QStringLiterals cannot be merged into one, so this will always create multiple QStringLiterals.QStringLiteral()
as an argument to a function that accepts a char*
argument. In those cases, passing a simple quoted string will forego initializing a QString
altogether and work with a simple char*
instead.Strings should be extracted and localized depending on the user's language.
This issue is a catch-all thread to diagnose and fix all and any problems related to the loading or parsing performance.
This issue concerns the implementation of a right-click context menu in the text area.
Linked with and depends on #9.
Consider whether an explicit scene break would make sense. Internally this could be stored as a simple h6 heading with a specific text (such as ###### [scene break]
). In the text area, the scene break could then be displayed via a horizontal line cutting through the entire text area, or one of the more common manuscript formats for scene breaks like triple hashes (# # #
).
The application should automatically check spelling as words are typed.
Scene breaks are correctly saved to the resulting markdown file. However, when loading the file afterwards, the scene breaks are ignored by the parser and don't show up in the text area. When saving the file again, the scene breaks are lost forever.
It makes sense to add a function that allows one to export the file (as .md) without any of the comments. The resulting file can then be converted to a .doc file or another format and sent to beta readers and critique partners. At this stage of the draft, it is not unlikely for comments to still persist in the document. Some of these comments may be about issues the writer seeks input from their beta readers from.
This shouldn't be too difficult to implement. The text area already knows what a comment is. The parser simply has to ignore those parts of the text and additionally make sure that it doesn't leave any gaps (like double spaces because the comment was surrounded by spaces on both sides).
A preferences page for the user to set various settings for the application.
It is time to add some unit tests to prevent regressions on future changes.
The build fails as the IDE fails to find md4c
. Doing git submodule update
doesn't work as well.
The user should be able to drag text and drop it somewhere else in the text area.
The user should be able to customize the style of the six headings by setting things like text-transform (all uppercase, small caps, ...), font-size, and font-family. For easier access, they should also be able to rename them.
If a user creates a new untitled document, writes a few words, then saves it, the "untitled" progress is lost. Only the progress afterwards is saved.
The document structure currently suffers from a significant performance issue. Whenever the document structure is refreshed (by calling refreshDocumentStructure()
, that process takes a significant amount of time (over 100 ms). It has already been "optimized" in such a way that the document structure is not updated every time the user types something by checking whether an update to the document structure is actually necessary, but some actions (like undoing or redoing) still require a document structure refresh because it is not conventionally possible to check what changed after those actions. For instance, holding CTRL+Z currently results in significant lag after each undo.
To fix this, either
refreshDocumentStructure()
and, if possible, fix themrefreshDocumentStructure()
function asynchronousThis issue is a part of #32.
.
The menu entry Progress...
should be populated. When clicked, it should open a new window that lists all the recent progress items and/or the word counts and words/hour statistics per day.
When double-clicking to enter word selection mode, the resulting selection may contain more text than expected if the word is surrounded by a punctuation token such as a period, quotes, comma, et al.
Rather than just printing the words per day, the UI should also at least show how long the user has been writing in this session.
This should probably be a toggleable feature, as it might be distracting to some.
Assuming a cleanly structured document where each section is prefixed by a corresponding heading, give the user an outline of the sections for easy navigation along with the word count per section.
Check the performance in large files. In skywriter-javafx a VirtualizedScrollPane
was used that only rendered the text actually on the screen. In Qt, such a component does not exist, but it is possible that Qt somehow handles this problem internally automatically. If that's the case, no further action is required.
This issue also concerns the parsing performance of large Markdown files.
At the moment the theme's formatting information (including font style, size, and color) is directly applied to the underlying QTextDocument
's text blocks. This is not the right approach. Only user-defined and undoable formatting data should be applied this way. General formatting data should be applied using QTextLayout
's additionalFormats
, which is also the way QSyntaxHighlighter
applies its syntax highlighting, so it seems reasonable to use the TextFormatter
(which inherits from QSyntaxHighlighter
) for this purpose.
The biggest hurdle for this improvement is the fact that QSyntaxHighlighter
(and the underlying QTextLayout
) only support setting document-wide QTextCharFormat
s, not QTextBlockFormat
s. This means that this approach cannot be used for block formats (especially for headings and scene breaks) and a different approach must be used that nonetheless also does not add a new undo stack.
The other hurdle is that it is not possible to change the text inside slots for either the QTextDocument::contentsChange()
or QTextDocument::contentsChanged()
signals. Modifying the document in those blocks results in a corrupted undo/redo stack. May be related to the filed Qt bug 13936. Unfortunately that issue has been open since 2010, so it seems unlikely it will ever be fixed. There may be no other choice than to disable the undo/redo that QTextDocument
offers and implement a custom undo manager instead. That would be a ton of work for a minor bugfix though. (EDIT: After more testing, it seems like the bug is not caused by the contentsChange()
or contentsChanged()
signal but is actually a general bug with QTextCursor::joinPreviousEditBlock()
when used in combination with QTextCursor::setBlockFormat()
, which in the joinPreviousEditBlock()
call to essentially be ignored and for two undo states to be created).
This fixes the following bugs:
This is especially noticeable on themes with different fonts/font sizes. Non-empty paragraphs will properly switch their fonts and font sizes. Empty paragraphs will, however, maintain the theme used at the start of the application, even when the user types something.
This essentially results in a corrupted active theme.
When opening a Markdown document that features language constructs Skywriter does not support (such as lists, which are missing an empty line between the list items), Skywriter should pop-up a warning, telling the user that their data may be lost if they attempt to open this document and subsequently save it.
The algorithm implemented in #43 currently only works for actual word selections. It should, however, also take effect when using the CTRL+Backspace, CTRL+Delete, or CTRL+arrow key bindings to move by one word at a time.
Highlighting the current paragraph is useful to minimize surrounding distractions.
This is a low priority but should be a feature at some point.
If the caret is out of view, it should scroll back into view when typing something.
This includes HTML like tables or images. At the moment there is nothing preventing these tags from being pasted, and since the custom text engine can't render them, it completely breaks the document.
When writing a story, it is inevitable to make use of proper nouns, i.e. names, often of imaginary things, places, and people.
This proposal discusses whether and in what form these names should receive special handling in Skywriter.
In order to not be falsely highlighted by the spellcheck feature, names must be ignored by the spellcheck. Users must therefore already add these names to Skywriter's internal data in some way, making further special handling relatively easy.
Instead of a simple "add word to dictionary" option, it may be preferable to offer a dedicated "add as name" (or categorized, e.g. "add as place", "add as character", "add as thing") option. This way the proper noun can be distinguished from potential false positives or unknown (but correct) words.
Skywriter may offer a dedicated menu which shows all the characters, places, and things the user has defined as well as offering the ability to modify or delete any of those entries. The actual user value is debatable, however.
Skywriter may offer a feature whereby characters, places, and things can be added to chapters or scenes while writing. This would offer the opportunity to show a more useful and coherent overview of which characters, places, and things appear in which chapters/scenes.
Another possibility is showing an unobtrusive overlay while writing with thumbnails (like portraits) of the characters, places, and things that show up in this scene. This way, if the user struggles to remember which characters appear in the scene, they can use this as a reference.
On the first day of the month, the "last saved" timestamp in the bottom left is incorrect if the file was last saved in the month prior. It will display something like "last saved -1 days ago" rather than "last saved yesterday at XX:XX".
As a writer, sometimes it would be nice to know how many words I've got on the current chapter without having to go up and select the entire text range.
These statistics could include:
A convenience function which automatically generates a new chapter heading, automatically deriving its number from the previous chapter's number (optionally written out in text form).
In case the user forgets to save, there should be a feature that automatically saves after a configurable amount of time has passed without saving.
Even if the user does not choose to activate autosaves, the application should still periodically save the user's file -- but place it in the user's documents directory, timestamping it as a backup. That way, even if autosaves are disabled, the user can retrieve their document if Skywriter or their computer should crash before they do a manual save.
There is very noticeable aliasing on small, light fonts on dark backgrounds. To make dark themes more accessible, reducing this problem should be a top priority. Even on light backgrounds, the aliasing can be noticed.
One possibility includes experimenting with font shadows to create the appearance of smoothed text. Instead of or in addition to offering dedicated input boxes for customizing the shadows, it could just be a check box labeled "Improve font smoothing" with the tooltip "On dark backgrounds, this option can reduce jagged font edges at the cost of slightly blurring the text."
Collect wiki pages for content that does not reasonably fit into the README.md. The philosophy behind Skywriter is one example for this.
A fairly simple feature whereby the caret is always automatically centered if its y value changes.
This is a user-configurable option and can be turned on and off.
The search currently does not support matches across multiple text blocks (i.e. paragraphs).
This seems to be an issue with Qt/QML first and foremost, as calling QTextDocment::find()
with a regex containing \s
, \u2029
, \r
or \n
does not result in matches being found. It's quite possible that Qt/QML escapes the backslashes before passing them on to FormattableTextArea
, which would explain why they're not working, but it's also possible there is another problem at work.
The TextHighlighter
also currently does not support highlighting across multiple blocks, but that part at least is easy to implement. But before it can be implemented, QTextDocument::find()
needs to return the right ranges.
There could be a user setting to hide all sections except the one the user is currently in. That way scrolling would be easier and distraction minimal, especially if you're the kind of writer who writes out-of-order (i.e. you're not always writing from the end of the document).
Depends on #9.
TextHighlighter
(or more accurately its underlying QSyntaxHighlighter
) does not automatically update the formatting of following blocks if comment braces are added or removed.
According to the source code of QSyntaxHighlighter
, it should automatically reformat a block if its block state is different from the last time it was called. However, this does not seem to happen even though the block state is correctly set. Further investigation required.
It should be noted that the format is correctly set, i.e. setFormat()
is called on every block where it is expected. It still doesn't update until the subsequent block has been typed in.
The exact visual representation is yet to be determined.
To minimize overhead, it would be nice to be able to optionally output to other formats as well, specifically .odt, .doc, and .PDF.
All of these, especially PDF, would require a predefined manuscript format the Markdown can parse into.
This proposal involves a text analysis mode that, when turned on, analyzes the document for possible problems.
Depending on the type of problem and the range of text it addresses, the problem could either be described by interjecting text in a different color or by adding text in the margins, also in a different color. The corresponding text should also be highlighted (for instance by using yellow squigglies).
Note that this analysis mode should by no means be on by default. It must be specifically turned on by the user and does not carry over to subsequent launches, as it would otherwise violate the minimalism principle.
Spelling mistakes are not a part of this proposal as these would instead be highlighted by the spellcheck feature, which is on by default.
The application randomly crashes while typing. This is a rare occurrence, but it results in massive loss of data and is therefore the highest priority.
If the cause of the error cannot be quickly discovered, an alternative would be to implement autosave to a temporary backup file in frequencies of 15 seconds apart or less.
When the search highlights the matches, those matches will lose any font properties they originally held, including bold, italics, and font size. After releasing the highlighting, the text returns to normal.
The user may be able to define certain words that should be highlighted in a special way by the text area, for instance by colouring the names of the main characters.
This should also disable spellcheck (#7) for these words.
This is a limitation of the Qt framework. At the moment it is not possible to temporarily disable the QTextDocument
's undo manager, nor is it possible for changes to block formats to not be recorded into the current undo command (unlike char formats, which can use QSyntaxHighlighter
or QTextLayout::setFormats()
to accomplish this).
As a result, the function FormattableTextArea::updateDocumentDefaults()
deliberately clears the undo stack after a theme change so that it is not possible to corrupt the document by undoing the new theme's block formats.
There is no easy way to work around this. The only solution I can see is to disable QTextDocument
's undo manager entirely and implement a custom undo manager, but that's an enormous amount of work for comparably little payoff. Hm...
Dates (particularly the "last saved" date shown in the stats bar) should be relative, i.e. "last saved yesterday" etc. Hovering over this section should open a tooltip with the actual date and time.
This issue is a catch-all issue to diagnose and fix all and any problems related to the performance and/or the general input responsiveness in Skywriter.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.