Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/instructure/canvas_link_migrator
- Owner: instructure
- Created: 2023-07-13T16:53:26.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-24T01:52:41.000Z (21 days ago)
- Last Synced: 2024-10-26T14:19:58.720Z (19 days ago)
- Language: Ruby
- Size: 93.8 KB
- Stars: 0
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```