Edit Links is an Open edX plugin application that provides a way to embed links to the course content stored in Git repositories as HTML files in the Open Learning XML format.
The plugin implements an openedx-filters pipeline that hooks into the VerticalBlockChildRenderStarted event on the VerticalBlock XBlock on platform. The pipeline modifies the HTML content of HTMLBlock blocks and appends necessary html to add an "Edit on Git" link on top of each child block of the VerticalBlock.
In order for this plugin to be used effectively the course content should be stored in a public repostiory in the Open Learning XML format. This allows the plugin to link each section of the course content to it's corresponding HTML file by automatically appending the filenames to the base URL of the repository.
- Install the plugin by adding git+https://github.com/open-craft/openedx-edit-links.git to your EDXAPP_EXTRA_REQUIREMENTS of your deployment.
- Make sure you have the latest version of openedx-filters installed as well.
The plugin can be configured by adding custom settings to your deployment's lms.yml.
- Configure the plugin variables by setting the the following 2 values
- EDIT_LINKS_PLUGIN_GIT_REPOS - a map of course ids and the correspondint Git urls. This urls used here would be considered as the base of the course folder of the course content. For eg.,
EDIT_LINKS_PLUGIN_GIT_REPOS = { "course-v1:my+awesome+course": "https://gitlab.com/awesome-course/-/tree/master/course/", "course-v1:foss+course+2022": "https://gitlab.com/foss-course/-/tree/master/2022/course/", }- EDIT_LINKS_PLUGIN_GIT_EDIT_LABEL - an OPTIONAL configuration which lets you specify the word to use in the links "Edit on <label>". Defaults to Git.
EDIT_LINKS_PLUGIN_GIT_EDIT_LABEL = "Gitlab"
Configure openedx-filters to run the plugin's pipeline
OPEN_EDX_FILTERS_CONFIG = { "org.openedx.learning.vertical_block_child.render.started.v1": { "fail_silently": False, "pipeline": [ "edit_links.pipeline.AddEditLink" ] } }
Note: The base URL in the configuration should point the OLX course directory in your Git repo. The plugin adds "/html/<filename.html>" to take the user to the relevant file.
# Clone the repository git clone git@github.com:open-craft/openedx-edit-links.git cd openedx-edit-links # Set up a virtualenv using virtualenvwrapper with the same name as the repo and activate it mkvirtualenv -p python3.8 openedx-edit-links
# Activate the virtualenv workon openedx-edit-links # Grab the latest code git checkout main git pull # Install/update the dev requirements make requirements # Run the tests and quality checks (to verify the status before you make any changes) make validate # Make a new branch for your changes git checkout -b <your_github_username>/<short_description> # Using your favorite editor, edit the code to make your change. vim … # Run your new tests pytest ./path/to/new/tests # Run all the tests and quality checks make validate # Commit all your changes git commit … git push # Open a PR and ask for review.
Clone the repository to your /edx/src/ folder
Install the plugin inside your lms container
make lms-shell pip install -e /edx/src/openedx-edit-links
Add the necessary configuration (as mentioned in the "Configuration" section above) to your edx-platform/lms/envs/private.py
Restart the lms container to ensure everything is loaded make lms-restart
The code in this repository is licensed under the AGPL 3.0 unless otherwise noted.
Please see LICENSE.txt for details.
Contributions are very welcome.
Please read How To Contribute for details.
Even though they were written with edx-platform in mind, the guidelines
should be followed for all Open edX projects.
The pull request description template should be automatically applied if you are creating a pull request from GitHub. Otherwise you can find it at PULL_REQUEST_TEMPLATE.md.
The issue report template should be automatically applied if you are creating an issue on GitHub as well. Otherwise you can find it at ISSUE_TEMPLATE.md.
Please do not report security issues in public. Please email security@edx.org.
If you're having trouble, we have discussion forums at https://discuss.openedx.org where you can connect with others in the community.
Our real-time conversations are on Slack. You can request a Slack invitation, then join our community Slack workspace.
For more information about these options, see the Getting Help page.