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

Add a live edit feature to the realtime compiler #1458

Merged
merged 72 commits into from
Nov 14, 2023

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Nov 13, 2023

Live edit

Usage

The live edit feature allows you to quickly edit Markdown-based pages (posts, docs, and pages) directly in the browser.
To enter the live editor, simply double-click on the article you want to edit, and it will be replaced with a text editor.
When you're done, click the save button to save the changes to the page's source file.

Shortcuts

The live editor supports the following keyboard shortcuts:

  • Ctrl + E - Enter/Exit editor
  • Ctrl + S - Save changes
  • esc - Exit editor if active

Configuration

The live editor can be disabled in the config/hyde.php file.
The live editor plugin code will not be saved to your static site.

// filepath config/hyde.php
'server' => [
    'live_edit' => env('SERVER_LIVE_EDIT', true),
],

@caendesilva caendesilva force-pushed the realtime-compiler-live-edit branch from 253d8f9 to 2d6647e Compare November 13, 2023 18:00
Copy link

codecov bot commented Nov 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e5b1147) 100.00% compared to head (c9f5321) 100.00%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##              master     #1458   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity      3456      3456           
===========================================
  Files            360       360           
  Lines           9386      9386           
===========================================
  Hits            9386      9386           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caendesilva caendesilva force-pushed the realtime-compiler-live-edit branch from d407bb4 to 6b42303 Compare November 13, 2023 19:52
Replaces the copy with actual DOM element we can interact with
This reverts commit ba64ab4.
The custom JavaScript solution adds little value, so I prefer to let the browser handle these things. If a validation error occurs, the exception will render.
@caendesilva caendesilva marked this pull request as ready for review November 14, 2023 20:01
@caendesilva caendesilva merged commit e1eba70 into master Nov 14, 2023
14 checks passed
@caendesilva caendesilva deleted the realtime-compiler-live-edit branch November 14, 2023 20: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