matkuki/ExCo

Possible addition of new language

Closed this issue · 1 comments

Hi,
I am implementing a new markup language (something akin to Markdown, but geared towards novel publishing).
I think it would be extremely useful to add some kind of integrated editor (right now I'm focused on command-line utilities to convert from markup to LaTeX/XHTML).
Features I have in mind, in increasing order of complexity, are below.
Real question is:
In Your opinion, is ExCo the right tool to use?
If so: what will be the effort required?
Thanks in advance.

Features:

  • Syntax Highlighting: there are a few commands, possibly nested, all with the general structure:
    @command[param1][param2]{contents, possibly very long and containing @nested[]{commands}}
  • Syntax substitution: since all commands have a semantic value (e.g.: @speech for direct speech or @standout for some kind of visual enhancement) it would be nice to render on-screen with some convention (e.g.: different font or color) hiding labels that are distracting.
  • Commands to wrap selected text in a command.
  • A browser keeping track of book structure (the usual division: book, part, chapter, scene) with possibility to jump to corresponding place in text.
  • Spell checker (better if something like Languagetool is available).
  • Details pane: to keep track of characters, places, objects: once defined these should be highlighted in text.
  • Commands to call my processing programs to export to the various output formats (currently XHTML/ePUB and LaTeX/PDF), possibly with some preview (might be external).
  • Some configuration pages to customize defaults (e.g.: direct speech style: guillemots/inverted quotes/em-dash).

Any insight welcome

Hi,

I don't think the QScintilla editing component, is the right tool for this, as it is meant to be a source code editor. All editor widgets inside ExCo use the QScintilla editing component.
Things that should not be a problem:

  • Syntax Highlighting (different fonts, background/foreground color, ...)
  • A browser keeping track of book structure
  • Spell checker
  • Details pane
  • Commands to call my processing programs
    All other things concerning advanced styling of text like Syntax substitution and Command wrapping are not supported by default, so you would have to somehow implement them manually in QScintilla, which is probably not that trivial.

Another solution would be to create a new formatting component using QTextEdit with some additional processing code and then integrating it into ExCo (integration would be quite simple, the formatting component would probably be quite complex). QTextEdit supports rich text styling, which is a subset of HTML 4.0, if that is flexible enough for you:
https://doc.qt.io/qt-5/richtext-html-subset.html

But with regards to adding a new language with just the standard stuff, I would be glad to add it if you provide me with a specification (keywords, operators, special characters/words, ...) and an icon.

Regards