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

21 use solution placement=right|bottom|none rather than format= attribute #37

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions pl-faded-parsons.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ def render_question_panel(element_html, data):
answers_name = get_answers_name(element_html)

format = pl.get_string_attrib(element, "format", "right").replace("-", '_')
format = pl.get_string_attrib(element, "solution-placement", format).replace("-", '_')
if format not in ("bottom", "right", "no_code"):
raise Exception(f"Unsupported pl-faded-parsons format: \"{format}\". Please see documentation for supported formats")
raise Exception(f"Unsupported pl-faded-parsons solution-placement: \"{format}\". Please see documentation for supported placements")

lang = pl.get_string_attrib(element, "language", None)

Expand Down Expand Up @@ -204,7 +205,7 @@ def get_code_lines():
if format == "right":
if pre_text or post_text:
raise Exception("pre-text and post-text are not supported in right (horizontal) mode. " +
'Add/set `format="bottom"` or `format="no-code"` to your element to use this feature.')
'Add/set `solution-placement="bottom"` or `solution-placement="no-code"` to your element to use this feature.')
size = "narrow"
elif format == "bottom":
size = "wide"
Expand Down