Title: | Academic Group Website Generator |
---|---|
Description: | Helps automate 'Quarto' website creation for small academic groups. Builds a database-like structure of people, projects and publications, linking them together with a string-based ID system. Then, provides functions to automate production of clean markdown for these structures, and in-built CSS formatting using CSS flexbox. |
Authors: | Michael Lydeamore [aut, cre] |
Maintainer: | Michael Lydeamore <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0.9000 |
Built: | 2024-10-24 13:03:03 UTC |
Source: | https://github.com/mikelydeamore/condensr |
Creates a quarto file for a given input staff member.
create_staff_member_page(staff_member, site_dir, staff_folder = "staff")
create_staff_member_page(staff_member, site_dir, staff_folder = "staff")
staff_member |
An object of class |
site_dir |
Directory of the website. |
staff_folder |
Subfolder in which the staff qmd files are stored.
Default "staff". Note that each template will be |
No return value, called to create a qmd file for the staff member.
example_staff_member <- staff_member( id = "example-id", name = "Example Name", description = "Example description for example staff member.", external_link = "http://www.example.com/", internal_link = FALSE ) create_staff_member_page(example_staff_member, tempdir())
example_staff_member <- staff_member( id = "example-id", name = "Example Name", description = "Example description for example staff member.", external_link = "http://www.example.com/", internal_link = FALSE ) create_staff_member_page(example_staff_member, tempdir())
Creates the necessary directories, high level files and structures for a condensr website.
create_website(dir, title)
create_website(dir, title)
dir |
Target directory for the website. |
title |
Title of the website. |
Under the hood, this function is creating a distill website (using
distill:::do_create_website
), and then overwriting some files with
condensr
specifics. These specific files are:
_site.yml - for site specific configurations
index.qmd - the home page of the website
staff_list.R - an example setup the condensr
staff, project and publication lists
staff/index.qmd - the template page that will list staff members
staff/joe-bloggs/index.qmd - an example page for the hypothetical staff member
No return value, called to create the skeleton structure of the website.
create_website(dir = tempdir(), "test_site")
create_website(dir = tempdir(), "test_site")
Generates the image, short description and linking-out buttons for use in a list of staff belonging to a group.
generate_markdown_for_member(member, extension = "png")
generate_markdown_for_member(member, extension = "png")
member |
An object of class |
extension |
Extension of the image file. Don't include the . |
No return value, function will output text directly into markdown
document using cat
.
example_staff_member <- staff_member( id = "example-id", name = "Example Name", description = "Example description for example staff member.", external_link = "http://www.example.com/", internal_link = FALSE ) generate_markdown_for_member(example_staff_member)
example_staff_member <- staff_member( id = "example-id", name = "Example Name", description = "Example description for example staff member.", external_link = "http://www.example.com/", internal_link = FALSE ) generate_markdown_for_member(example_staff_member)
Generate markdown block for codensr
projects.
generate_markdown_for_projects(project)
generate_markdown_for_projects(project)
project |
A |
No return value, function will output text directly into markdown
document using cat
.
example_project <- project( id = "joes-model", name = "Joe's Blogging Model", related_staff = "joe-bloggs" ) generate_markdown_for_projects(example_project)
example_project <- project( id = "joes-model", name = "Joe's Blogging Model", related_staff = "joe-bloggs" ) generate_markdown_for_projects(example_project)
Generate markdown block for codensr
publications.
generate_markdown_for_publications(publication)
generate_markdown_for_publications(publication)
publication |
A |
No return value, function will output text directly into markdown
document using cat
.
example_publication <- publication( title = "Joe's Blogging Paper", related_staff = c("joe-bloggs"), link = NA, citation = "Bloggs, J., Bloggy, Y. (2019), The power of blogging, Australian Journal of Bloggs, 43: 149-155.", date = as.Date("2019-01-01") ) generate_markdown_for_publications(example_publication)
example_publication <- publication( title = "Joe's Blogging Paper", related_staff = c("joe-bloggs"), link = NA, citation = "Bloggs, J., Bloggy, Y. (2019), The power of blogging, Australian Journal of Bloggs, 43: 149-155.", date = as.Date("2019-01-01") ) generate_markdown_for_publications(example_publication)
Generates an academic project to be listed on staff profiles
project(id, name, related_staff, link = NA)
project(id, name, related_staff, link = NA)
id |
A character string that uniquely identifies this project. |
name |
Human readable name for the project. |
related_staff |
Vector of |
link |
URL for the project. Default |
An object of class project
containing the input information.
example_project <- project( id = "joes-model", name = "Joe's Blogging Model", related_staff = "joe-bloggs" )
example_project <- project( id = "joes-model", name = "Joe's Blogging Model", related_staff = "joe-bloggs" )
Generates a publication object that is linked from staff websites
publication(title, related_staff, link, citation, date)
publication(title, related_staff, link, citation, date)
title |
Title of the publication. |
related_staff |
Vector of the |
link |
URL of the publication that will be linked. |
citation |
Text that will be displayed for this publication. |
date |
Date of publication. List of publications is sorted on the staff pages. |
An object of class publication
with 5 elements:
title
related_staff
link
citation
date
example_publication <- publication( title = "Joe's Blogging Paper", related_staff = c("joe-bloggs"), link = NA, citation = "Bloggs, J., Bloggy, Y. (2019), The power of blogging, Australian Journal of Bloggs, 43: 149-155.", date = as.Date("2019-01-01") )
example_publication <- publication( title = "Joe's Blogging Paper", related_staff = c("joe-bloggs"), link = NA, citation = "Bloggs, J., Bloggy, Y. (2019), The power of blogging, Australian Journal of Bloggs, 43: 149-155.", date = as.Date("2019-01-01") )
Copies a file from the rmarkdown/templates
folder to a target path
render_template( file, template_folder, target_path, output_name = NA, data = list() )
render_template( file, template_folder, target_path, output_name = NA, data = list() )
file |
File name to copy. |
template_folder |
Folder name of file. |
target_path |
Path to copy to. |
output_name |
Name of copies file. If |
data |
List of additional metadata. Must have at least element |
date
.Sorts a list for the column date
.
sort_list_by_date(list_to_sort)
sort_list_by_date(list_to_sort)
list_to_sort |
List to sort. Each element of the list must have column |
The sorted list.
Creates a staff member for use in an academic group website. On the list of
all staff members (by default in staff_list.Rmd
), the name
and
description
will be reported. In addition, an image, stored in
images/staff
with filename id.png
will be shown.
staff_member( id, name, description, external_link, internal_link = FALSE, email = NA )
staff_member( id, name, description, external_link, internal_link = FALSE, email = NA )
id |
String defining the unique identifier for a staff member. |
name |
Display name of staff member. |
description |
Short description, used on staff pages. |
external_link |
Link to an external website. |
internal_link |
Should an internal link be used? TRUE/FALSE |
email |
email address for the staff member. Used to pre-fill the templates. |
The external link will be the link in the "MORE" button on the rendered website.
An object of class staff_member
with the following elements:
id
name
description
external_link
internal_link
email
example_staff_member <- staff_member( id = "example-id", name = "Example Name", description = "Example description for example staff member.", external_link = "http://www.example.com/", internal_link = FALSE )
example_staff_member <- staff_member( id = "example-id", name = "Example Name", description = "Example description for example staff member.", external_link = "http://www.example.com/", internal_link = FALSE )