Giter Site home page Giter Site logo

vkbo / collett Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 215 KB

Collett is an open source rich text editor for writing novels, built on Qt6. It is currently under initial development and not ready for use.

License: GNU General Public License v3.0

CMake 1.85% C++ 98.15%
editor rich-text open-source linux qt6 qt6-widgets

collett's Introduction

Welcome to My GitHub Page

I work as a Software Developer with TurtleSec ๐Ÿข, and have a background in Computational Physics and Accelerator Physics.

My website is available at berglyd.net. You can also find me on Mastodon as @veronica. I keep some general documents and files in the main account repo. For an overview, see the index page. I have a few GitHub Gists posted as well, which you can find on my gists page.

Like my work? Want to buy me a โ˜• ko-fi?

collett's People

Contributors

vkbo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ccwanggl

collett's Issues

Implement adding items to story tree

Epic: #3

Implement the functionality to add new StoryItems to the story tree. This should include a dialog to edit the various user editable settings for the StoryItem.

Implement create project functionality

Epic: #3

Add the necessary code to create new projects.

As a first implementation, creating a new project only needs to trigger a dialog that asks for a project name and a folder to save the project into.

Implement a project save structure

Epic: #3

Implement a way to save project setting, meta data and structure.

The project structure, in terms of its documents, should be saved in a story.json and a notes.json file. The remaining meta settings and project settings should be stored in a project.json file.

Add a data storage class

Epic: #3
Related: #4

The reading and writing of the project's JSON files should be done via a storage class. The path to each file within a project can then be handled internally in such a class. Since everything is JSON, the loading of both files and individual values can be standardised to avoid duplication of code.

The benefit if having a single class that handles all file I/O is that it would be easy to extend such a class to allow storing the project data in a zip archive, or switch between folder and zip storage with a flag.

Rich text editor

Implement a rich text editor widget which has basic text formatting and saves to a rich document format.

The initial implementation must support:

  • Text paragraphs and headers
  • Bold, italics and strikethrough.
  • Left, right, centre, justified text alignment.
  • Paragraph and first line indentation.

The format must allow for future extensions to allow for versioning, footnotes, highlighting and annotations.

The editor must allow settings meta data. The document meta values must include:

  • A title that is independent of any titles inside the document.
  • A type declaration that identifies it as a Book, Partition, Chapter, Scene, Page or Note.
  • The ability to link the document to notes or other notes.

The document file should support saving the meta data, but the data must also be considered backup or duplicate and the authoritative data saved in the project structure files. The ind-document copy of this data will serve as a backup in case the document needs to be re-included into the project after data loss.

Tasks

Add a syntax highlighter

Epic: #16

Add a syntax highlighter that can highlight certain elements of the text. As a starting point it would be useful to be able to highlight headers and dialogues.

Project structure

Projects will be stored in a project folder with the project itself split between a set of JSON files. One file to contain all the project settings, one to contain the project story structure, and one for the project notes.

The project story structure need to be able to have "Book", "Partition", "Page", "Chapter" and "Scene" elements. Each should be able to have text, and the following structure should be enforced in a tree layout:

  • A Book element can be added only at the root level of the project.
  • A Partition element can be added only at root level or as a child under Book.
  • A Chapter can be added as a root element, under Book or Partition.
  • A Page or Scene can be added as a root element, under Book, Partition or Chapter.

It should be possible to select a group of elements and add them to a new parent unit from a context menu.

The idea is that one can start with chapters and scenes directly at the root of the tree, and add layers on top only if one needs them. It should be possible to group the story into separate books treated as individual volumes. It's perfect if one wants to write a trilogy, say, in a single project, as some novelWriter users have explained.

Tasks

Save story tree state

Epic #16

The last state of the story tree needs to be saved. That is, mainly the expanded state of items with subitems.

GUI Themes

Epic: #16

Add the ability to change the colours of the user interface, and define a set of default colour themes.

Allow saving project as a single file

Epic: #3
Depends: #14
Implementation: #23

A project folder can just as easily be saved as a single zip-type file.

This can be implemented either by loading the entire project into memory on load, and save everything to a single file on save (similar to how open document files are saved) or the project could be extracted to a temp folder and that folder be archived before closing the project.

Could potentially use: https://github.com/stachenov/quazip

User interface

The user interface needs the following basic features:

  • An engine to generate icons from SVG data
  • A way to load and modify a GUI colour theme
  • A syntax highlighter that can be customised to highlight certain parts of the text like headers, dialogue, etc

Tasks

Rich text document format

Epic: #7

The rich text content of the editor needs to be serialised into a format that is easy to extend such that new features don't require the file format to be altered, breaking backwards compatibility.

As with #3, the storage format should be JSON, which each document saved as a UUID.json file in a contents folder, similar to how it's done in novelWriter.

The JSON file should consist of an object with a "meta" and a "text" key. The "meta" key should contain another object with key/value pairs as needed. The "text" part on the other hand should be an array of blocks where each block is an array of a block format and a text entry or another array of text format and fragment pairs.

Block and fragment formats can potentially be encoded like in an Open Document, which would make it significantly easier to convert the files to ODT.

If so:

{
    "meta": {
        "title": "Some Title"
    },
    "styles": {
        "T1": "bold"
    },
    "text": [
        "P0:The first paragraph.",
        "P0:",
        "T0:A second paragraph with some ",
        "T1:bold",
        "T0: text in it."
    ]
}

Automatic block formatting

Epic #7

When hitting enter in the editor, the new block needs to set a reasonable block format. The default behaviour of the editor generally works well in that it copies the block format from the previous block, but some more controlled behaviour like in word processors would be nice.

  • The next block after a header should be a paragraph block.
  • If automatic first line indentation is enabled, this should be applied from the second block after a header or an empty block,

Add document meta data view/editor

Epic #16

Add a section of the document editor where document meta data kan be displayed and edited. It needs to contain space for adding a title and setting document tags and references. The area should be able to expand or collapse on user interaction and perhaps based on other clues like the scroll bar.

Auto-replace features

Epic #7

Add auto-replace features like quote replacement and other such features that are available in novelWriter.

Add actions to add and create documents

Epic #16

It should be possible to open and create new documents without adding them to a collection, as well as creating them from a collection as part of it. Using a collection is an optional feature for projects with multiple documents.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.