Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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 tags to json and xml exporters #975

Merged
merged 6 commits into from
Jun 13, 2020
Merged

Conversation

eshrh
Copy link
Contributor

@eshrh eshrh commented May 30, 2020

This is intended to close #974.

It is nice to have the tags separately by entry rather than just a frequency chart which is somewhat useless except for perhaps interesting statistics.
The only exporters that support this kind of structure is JSON, XML, and YAML. YAML already has this feature.
This PR adds individually tagged entries for both xml and json.

Checklist

  • I have read the contributing doc.
  • I have included a link to the relevant issue number.
  • I have tested this code locally.
  • I have checked to ensure there aren't other open pull requests
    for the same issue.
  • I have you written new tests for these changes, as needed.
  • All tests pass.

@eshrh eshrh changed the title [WIP] Tag array in structured exporters Individually tagged entries in structured export formats May 30, 2020
@eshrh
Copy link
Contributor Author

eshrh commented May 30, 2020

Do note that I fixed a poorly written step in 951a4a3. It was part of my original hacked xml test, but I ended up writing my own step.

@@ -9,6 +9,8 @@ Feature: Exporting a Journal
And "tags" in the json output should contain "@idea"
And "tags" in the json output should contain "@journal"
And "tags" in the json output should contain "@dan"
And entry 1 should have an array called "tags" with 2 elements
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick:

The use of the word "called" in our tests always means that we are invoking something (like the jrnl app itself). Can you take out the word here to avoid confusion?

So, it should just read "entry 1 should have an array "tags" with 2 elements`.

@micahellison micahellison added the enhancement New feature or request label Jun 6, 2020
@eshrh
Copy link
Contributor Author

eshrh commented Jun 6, 2020

@wren done.

Copy link
Member

@wren wren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@wren wren changed the title Individually tagged entries in structured export formats Add tags to json and xml exporters Jun 13, 2020
@wren wren merged commit 37a47fa into jrnl-org:develop Jun 13, 2020
wren pushed a commit that referenced this pull request Jul 25, 2020
* tag array for json
* add tags to entry in xml
* xml test
* json test
* black
* removed called
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add a "tags" array to the JSON export schema
3 participants