Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v2.4.0
- Added split view
- Added scroll sync between editor and viewer

## v2.3.6
- Fixed zoom handling in editor
- Added ARM64 support
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Right click on a markdown file and select "Open with" and select the downloaded

## Screenshots

![alt text](pics/image1.png)
![alt text](pics/image2.png)
![alt text](pics/image3.png)
![readme splitview demo](pics/image.png)
![codeblock demonstration](pics/image1.png)
![editor view](pics/image2.png)
![home page](pics/image3.png)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "markpad",
"version": "2.3.6",
"version": "2.4.0",
"description": "",
"type": "module",
"scripts": {
Expand Down
Binary file added pics/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pics/image4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ async fn show_window(window: tauri::Window) {
}

#[tauri::command]
fn open_markdown(path: String) -> Result<String, String> {
let content = fs::read_to_string(path).map_err(|e| e.to_string())?;

fn convert_markdown(content: &str) -> String {
let mut options = ComrakOptions {
extension: ComrakExtensionOptions {
strikethrough: true,
Expand All @@ -42,9 +40,18 @@ fn open_markdown(path: String) -> Result<String, String> {
options.render.hardbreaks = true;
options.render.sourcepos = true;

let html_output = markdown_to_html(&content, &options);
markdown_to_html(content, &options)
}

#[tauri::command]
fn open_markdown(path: String) -> Result<String, String> {
let content = fs::read_to_string(path).map_err(|e| e.to_string())?;
Ok(convert_markdown(&content))
}

Ok(html_output)
#[tauri::command]
fn render_markdown(content: String) -> String {
convert_markdown(&content)
}

#[tauri::command]
Expand Down Expand Up @@ -406,6 +413,7 @@ pub fn run() {
})
.invoke_handler(tauri::generate_handler![
open_markdown,
render_markdown,
send_markdown_path,
read_file_content,
save_file_content,
Expand Down
Loading