Jump to content

dfay

Member
  • Posts

    1,054
  • Joined

  • Last visited

  • Days Won

    62

Posts posted by dfay

  1. While I'm redefining all the keystroke modifiers....it would also be useful to have one that copies to the clipboard a zotero:// link back to the item.

     

    Here's a javascript example of how these links are created: https://raw.githubusercontent.com/Zotero-ODF-Scan/zotero-odf-scan/master/attic/Zotero Select Item.js

     

    Or even better (for my purposes at least) -- a markdown link with the format [citation](zotero://select/items/item_key)

     

     

  2. Also -- I've realized something else as I've corrected my own misunderstanding of how CSL works.

     

    It will actually be very helpful to copy either an item's CSL citation http://docs.citationstyles.org/en/1.0.1/specification.html#citation or CSL bibliography http://docs.citationstyles.org/en/1.0.1/specification.html#bibliography . 

     

    I'd actually recommend, rather than having opt-return and command-return copy different styles, there could only be one active style, with opt-return copying the citation in that style and command-return copying the bibliography entry.

  3. This is great - search is blazing fast.  I'm running into issues with some CSL styles though -- it doesn't copy successfully and gives the same error message:

     

    22:11:00 util.py:223 INFO     [0.03s] updated search index
    22:11:00 cache.py:301 DEBUG    [cache] opening store 'styles'...
    22:11:00 styles.py:140 DEBUG    [styles] style=CSLStyle(name=u'The Tort Law Review', path=u'/Users/username/Zotero/styles/the-tort-law-review.csl')
    22:11:00 styles.py:141 DEBUG    [styles] csl=[{u'type': u'article-journal', u'title': u'A New Ecosystems Ecology for Anthropology', u'issued': {u'date-parts': [[2003, 0, 0]]}, u'author': [{u'given': u'Thomas', u'family': u'Abel'}, {u'given': u'John Richard', u'family': u'Stepp'}], u'volume': u'7', u'container-title': u'Conservation Ecology', u'issue': u'3', u'id': u'YBE2PQP8'}]
    22:11:00 workflow.py:2074 ERROR    'NoneType' object has no attribute 'render'
    Traceback (most recent call last):
      File "./lib/workflow/workflow.py", line 2067, in run
        func(self)
      File "./zh", line 493, in main
        return do_copy(args['<style>'], args['<key>'])
      File "./zh", line 289, in do_copy
        data = app.styles.cite(e, s)
      File "./lib/zothero/styles.py", line 157, in cite
        html = u''.join(bib_html.cite(cite, warn))
      File "./lib/citeproc/frontend.py", line 102, in cite
        return self.style.render_citation(citation, self._cites, callback)
      File "./lib/citeproc/frontend.py", line 69, in render_citation
        return self.root.citation.render(citation, cites, callback)
    AttributeError: 'NoneType' object has no attribute 'render'
    22:11:00 workflow.py:2076 INFO     for assistance, see: https://github.com/deanishe/zothero/issues
    22:11:00 workflow.py:2097 DEBUG    ---------- finished in 0.517s ----------

    Looks like the citeproc is expecting something it's not getting maybe?

  4. Actually the API seems to be focused on managing users not content.  If you can provide an example of the URL for a Libib search someone could probably help you convert that to a custom search.  But based on that API I don’t think displaying search results in Alfred is possible at this point.

  5. In re: the output format, I wouldn't trouble yourself to writing RTF output code unless you've really got it in the bag already.  The only formatting that's going to be needed are italics, bold, maybe underlining in a few edge cases.  This can be done in HTML and piped to textutil without risk, I'd think.  

     

    Also I'd agree that collections aren't necessary for the workflow.  In my experience, when I would be working with a collection (organizing readings, finalizing references for a paper, etc.), I'd also have my bibliographic software open and be working in there directly.  The times I'd use the workflow are when I'm writing and don't want to be interrupted but just want to quickly grab a reference or open a linked PDF.

     

    Hope that helps -- can't wait to see the finished product.

  6. I haven’t dug into the code to see what’s coming out of the queries, but I think the easiest would be to map it into csl-json https://github.com/citation-style-language/schema/blob/master/csl-data.json based on the zotero field mappings here: https://aurimasv.github.io/z2csl/typeMap.xml

     

    The library should handle csl-json & spit out plain text or html - user can choose to use a markdown csl format like this https://github.com/philipbelesky/Markdown-Citation-Style-Languages but the elegance of this approach is that that will be up to the user.

  7. If you're going to start over, refactor, clean up, etc., I'd suggest the following:

    • Search for entries (by title, author, tag, all fields)
    • Open entries in Zotero
    • open the attachment(s) for an entry
    • select a CSL file for export format - see http://citationstyles.org
    • output a single citation in the selected format's in-text style ( see http://docs.citationstyles.org/en/stable/primer.html )
    • output a single citation in the selected format's note style (ditto)
    • same for selected entries in Zotero and/or contents of a group in Zotero

    The advantage to using CSL is that the workflow then becomes extensible to practically any citation format anyone can throw at it, with no intervention required by the developer.  There are 1000s of CSL templates out there.

     

    Having reworked quite a few of smargh's AppleScripts for Skim, I suspect there is a lot that can be trimmed down.  

     

     

     

×
×
  • Create New...