Giter Club home page Giter Club logo

Comments (6)

jsonMartin avatar jsonMartin commented on August 15, 2024

Hey @1ncontinentia , thank you, and glad to hear you're enjoying the plugin!

Sure, it's definitely possible to add new fields as long as they're exposed by Readwise's API. I double checked the API documents and see the new document_note field that you mentioned, but I don't see any field named summary. You can see all of the available fields exposed by the API here: https://readwise.io/api_deets.

If you're comfortable opening a pull request adding in the new field(s), I'd be happy to merge in the changes. Otherwise, I'll add it the roadmap but no ETA on when I'll actually have time to focus on this given other work commitments

from readwise-mirror.

1ncontinentia avatar 1ncontinentia commented on August 15, 2024

Hey @jsonMartin, thanks so much for getting back to me! Happy to do that; I assume I just add the fields in the main.ts and it should be good to go? If so, mind adding me as a collaborator? I can't open a pull request at the moment apparently. Cheers!

from readwise-mirror.

jsonMartin avatar jsonMartin commented on August 15, 2024

Hi @1ncontinentia , you should be able to open a pull request. Have you forked the repository first? To create a pull request, you need to make the changes in your fork first, then submit a pull request from there.

And the changes will be a little more involved than just changing main.ts; the field(s) have to be added both in readwiseApi.ts for adding the new field types, then in main.ts for displaying in the template.

So at a high level for example, if adding document_note for example, that is a field on the Books response object. So, a new line could be added on line 44 in readwiseApi.ts adding a type document_note: string. Then, in main.ts, the new field will be deconstructed from the books response object (line 256) and added to the metadata variable so it's available for frontmatter.

Once that's working, then it can be added to the Frontmatter template. Ideally adjusting the headerTemplate of DEFAULT_SETTINGS to display the field (only when it exists, similar to the other fields)

Then, after all the changes are completed in your fork, build it and test the plugin with your Obsidian environment to make sure it all works as intended before submitting the pull request.

Happy to work with you to implement this change, but if it's too much no worries I'll put this on the roadmap for the future when I have spare time.

from readwise-mirror.

1ncontinentia avatar 1ncontinentia commented on August 15, 2024

Ah gotcha! I think in that case it goes a bit above my head and I'd rather not mess things up. If you'd be happy to add to the roadmap that would be amazing! Thanks @jsonMartin

from readwise-mirror.

johannrichard avatar johannrichard commented on August 15, 2024

Sure, it's definitely possible to add new fields as long as they're exposed by Readwise's API. I double checked the API documents and see the new document_note field that you mentioned, but I don't see any field named summary. You can see all of the available fields exposed by the API here: https://readwise.io/api_deets.

@jsonMartin, the summary field is only present in the newer export API endpoint. Wanting both in my Obsidian was a good incentive to write and propose #41.

from readwise-mirror.

jsonMartin avatar jsonMartin commented on August 15, 2024

@johannrichard ok, thank you for these pull requests! I will review soon ๐Ÿ‘๐Ÿผ

from readwise-mirror.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.