Skip to content

Commit

Permalink
add lingglosses.italic_transliteration option
Browse files Browse the repository at this point in the history
  • Loading branch information
agricolamz committed Nov 20, 2022
1 parent 823975a commit fbd1b26
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 138 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ LazyData: true
URL: https://CRAN.R-project.org/package=phonfieldwork, https://agricolamz.github.io/lingglosses/
BugReports: https://github.com/agricolamz/lingglosses/issues
Imports: kableExtra, knitr, rmarkdown, utils, htmltools, methods
RoxygenNote: 7.1.2
RoxygenNote: 7.2.1
Suggests: testthat (>= 3.0.0)
Config/testthat/edition: 3
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- fix plus sign bug (thx to Nastya Panova);
- fix tab bug (thx to Tatiana Philippova and Polina Nasledskova);
- fix multiline `gloss_example()`;
- add `lingglosses.italic_transliteration` option;

# lingglosses 0.0.4

Expand Down
2 changes: 1 addition & 1 deletion R/gloss_example.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ gloss_example <- function(transliteration,
video_width = 320,
video_height = 240,
line_length = 70,
italic_transliteration = TRUE,
italic_transliteration = getOption("lingglosses.italic_transliteration"),
drop_transliteration = FALSE,
intext = FALSE,
write_to_db = TRUE){
Expand Down
1 change: 1 addition & 0 deletions R/zzz.r
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.onLoad <- function(libname = find.package("lingglosses"),
pkgname = "lingglosses") {
options("lingglosses.italic_transliteration" = TRUE)
tmp_file1 <- tempfile(pattern = get_variable_name(), fileext = ".csv")
options("lingglosses.glosses_list" = tmp_file1)
tmp_file2 <- tempfile(pattern = "lingglosses.example.table", fileext = ".csv")
Expand Down
4 changes: 3 additions & 1 deletion docs/index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ gloss_example(transliteration = "bur-e-**ri** c'in-ne-sːu-w",

In this first example you can see that:

* the transliteration line is italic by default (if you do not want it, just add the argument `italic_transliteration = FALSE`);
* the transliteration line is italic by default (if you do not want it, just add the argument `italic_transliteration = FALSE`)[^ital-all];
* you can use standard markdown syntax (e.g. `**a**` for **bold**);
* the free translation line is automatically framed with quotation marks.

[^ital-all]: Sometimes it is make sense to set this option ones for the whole document using the following code `options("lingglosses.italic_transliteration" = FALSE)`.

Since the function arguments' names are optional in R, users can omit them as long as they follow the order of the arguments (you can always find the correct order in `?gloss_example`):

```{r}
Expand Down
233 changes: 99 additions & 134 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion man/gloss_example.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fbd1b26

Please sign in to comment.