Coder Social home page Coder Social logo

revise's Introduction

revise

R-CMD-check

The goal of revise is to support authors in responding to revise and resubmit requests. These functions are designed to work with crsh/papaja.

Installation

You can install the development version of {revise} from GitHub with:

# install.packages("remotes")
remotes::install_github("conig/revise")

Starting a revision document

ReviewerComment addin

We have included an addin so you can mark text as a reviewer comment. If a YAML header is not detected in document the addin will add it. Fields will automatically be filled in if there is a .rmd file in the working directory. Additionally, selected text will be marked as a reviewer comment by including it within an “asis” chunk. Text below this chunk will be tagged as an author response. A hotkey can be set for this addin (e.g. Ctrl+Shift+R).

animation of ReviewerComment addin

animation of ReviewerComment addin

Loading a manuscript

You can use rmd or docx files with revise. To load either, simply call revise::read_manuscript(“your_file.rmd”)

For example. Here is an example docx where content has been tagged with comment boxes. E.g, Revise::hard

docx_path <- system.file("examples/word_test.docx", package = "revise")

man <- read_manuscript(docx_path)
man
#> <Manuscript>
#> �[34m- 6 sections�[39m
#> �[31mNo PDF attached�[39m

We can see all tagged sections by running

names(man$sections)
#> [1] "track_changes" "section"       "multi_lines"   "bullets"       "hard"          "numbered"

Then we can retrieve using a section name

revision <- get_revision("hard", man)
revision
#> [1] ">Hard example\n>\n>This section has all features:\n>\n>* Bullet1\n>\n>* Bullet2\n>\n>* Bullet3\n>\n>Some more text is here."

This content can then be put directly into a response document using single backticks.

revise's People

Contributors

cjvanlissa avatar conig avatar tarensanders avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

revise's Issues

Revise and resubmit letter in pure rmarkdown

We could potentially create a revise and resubmit letter where users can write only with markdown and include minimal LaTeX code.

API will need to be discussed and designed.

Elements which will need representation:

  • Reviewer comments
  • Author responses
  • Manuscript quotes
  • Margin comments

better error handling for get_revision

I think it would be good to have some more informative error messages for get_revision. I think the most critical is get_revision should check is target %in% names(manuscript$sections) or something similar?

Submit package to CRAN

Dear @conig , are you considering to publish the package any time soon? I am really enjoying it, would be nice to have it in a standard repository!

Quote boxes spanning more than one page overloads tex capacity

I think there might be issues with the use of agrep for pulling large sections from a paper. When a span tag covers lots of text I am getting an out of memory error. Might be good to issue a warning to turn pdf=FALSE in read_manuscript to solve?

Should we export a specific environment for storing manuscripts?

@cjvanlissa I'm really enjoying the new functionality you've built where manuscripts are automatically cached and searched.

I was wondering about the edge-case where users want to remove a manuscript from the cache (maybe they loaded the wrong manuscript erroniously). Is there an easy way to find and wipe the correct env at the moment, or do they have to restart the R session?

One solution might be to export an environment specifically for this functionality where users can easily see what objects are in there, and remove objects as needed e.g., revise::manuscript_locker. Would you be in favour of such a change or do you have concerns?

Margin notes

\usepackage[draft]{todonotes}

e.g.

\todo{Revision due: March 15, 2021}

Rendering brackets method to md or html removes bracketed section

Performing more tests, I find that text in brackets, e.g. [section]{#tag} is inconsistently rendered. In md_document and html_document, it is removed entirely. In pdf_document, the behavior depends on pandoc version: 2.18 renders as intended (no square brackets, yes text); 2.19.2 renders square brackets in text.

Highlight changed text in context

Just chucking this up as something to look at in the future, while I'm thinking about it.

It would be good to be able to indicate what was changed in the manuscript, while also being able to show the context of the change. E.g., by showing a full paragraph, but highlighting the sections that were changed. It could look something like

<span id = "rev1_com2">
This is some old text.
This is also old text.
<span class = "changed"> 
Look I made that change you wanted.
</span>
Here is the rest of the paragraph.
</span>

And have it render in the revision letter as:

This is some old text. This is also old text. Look I made that change you wanted. Here is the rest of the paragraph.

Enable reviewer engine chunk name to be changed

Currently users can indicate text as being a reviewer comment with one of two chunks:

```{asis}

```

or

```{reviewer}

```

My preference is to only support "reviewer" but rstudio currently uses r syntax highlighting for all unknown engines. This is bug and should be fixed in the future.

E.g.

image

For the time being 'asis' is the default and is created by the ReviewerComment addin.

Co-opting asis could be annoying for some users as there might be other uses for this chunk type. Accordingly users should be able to choose the chunk name they want to indicate a reviewer comment.

This could be done with an options call

options(reviewer_chunkname)

This option call would change the behaviour of ReviewerComment as well as assign the process_chunk functions to the new engine name.

Write documentation

We need documentation to give users an overview of features and limitations.

Limitations on []{#} text extraction

[]{#} tagging currently works for most circumstances, including nested references.

nested <- "[This [text]{#inner} has nested references[@ref]]{#outer}"

revise:::extract_md_sections2(nested)
#>     tag                               section
#> 1 inner                                  text
#> 2 outer This text has nested references[@ref]

But will fail if square brackets are used for anything other than references

sic <- "This sentence [includes square brackets which aren't [sic] references]{#example}"

revise:::extract_md_sections2(sic)
#>       tag         section
#> 1 example sic] references

For these situations the workaround is to use span tagging until a system with proper parentheses matching is implemented.

Merge manuscript objects

So that revisions can be extracted from multiple documents without having to keep them in multiple objects

Justification causes overflow

This is particularly the case in the quote boxes. I suggest we change:

\usepackage[none]{hyphenat}

to

\usepackage{hyphenat}

with \hyphenpenalty=50

Sections on multiple lines are not parsed

I love the idea of this package and have used it for a revision I'm writing - but when trying to knit my action letter, I noticed that sections on multiple lines don't parse, which is a limitation because - to properly version control my manuscript - it is important that every sentence starts on a newline.

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.