Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore

This file was deleted.

23 changes: 0 additions & 23 deletions Dockerfile

This file was deleted.

23 changes: 1 addition & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.DEFAULT_GOAL := help

.PHONY: dev.clean dev.build dev.run upgrade help requirements
.PHONY: upgrade help requirements
.PHONY: extract_translations compile_translations
.PHONY: detect_changed_source_translations dummy_translations build_dummy_translations
.PHONY: validate_translations pull_translations push_translations install_transifex_clients

REPO_NAME := xblocks-contrib
PACKAGE_NAME := xblocks_contrib
EXTRACT_DIR := $(PACKAGE_NAME)/conf/locale/en/LC_MESSAGES
JS_TARGET := $(PACKAGE_NAME)/public/js/translations
Expand Down Expand Up @@ -37,26 +36,6 @@ piptools: ## install pinned version of pip-compile and pip-sync
requirements: piptools ## install development environment requirements
pip-sync -q requirements/dev.txt requirements/private.*

dev.clean:
-docker rm $(REPO_NAME)-dev
-docker rmi $(REPO_NAME)-dev

dev.build:
docker build --no-cache -t $(REPO_NAME)-dev $(CURDIR)

check-log:
@if [ ! -d "$(CURDIR)/var" ]; then \
echo "Creating var directory"; \
mkdir -p $(CURDIR)/var; \
fi
@if [ ! -f "$(CURDIR)/var/workbench.log" ]; then \
echo "Creating empty workbench.log"; \
touch $(CURDIR)/var/workbench.log; \
fi

dev.run: dev.clean dev.build check-log
docker run -p 8000:8000 -v $(CURDIR):/usr/local/src/$(REPO_NAME) --name $(REPO_NAME)-dev $(REPO_NAME)-dev

# XBlock directories
XBLOCKS=$(shell find $(shell pwd)/$(PACKAGE_NAME) -maxdepth 2 -type d -name 'conf' -exec dirname {} \;)

Expand Down
41 changes: 14 additions & 27 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ These are the XBlocks being moved here, and each of their statuses:
* ``lti`` -- Ready to Use
* ``pdf`` -- Done
* ``html`` -- Ready to Use
* ``discussion`` -- In Development
* ``problem`` -- In Development
* ``video`` -- In Development
* ``discussion`` -- Ready to Use
* ``problem`` -- Ready to Use
* ``video`` -- Ready to Use

The possible XBlock statuses are:

* Placeholder: It's just a cookiecutter thumbs-up block.
* In Development: We're building and testing this block.
* Ready to Use: You can try this on your site using the Waffle flag.
* Done The built-in block has been removed. The setup.py entrypoint has been removed from edx-platform and added to xblock-contrib.
* Done: The built-in block has been removed. The setup.py entrypoint has been removed from edx-platform and added to xblock-contrib.


Additional XBlocks that belong here
Expand All @@ -48,29 +47,19 @@ Over time, more XBlocks may be moved here. An XBlock belongs here if and only if
Otherwise, perhaps the block belongs in its own repository with a separate dedicated maintainer,
such as `ora2 <https://github.com/openedx/edx-ora2>`_.

Developing a new XBlock
=======================

There's a handy script ``utils/create_xblock.sh`` that you can use to create XBlock here. just run ::

$ utils/create_xblock.sh

It will ask for XBlock name and XBlock class name that you want to use. Just enter these values and XBlock should be ready to work.

If faced with permission or access error run::
Installation and Development Guide
**********************************

$ chmod +x utils/create_xblock.sh
Study scripts in the ``package.json`` file to understand the available commands.

and run it.
1. Install this repository into your runtime (for example ``openedx-platform``) as an editable dependency. For Tutor, you can mount this repository for local development.
2. Run ``npm run build`` to generate production public assets for the XBlocks.
3. Run ``npm run build-dev`` to generate development public assets for the XBlocks.
4. Run ``npm run watch-build-dev`` to watch for relevant file changes and regenerate public assets.
Recommended during development. Run it in a separate terminal; you will still need to refresh the browser to pick up rebuilt assets.
5. Run ``npm run test`` to run the repository tests.

Testing with Docker
********************

This XBlock comes with a Docker test environment ready to build, based on the xblock-sdk workbench. To build and run it::

$ make dev.run

The XBlock SDK Workbench, including this XBlock, will be available on the list of XBlocks at http://localhost:8000

Translating
*************
Expand All @@ -88,7 +77,7 @@ The general steps to provide multilingual messages for a Python program (or an X
3. Create language specific translations for each message in the catalogs.
4. Use ``gettext`` to translate strings.

5. Mark translatable strings
1. Mark translatable strings
----------------------------

Mark translatable strings in python::
Expand Down Expand Up @@ -184,8 +173,6 @@ transifex credentials.
See `transifex documentation <https://developers.transifex.com/docs/django-file-based>`_ for more details about integrating
django with transiflex.

**Note:** The ``dev.run`` make target will automatically compile any translations.

**Note:** To check if the source translation files (``.po``) are up-to-date run::

$ make detect_changed_source_translations
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {
"build": "npm run build --workspaces --if-present",
"build-dev": "npm run build-dev --workspaces --if-present",
"watch-build-dev": "for w in xblocks_contrib/*/assets; do npm run watch-build-dev --if-present -w \"$w\" & done; wait",
"test": "npm run test --workspaces --if-present",
"test-ci": "npm run test-ci --workspaces --if-present"
}
Expand Down
93 changes: 0 additions & 93 deletions utils/config.yaml

This file was deleted.

Loading
Loading