Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open node bodies in editor instead of full node text #3

Merged
merged 15 commits into from
Jul 26, 2020

Conversation

TranquilMarmot
Copy link
Owner

@TranquilMarmot TranquilMarmot commented Jul 21, 2020

Currently, when opening a node, the full node text is opened in the temporary file.

For example,

title: Sally
tags: intro
position: 369,-168
---
<<if visited("Sally") is false>>
    Player: Hey, Sally. #line:794945
    Sally: Oh! Hi. #line:2dc39b
    Sally: You snuck up on me. #line:34de2f
    Sally: Don't do that. #line:dcc2bc
<<else>>
    Player: Hey. #line:a8e70c
    Sally: Hi. #line:305cde
<<endif>>

<<if not visited("Sally.Watch")>>
    [[Anything exciting happen on your watch?|Sally.Watch]] #line:5d7a7c
<<endif>>

<<if $sally_warning and not visited("Sally.Sorry")>>
    [[Sorry about the console.|Sally.Sorryy]] #line:0a7e39
<<endif>>
[[See you later.|Sally.Exit]] #line:0facf7
===

This is mostly fine but it makes it easy for the user to break things, for example if they remove the --- or === or change the position field to an invalid value.

There's really no good reason for the editor to display anything but the body of the node.

This PR makes the following changes:

  • Add a "Rename" icon in the node title that can be clicked to rename a node (this works the same as adding a new node and does the same validation)
  • Ability to add/remove tags from nodes in a more interactive way
  • Only open the node body in the temporary file (this will require quite a few changes to tests)
  • Fix syntax highlighting to not assume a --- and ===
  • Fix syntax highlighting to consider line identifiers as comments

@TranquilMarmot TranquilMarmot merged commit cb6d742 into main Jul 26, 2020
@TranquilMarmot TranquilMarmot deleted the tranquilmarmot/edit-body branch July 26, 2020 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant