sonnenkern / quip-export

Export all folders and documents from Quip

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include document comments and conversations as an option

josemdv opened this issue · comments

Do you think it will be possible to add an option to the script to also include threads at the end of the HTML export? Maybe adding the thread history to the HTML.

Your tool is amazing!! Keep it up!!

Hi! Thank you for your feedback. Let's think about it. But I don't really understand what are you meaning. Try to explain it more precise, maybe with some example.

Hi @sonnenkern, I'm referring to the comments and conversations of a Quip document, for example, https://www.quipsupport.com/hc/en-us/articles/360020735792-Comments-and-conversations.

Right now, when we export a document, we can't export the previous comments or conversation of the document, and it will be amazing if it was possible.

Hi @josemdv, I have added the export of comments (v. 2.1.0, option '--comments'). In Quip you can add comments to whole document either to some parts of document (annotations).
The new option works only for document's own comments and conversations. Content based comments (annotations) are not supported. I hope you will be happy with the new feature.
Could you try it please? Thnx.

P.S. Actually it is possible to get out also annotations, but in that case they will loose the context. You can see the comments, but it will be difficult to distinguish which part of document they belongs to.

Hi @sonnenkern Thank you for this awesome tool. May I ask if its possible to export the annotations as well? Is it a straightforward update to the code?
Probably its fine if we lose the context.
(or if possible then have Line number or Line text if thats supported by Quip APIs to export annotations)

Hi @sonnenkern, I am not familiar with NodeJS code but happy to look into the code location if I can.

I didn't know about Browser-version of the tool. I used CLI version (npm install -g quip-export) and ran command in following format:
quip-export --token "quip_api_token" --embedded-styles --embedded-images --comments --folders "folder_id"
It exported Global comments minus the annotations and hence came across this closed issue.

I can try to setup project locally later this week. Meanwhile please point me in the right direction. Thanks.

Works! Awesome. Thank you. 💯

Works! Awesome. Thank you. 💯

You are welcome! Don‘t forget to give me a star on GitHub 😉

Thanks for making this addition, I think it's pretty handy! Sometimes a lot of the value in historical documents is in the comments/annotations.

I do want to point out that it is actually feasible to attach the comments to the place in the document that they were annotating - the annotation object includes a highlighted_section_ids field which can be used to refer back to the original section that was annotated. It'd probably be annoying to make them show up as annotations like they do on Quip, but it is pretty feasible to include a link back to the referenced section since the sections have anchors. I have a hacky version of it working locally and would love to contribute a PR back to add those links. Here's a snippet of that code below:

  async _getThreadMessagesHtml(quipThread, path) {
//...
// put this near the bottom of `_getThreadMessagesHtml
      let highlightedSections = "";
      if (
        message.annotation &&
        message.annotation.id &&
        message.annotation.highlight_section_ids
      ) {
        highlightedSections = message.annotation.highlight_section_ids
          .map((sectionId, index) => {
            // Not sure if there can be more than one highlight section, but if so, we can number the reference links
            const suffix =
                  message.annotation.highlight_section_ids.length == 1
                  ? ""
                  : index + 1;
            return `<a href="#${sectionId}">ref${suffix}</a>`;
          })
          .join(" ");
      }

// This replaces the last conditional of this function
      if (text) {
        html += `\n<div class="message"><span class="message--user">${message.author_name}${dateStr} ${highlightedSections}<br/></span>${text}</div>`;
      }

Also, it seems to me that currently this might only include the first 25 annotations per thread/document since I believe that's the default limitation in the API.

In any case, thanks for this project!