Package index
Classes
R6 Classes that parse and manipulate Lesson content based on the {tinkr} yarn class. All of the public-facing operations take place through the methods in these classes.
-
Lesson
- Class to contain a single Lesson by the Carpentries
-
Episode
- Class representing XML source of a Carpentries episode
-
validate_headings()
heading_tests
heading_info
headings_first_heading_is_second_level()
headings_greater_than_first_level()
headings_are_sequential()
headings_have_names()
headings_are_unique()
- Validate headings
-
validate_links()
allowed_uri_protocols
link_known_protocol()
link_enforce_https()
link_all_reachable()
link_img_alt_text()
link_length()
link_descriptive()
link_source_list()
link_internal_anchor()
link_internal_file()
link_internal_well_formed()
link_tests
link_info
- Validate Links in a markdown document
-
validate_divs()
div_is_known()
KNOWN_DIVS
div_tests
div_info
- Validate Callout Blocks for sandpaper episodes
-
throw_heading_warnings()
throw_div_warnings()
throw_link_warnings()
- Throw a validation report as a single message
-
collect_labels()
- Collect and append validation messages
-
issue_warning()
pb_message()
line_report()
append_labels()
message_muffler()
- Issue a warning via CLI if it exists or send a message
-
get_headings()
show_heading_tree()
- Get all headings in the XML document
-
get_lesson()
- Get a carpentries lesson in XML format
-
lesson_fragment()
- Example Lesson Fragments
-
make_heading_table()
- Create a table for headings
-
make_link_table()
- Create a table of parsed URLs from a single Episode object.
-
make_div_table()
- Create a table of divs in an episode
[Internal] functions for Episode methods
Functions in this category serve as internal functions that the corresponding methods in the Episode
class.
-
get_challenges()
- Gather challenges from the XML body of a carpentries lesson
-
get_solutions()
- Gather solutions from the XML body of a carpentries lesson
-
isolate_elements()
- Isolate elements in an XML document by source position
[Internal] Div Utilities
These functions help parse, clean, and label divs (both pandoc fenced divs and HTML divs) in the document for parsing.
-
get_divs()
- Get paired div blocks
-
find_between_tags()
- Find nodes between two nodes with a given dtag
-
label_div_tags()
find_div_tags()
clear_div_labels()
- Add labels to div tags in the form of a "dtag" node with a paired "label" attribute.
-
make_div_pairs()
- Create a data frame describing the divs associated with nodes.
-
find_div_pairs()
- Make paired labels for opening and closing div tags
-
clean_div_tags()
- Clean the div tags from an xml document
-
clean_fenced_divs()
- Clean pandoc fenced divs and place them in their own paragraph elements
-
trim_fence()
- Trim div fences from output
[Internal] Kramdown Parsers, Accessors, and Translators
Styles-era Carpentries lessons used kramdown syntax, which has a very different set of features (such as postfix tags and liquid templating) that require extra post-processing. These functions processed this syntax and offerd ways of translating it to the more common pandoc syntax. (Note, this is a non-exhaustive list).
-
fix_links()
find_broken_links()
fix_broken_links()
make_link_patterns()
get_link_fragment_nodes()
fix_broken_link()
links_within_text_regex()
text_to_links()
make_link()
find_between_nodes()
- Find and fix unresolved template links within an Episode XML body
-
fix_sandpaper_links()
- Fix relative and jekyll links to be compatible with sandpaper
-
fix_liquid_relative_link()
- Remove spaces in relative links with liquid variables
-
make_pandoc_alt()
- Add alt text to images when transforming from jekyll to sandpaper
-
set_alt_attr()
- Set the alt text for a nodeset of images
-
get_blocks()
- Gather blocks from the XML body of a carpentries lesson
-
get_code()
- Get code blocks from xml document
-
liquid_to_commonmark()
- Convert liquid code blocks to commonmark code blocks
-
elevate_children()
- elevate all children of a node
-
kramdown_tags()
- Find all kramdown tags within the document
-
set_ktag_block()
- add the kramdown tags as attributes of special blocks
-
are_blocks()
- test if the children of a given nodeset are kramdown blocks