3

I am looking for a software for Android and/or Linux to annotate EPUB files.

It should have the capability to export the annotations. Preferably in XML or other easily parsable format.

0

I think it is not possible using only 1 software, but maybe you can do that this way:

  1. Install pale moon, a prerrequisite of epub reader Lucidor

  2. Install Lucidor

    wget "http://lucidor.org/get.php?id=lucidor_0.9.15-1_all.deb" -O lucidor09.deb
    sudo apt install ./lucidor09.deb
    
  3. Make annotations in Lucidor (for a guide, look here) and locate the file's annotations.sqlite path

  4. Now, you have to install R and a pair of packages

    install.packages("RSQLite")  # same for XML
    
  5. Export annotations as xml Ref 1, Ref 2

    library("RSQLite")
    sqlite    <- dbDriver("SQLite")
    
    # replace with correct PATH:
    db <- dbConnect(sqlite,"/home/USERNAME/.ordbrand/lucidor/b2e53o8w.default/lucifox/annotations.sqlite")
    
    dfannotAnnot<-as.data.frame(dbReadTable(db,"annotations") )
    dfannotTarg<-as.data.frame(dbReadTable(db,"targets") )
    
    dataframe<-cbind(dfannotAnnot,dfannotTarg)
    
    library(XML)
    xml <- xmlTree()
    
    xml$addTag("document", close=FALSE)
    for (i in 1:nrow(dataframe)) {
      xml$addTag("row", close=FALSE)
      for (j in names(dataframe)) {
        xml$addTag(j, dataframe[i, j])
      }
      xml$closeTag()
    }
    #save to file
    getwd()
    cat(saveXML(xml), file="Annotations.xml")
    
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.