Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for linking to resources to the Markdown editor #536

Open
7 of 9 tasks
Tracked by #451
alicewriteswrongs opened this issue Aug 31, 2021 · 1 comment
Open
7 of 9 tasks
Tracked by #451
Labels

Comments

@alicewriteswrongs
Copy link
Contributor

alicewriteswrongs commented Aug 31, 2021

As a course author, I'd like to both embed 'resource' content and also link to it!

Currently we support embedding resources into Markdown via a 'resource' node ("resourceEmbed") which is written out to markdown as the resource shortcode. Currently this is a block-level node, meaning it can only be rendered at the top level (not, for instance, within a paragraph).

In addition to support a block-level embed (think an embedded video or something like that) we'd also like to support linking to resource content. These links should be inline-able within text content too, to support linking to resources freely within any part of the course content (see the 'Grading' section of this syllabus for an example: https://ocw.mit.edu/courses/chemistry/5-310-laboratory-chemistry-fall-2019/syllabus/).

To support this we should add a 'resource-link' node type to CKEditor, and serialize it to and from a resource_link shortcode. This will let us enforce different restrictions in the markdown editor for where these two nodes can be inserted, and it will also let us render them differently with Hugo.

Questions

  • Should we rename the existing shortcode from resource to resource-embed ?

Acceptance Criteria:

@alicewriteswrongs alicewriteswrongs self-assigned this Sep 1, 2021
alicewriteswrongs added a commit that referenced this issue Sep 29, 2021
This introduces a new dependency on our custom resource link plugin,
which is based on the code for CKEditor's standard link plugin. This
allows resource links to be inlined in the text rather than being block
nodes, by storing the UUID for the link as an attribute on a range of
text.

Resource links are translated to the `resource_link` shortcode, like
this:

```
{{< resource_link uuidforaresource "text inside the link" >}}
```

This change also required some changes to how we open the resource
picker and some related things. Now instead of having one 'Add resource'
button we now have 'Embed resource' and 'Link resource' buttons.
Together these make it a little less ambiguous for the user (at least,
that is the hope!)

closes #607
closes #612
part of #536
@alicewriteswrongs alicewriteswrongs removed their assignment Mar 22, 2022
@alicewriteswrongs
Copy link
Contributor Author

unassigning myself, I left some comments on #615 on how to go forward on that, and I think #616 is pretty straightforward to do (it should be fairly similar to toggling italic or bold on a span of text).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant