Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow concordances to be embedded in Markdown output #2200

Merged
merged 7 commits into from
Jan 18, 2023
Merged

Allow concordances to be embedded in Markdown output #2200

merged 7 commits into from
Jan 18, 2023

Conversation

dmurdoch
Copy link
Contributor

I am working on a package that will translate locations for error messages about HTML output into locations in the original Rmd file (see https://github.com/dmurdoch/RmdConcord). With current knitr, it can only convert locations to the intermediate Markdown file; this patch will allow knitr to embed enough information in the Markdown intermediate file so that the message can refer back to the original source.

A possible variation on this patch is to remove the format check within concord_mode completely, i.e. to write it as

# do not consider child mode for concordance
concord_mode = function() {
  opts_knit$get('concordance') && !child_mode() 
}

but I think the checks still need to be kept in concord_gen, so they may as well be here.

@dmurdoch
Copy link
Contributor Author

This is insufficient to handle Rmd -> pdf conversions. I'll improve it and resubmit.

@dmurdoch dmurdoch closed this Nov 25, 2022
@dmurdoch dmurdoch reopened this Nov 26, 2022
@dmurdoch
Copy link
Contributor Author

The test for concordances needed to be generalized to handle PDF or LaTeX output.

Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks!

A possible variation on this patch is to remove the format check within concord_mode completely, i.e. to write it as

That sounds okay to me. If you want to do it, I'll merge this PR after you are done, otherwise I can also merge it as is.

@yihui yihui merged commit f6c069b into yihui:master Jan 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants