-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Desktop: Resolves #5224: Add Yaml exporter/importer #5465
Merged
Merged
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
794bd60
Add Yaml exporter/importer
CalebJohn c92b804
Use local time in yaml import tests
CalebJohn 5893bb7
Add tests for Yaml Export
CalebJohn 785d6d0
Fix quoting issues with negative numbers
CalebJohn 524c97c
Fix the package-lock version change
CalebJohn c19c9d9
Merge branch 'dev' into yaml-export
CalebJohn 0de144a
rename Yaml export to Markdown + Metadata
CalebJohn 81278be
Add test for newlines in title
CalebJohn 9ad9abc
Add importing support for multimarkdown, r-markdown and pandoc
CalebJohn d76b810
Markdown + Metadata -> Markdown + Front Matter
CalebJohn 893ae2f
Add partial support for Jekyll and hugo import
CalebJohn c67f759
Re-order ignore files
CalebJohn e0fe889
Merge branch 'dev' into yaml-export
CalebJohn bf39290
Merge branch 'dev' into yaml-export
CalebJohn 74b4e44
Merge branch 'dev' into yaml-export
CalebJohn 96beac1
Add test for importing notes with timezone information
CalebJohn 7469530
Don't export coordinates if they're all 0
CalebJohn 2967a7d
Use lowercase for field names
CalebJohn e7af96a
Use Iso 8601 RFC 3339 datetime for export
CalebJohn f3db0bc
Change display of MD_FRONTMATTER to MD
CalebJohn 5cfd203
Add spec document
CalebJohn 24daa95
Fix failing test No -> no
CalebJohn b01d43a
Add more comprehensive types
CalebJohn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: ddd | ||
tags: | ||
- banana | ||
- banana | ||
- banana | ||
--- | ||
|
||
And a link to note [full](./full.md), and link to the [same note](./full.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Test Note Title | ||
updated: 2019-05-01 16:54 | ||
created: 2019-05-01 16:54 | ||
Source: https://joplinapp.org | ||
author: Joplin | ||
latitude: 37.084021 | ||
longitude: -94.51350100 | ||
altitude: 0.0000 | ||
Completed?: false | ||
due: 2021-08-22 00:00 | ||
tags: | ||
- Joplin | ||
- nOte | ||
- pencil | ||
--- | ||
|
||
This is the note body |
6 changes: 6 additions & 0 deletions
6
packages/app-cli/tests/support/test_notes/yaml/inline_tags.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
Title: Inline Tags | ||
Tags: [inline, tag] | ||
--- | ||
|
||
Body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: norm | ||
tags: | ||
- tag1 | ||
- tag2 | ||
- tag3 | ||
--- | ||
|
||
note body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: 001 | ||
--- | ||
|
||
note body |
20 changes: 20 additions & 0 deletions
20
packages/app-cli/tests/support/test_notes/yaml/r-markdown.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: "YAML metadata for R Markdown with examples" | ||
subtitle: "YAML header" | ||
author: Hao Liang | ||
date: "2021-06-10" | ||
output: | ||
md_document: | ||
toc: yes | ||
toc_depth: 2 | ||
abstract: YAML is a human-readable and easy to write language to define data structures. | ||
keywords: ["YAML", "Rmd"] | ||
subject: Medicine | ||
description: Rmd makes it possible to use a YAML header to specify certain parameters right at the beginning of the document. | ||
category: | ||
- Rmd | ||
- Medicine | ||
lang: "en-US" | ||
--- | ||
|
||
Example taken from https://github.com/hao203/rmarkdown-YAML |
10 changes: 10 additions & 0 deletions
10
packages/app-cli/tests/support/test_notes/yaml/r-markdown_author.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: "Distill for R Markdown" | ||
author: | ||
- name: "JJ Allaire" | ||
url: https://github.com/jjallaire | ||
affiliation: RStudio | ||
affiliation_url: https://www.rstudio.com | ||
--- | ||
|
||
Example taken from https://github.com/hao203/rmarkdown-YAML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Date | ||
created: 2017-01-01 | ||
updated: 2021-01-01 | ||
--- | ||
|
||
I hope the dates are imported correctly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: xxx | ||
--- | ||
|
||
--- | ||
author: xxx | ||
--- | ||
|
||
note body |
12 changes: 12 additions & 0 deletions
12
packages/app-cli/tests/support/test_notes/yaml/title_newline.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
Title: |- | ||
First | ||
Second | ||
Updated: 28/09/2021 20:57 | ||
Created: 28/09/2021 20:57 | ||
Latitude: 0.00000000 | ||
Longitude: 0.00000000 | ||
Altitude: 0.0000 | ||
--- | ||
|
||
This note has a newline in the title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
Title: Unquoted | ||
Longitude: -94.51350100 | ||
Completed?: No | ||
DUE: 2022-04-04 13:00 | ||
--- | ||
|
||
note body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Test Note Title | ||
updated: 2019-05-01T16:54:00Z | ||
created: 2019-05-01 16:54-07:00 | ||
--- | ||
|
||
This is the note body |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a mix of lowercase (author) and uppercase (Completed) in there. Is it on purpose? Also the dates don't seem to be UTC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of those are on purpose, the importer is meant to be quite flexible and handles poor formatting (case) and as many date formats as possible. If no timezone is provided, the importer will interpret the timezone as local. There's another test that checks notes with ISO 8601 time zones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, thanks for clarifying.