hastexo / markdown-xblock

An Open edX XBlock allowing course authors to maintain content exclusively in Markdown
GNU Affero General Public License v3.0
7 stars 8 forks source link

Error: local variable 'content' referenced before assignment #4

Closed natea closed 3 years ago

natea commented 6 years ago

I'm trying to add Markdown to the "content area" but when I click save, it's showing this error message:

WE'RE HAVING TROUBLE RENDERING YOUR COMPONENT
Students will not be able to access this component. Re-edit your component to fix the error.

Error: local variable 'content' referenced before assignment

For the Filename field, it says, "Relative path to a markdown file uploaded to the static store. For example, "markdown_file.md".

Does that imply that I need to upload a file to a directory somewhere, or does this XBlock create that file for me and upload it to the static directory based on the content I paste into the content field?

fghaas commented 6 years ago

Hi Nate, it does not create that file for you. It expects for the file to sit in static, and the usual GridFS translation applies. So if you're importing a course from Git that has a markdown file in static/markdown/foo.md, then you'd refer to it as markdown_foo.md. We only ever used this XBlock in courses we maintained in Git.

However, we eventually moved away from this XBlock and went to offline Markdown-to-OLX pre-processing with olx-utils, which is at https://github.com/hastexo/olx-utils (and on PyPI).

fghaas commented 3 years ago

Closing this issue ahead of archiving this repo. Please see the README for similar functionality provided by a different XBlock.