Giter VIP home page Giter VIP logo

keenwrite's People

Contributors

davejarvis avatar deining avatar devcharly avatar roryokane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keenwrite's Issues

Inline code does not word-wrap

Replicate

  1. Decorate a long paragraph with backticks around a word.
  2. Ensure the paragraph wraps at the word enclosed by backticks.

Expected

The word (or words) enclosed by backticks breaks at a word boundary, if possible.

Actual

As attached.

Details

Caution is needed so that long backtick sentences don't overflow.

word-wrap

Spell Checking

Add spell checking that avoid spell checking of variable definitions.

Synchronize editor and preview pane scrolling

Replicate

  1. Scroll the editor pane using the scrollbar.

Expected Results
The preview pane scrolls in lock-step with the editor pane.

Actual Results
The preview pane does not scroll and must be scrolled independently.

Search and Replace for Variables

Allow the user to search for text and replace said text with variable names. This is not a regular search and replace dialog, it is specifically meant to replace duplicated text with a variable definition.

Lock preview pane scrollbar to editor pane scrollbar

Cannot open SVG file

Replicate

  1. Create a file with Inkscape.
  2. Ensure the file has a flowRoot element.
  3. Save the file as flow.svg.
  4. Start Scrivenvar.
  5. Create a new file.
  6. Reference the vector graphics in Markdown using ![](flow.svg).

Expected

Image renders fine.

Actual

Error:

org.w3c.dom.DOMException: The current document is unable to create an element of the requested type (namespace: http://www.w3.org/2000/svg, name: flowRoot).

Work Around

  1. Edit flow.svg in a text editor (don't use Inkscape).
  2. Change the version attribute of the root svg element from 1.1 to 1.2.
  3. Save the file.
  4. Return to Scrivenvar.
  5. Press Enter to update the preview panel.

The SVG is rendered.

Fenced code block has extra space

Replicate

  1. Create a fenced code block having multiple lines

Expected

The left-hand edges of the code block align.

Actual

In the attached, the preview pane renders cd $HOME/bin with an extra space at the beginning that's not present in the Markdown.

code-block

Incorrect path truncates line

Writing an incorrect link or path to an image causes everything afterwards to be hidden.

no-image

Investigate using a smaller invalid image icon.

Load YAML variables from file

Requirements when opening a definition file:

  • If opening multiple editable files at the same time, the first definition file applies to all the files and the remaining definition files are discarded from the list.
  • If opening a single definition file, it applies only to the currently editable file. If no editable file exists, then the user must be prompted to first open a file.

Reduce line breaks in HTML.

Implement Ctrl+j to join lines separated by a single space together, similar to the vi J command.

OR

Change the pegdown implementation so that single line breaks don't convert to HTML <br/> tags (end a sentence with double space and a hard-return to get a <br/> instead).

New tabs don't switch preview context

Replicate

  1. Open the application.
  2. Open a new markdown file.

Expected Results
The Preview pane updates with the content of the newly opened file.

Actual Results
The Preview pane remains empty.

Insert variable without loading a text document

  1. Start app.
  2. Open definition file.
  3. Type in a substring value from definition file.
  4. Press Ctrl+Space.

Actual Results

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
	at com.scrivenvar.AbstractFileFactory.lookup(AbstractFileFactory.java:88)
	at com.scrivenvar.AbstractFileFactory.lookup(AbstractFileFactory.java:63)
	at com.scrivenvar.editors.VariableNameDecoratorFactory.newInstance(VariableNameDecoratorFactory.java:51)
	at com.scrivenvar.editors.VariableNameInjector.getVariableDecorator(VariableNameInjector.java:815)
	at com.scrivenvar.editors.VariableNameInjector.decorate(VariableNameInjector.java:340)
	at com.scrivenvar.editors.VariableNameInjector.decorate(VariableNameInjector.java:326)
	at com.scrivenvar.editors.VariableNameInjector.autocomplete(VariableNameInjector.java:311)
	at org.fxmisc.wellbehaved.event.InputMap.lambda$consume$2(InputMap.java:256)
	at java.base/java.util.Optional.map(Optional.java:258)
	at org.fxmisc.wellbehaved.event.PatternActionMap.lambda$forEachEventType$1(InputMap.java:414)
	at org.fxmisc.wellbehaved.event.InputHandlerMap.lambda$null$0(InputHandlerMap.java:22)
	at org.fxmisc.wellbehaved.event.InputHandlerMap.lambda$null$0(InputHandlerMap.java:23)
	at org.fxmisc.wellbehaved.event.InputHandlerMap.lambda$null$0(InputHandlerMap.java:23)
	at org.fxmisc.wellbehaved.event.InputHandler.handle(InputHandler.java:50)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$KeyHandler.process(Scene.java:4098)
	at javafx.scene.Scene.processKeyEvent(Scene.java:2157)
	at javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2625)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:217)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:149)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(GlassViewEventHandler.java:248)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:247)
	at com.sun.glass.ui.View.handleKeyEvent(View.java:547)
	at com.sun.glass.ui.View.notifyKey(View.java:971)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:832)

Scrolling offset is incorrect

When the <span id='CARETPOSITION'> is added to the HTML output, the preview pane for the HTML doesn't show the correct position in the document. There might have to be some positional adjustments or improved JavaScript to accurately scroll to the <span> element (perhaps by checking to see if the item is visible within the view port).

Refactor variable names

Provide the ability to refactor variable names.

This must come after issue #77 whereby the variable names can be refactored for a particular project. That project would then define all the files that would be affected by changing variable names.

After variable names can be refactored (taking into consideration both mustache and R syntax), update the AltTreeCellFactory to support drag-and-drop (D&D). Any D&D event can then trigger a refactor event.

Selections are not highlighted on Windows

Replicate
Using Microsoft Windows:

  1. Open a document.
  2. Select text.

Expected Results
The text is shown to be selected by highlighting.

Actual Results
The text is not highlighted, but it is selected.

Caret stops moving when using arrow keys

Replicate

  1. Create a long document that has inline images and hyperlink references.
  2. Press Home to move the caret to the beginning of a line.
  3. Hold down Up or Down arrow to scroll through the document.

Expected Results
The caret never stops.

Actual Results
Sometimes the caret gets stuck within a Markdown tag.

Work Around
Use the mouse to change the caret position.

Scroll past last line

Give some space beneath the end of the preview so you can scroll a bit past the last line.

Add variable processor

Upon insererting YAML variables into the document:

  • Parameterize YAML variable insertion text (e.g., r#x(YAML VAR) or $YAML VAR$) via processor
  • Red squiggly underline for undefined variable definitions?

Create, edit, and save YAML variables

See:

Variables files should auto-associate with the file being edited.

Editing variables will require re-creating the definitions map used by the string replacement algorithm.

See MainWindow.java, around line 426:

    final Processor<String> vnp = new VariableProcessor( mp, getResolvedMap() );

That map must update on changes to the YAML variables.

Caret Line Number

In MainWindow.java:

  • Move the caret offset code (lines 248 - 256) out of refreshSelectedTab and into new method
  • Fire new method when caret position changes

Additionally:

  • Use a lighter font colour

Hyperlink dialog should use selected text (or current word)

Replicate

  1. Select text.
  2. Type Ctrl+l

Expected Results

Opens insertion dialog with the current selection as the link's text.

Actual Results

No suggested link text.

Additional Details

If no selection, then the word at the caret should be used by default. If the hyperlink text is changed, then the word at the caret should not be removed, but the hyperlink inserted at the caret (i.e., the word will get split with the hyperlink).

Status Bar

Instead of alert dialogs, use status bar messages.

Caret Decorator

To account for scrolling with any source document, a unique text string (e.g., ${CARETPOSITION}) must be inserted into the text at the caret position prior to rendering, subject to the following conditions:

  • Markdown: Insert ${CARETPOSITION} at the current caret text position.
  • XML: Insert <![CDATA[${CARETPOSITION}]]> inside the text node closest to the caret text position.

The Caret Processor finds ${CARETPOSITION} in the rendered HTML and inserts an empty span element with caret as its ID. The HTML preview pane is then scrolled so that the caret's span element is visible.

Edit mode upon definition creation

Replicate

  1. Click Create

Expected

The variable definition editor goes into edit mode immediately.

Actual

Nothing happens.

Details

Updating DefinitionPane's addItem method to use a naïve approach causes subsequent edit actions to be ignored:

  private void addItem() {
    final var value = createTreeItem();
    getSelectedItem().getChildren().add( value );
    expand( value );
    select( value );
    getTreeView().edit( value );
  }

XSLT Integration

Provide ability to load and edit XML documents, associating a document (or directory?) with a stylesheet for transforming. Requires:

  • XSLT processor (Saxon 9he)
  • XSL processor into processing chain

Generic R initialization code

Provide a place to edit the initialization code for InlineRProcessor.init( Path ).

Should auto-replace variables such as:

  • $application.current.directory$ with the path variable.
  • $application.current.date$ with the current date (dd-MM-yyyy).
  • $application.current.time$ with the current time (HH:mm:ss).
  • All definition variables from getDefinitions() (as per existing code).

Export formats

Replicate

  1. Click File > Export > PDF or File > Export > HTML

Expected

Menu item shows option to export preview pane contents in a few different formats.

Actual

No menu item exists, no such behaviour exists.

XSLT Performance

From http://www.xmlblaster.org/XSL_performance.html :

  1. Keep the source documents small. If necessary split the document first.
  2. Keep the XSLT processor (and Java VM) loaded in memory between runs
  3. If you use the same stylesheet repeatedly, compile it first.
  4. If you use the same source document repeatedly, keep it in memory.
  5. If you perform the same transformation repeatedly, don't. Store the result instead.
  6. Keep the output document small. For example, if you're generating HTML, use CSS.
  7. Never validate the same source document more than once.
  8. Split complex transformations into several stages.

Tips for how to write efficient XSLT:

  1. Avoid repeated use of "//item".
  2. Don't evaluate the same node-set more than once; save it in a variable.
  3. Avoid if you can. For example, by using position().
  4. Use , for example to solve grouping problems.
  5. Avoid complex patterns in template rules. Instead, use within the rule.
  6. Be careful when using the preceding[-sibling] or following[-sibling] axes. This often indicates an algorithm with n-squared performance.
  7. Don't sort the same node-set more than once. If necessary, save it as a result tree fragment and access it using the node-set() extension function.
  8. To output the text value of a simple #PCDATA element, use in preference to .

Preview pane jumps around when typing and moving the caret

Make the way the preview follows where the cursor is less janky. It jumps around a lot. Only moving if necessary and making it slide rather than snap to place would be nice.

Replicate

  1. Create a new Markdown file with a lot of text.
  2. Press Ctrl+End to reposition the caret to the end of the document.
  3. Press Enter to add a blank line.
  4. Type a to add a letter.

Expected

The preview pane shows the letter a, relative to the caret's current position in the document.

Actual

The preview pane jumps to the document start.

Workaround

Type another letter.

Details

The editor exhibits this behaviour when typing quickly or roving about the document using the cursor keys. The underlying problem appears to have something to do with the timing of when the corresponding Flying Saucer box for the element containing the caret id attribute is added to the document. When typing too quickly, sometimes Flying Saucer does not find the HTML document's caret id attribute, despite the attribute being available.

See SharedContext's getBoxById(String), addBoxId(String, Box), and reset() methods as well as HTMLPreviewPane's scrollTo( Point ) method.

Leave edit mode when focus lost

Replicate

  1. Click Create in the Definition Pane.
  2. Press F2 to edit the new variable.
  3. Click anywhere that isn't the input field.

Expected

The field is saved.

Actual

Nothing happens.

Details

This is a known bug with the JavaFX implementation:

Working around the issue is difficult; the maintainers mention there are no hacks that fully resolve all the issues. It is possible to use reflection to obtain a handle to the private TextField textField member of TextFieldTreeCell and observe the focus of that text field, but that incurs reflection. Using reflection limits future possibilities (such as ProGuard, other means of reducing byte code size, or possibly generating native binaries using GraalVM).

Reference YAML variables

For the @ usage:

  • Press @ for a list of commonly used YAML variables.
  • Press Enter to select the currently selected item from the list.
  • Press . to select the current level (e.g., @c. displays the list of values under character; @c.pr. will display the list under c.protagonist).
  • Press Backspace to move backward one level.
  • Press Esc to close the list without insertion.

Also, use Ctrl+Space to autocomplete YAML variable name.

Caret position changes Markdown

Consider:

|# Markdown

The caret position should not affect the layout. Thus when the caret is at the beginning of a line, inject the ${CARETPOSITION} before the first non-punctuation character:

  • |=== becomes ===|
  • |# Markdown becomes # |Markdown
  • |> Markdown becomes > |Markdown
  • Three backticks, etc.

YAML variable inserted into multiple documents

Replicate

  1. Open two or more .Rxml files.
  2. Open a YAML file.
  3. Double click on a variable in the YAML file.

Expected Results
The variable is inserted into the visible document.

Actual Results
The variable is inserted into all documents.

Broken image icon

Replicate

  1. Insert a broken image reference into the document.

Expected

The image is about 50 pixels high.

Actual

The image is around 100 pixels high.

Details

When inlined, this makes the paragraph large and chunky, rather than svelt and small.

Preview panel stops synchronizing with the editor panel

Replicate
Exact steps are unknown at this time.

Expected Results
Preview pane should be kept in sync with editor panel while moving the caret.

Actual Results
Sometimes the preview pane stops updating its scroll position relative to the caret within the editor.

Work Around
Close the file and re-open it, the preview should follow the caret position.

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.