Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/instructure/canvas_link_migrator

A ruby gem to migrate html with links to canvas content
https://github.com/instructure/canvas_link_migrator

Last synced: 8 days ago
JSON representation

A ruby gem to migrate html with links to canvas content

Awesome Lists containing this 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

```ruby
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
```