The project is in a healthy, maintained state
Instructure gem for migrating Canvas style rich content
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

 Project Readme

CanvasLinkMigration

CanvasLinkMigration processes html content from a Canvas export package and allows it to be retranslated into html with links to Canvas course content (ie Assignments, Quizzes, Content Pages etc).

Usage

Create a CanvasLinkMigrator::ImportedHtmlConverter using an asset_id_map (Get the asset_map from the Canvas API after a migration) and then pass in the html_string data to be imported.

First create the ImportedHtmlConverter, and then pass the html string into the converter's convert_exported_html method to get the final html product

If any links cannot be resolved appropriately, a list will be returned to you with the resolved html

converter = CanvasLinkMigrator::ImportedHtmlConverter.new(resource_map: asset_id_map)
new_html, missing_links = converter.convert_exported_html(html_string)

Use convert and resolve_content_links! separately if desired

Developing with Docker:

docker compose run --rm -v $PWD:/usr/src/app app bash
> bundle exec rspec
> gem build canvas_link_migrator.gemspec