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

[DISC] Create a new role specific to this extension #3

Closed
najuzilu opened this issue Sep 29, 2020 · 1 comment
Closed

[DISC] Create a new role specific to this extension #3

najuzilu opened this issue Sep 29, 2020 · 1 comment

Comments

@najuzilu
Copy link
Member

najuzilu commented Sep 29, 2020

Currently, I can get the directives referenced under two scenarios:

  1. The exercise directive is enumerable, the directive can be referenced through the numfig role. The following options are supported:
    1. {numfig}`label` displays "Exercise #"
    2. {numref}`some text %s <label>` displays "some text #"
    3. {numref}`some text {number} <label>` displays "some text #" which is identical to the example in (i)
  2. The directive is unenumerable - either :nonumber: has been introduced in the exercise directive or referencing a solution directive. There is no default href text because the only option supported is the following:
    1. {ref}`some text <label>` .
      I'm looking at the possibility of fixing/debugging {ref}`label` which currently doesn't work. It looks like this option works for figure if you set a caption which is set only by increasing the line number (still a bit confused about this implementation 👀)

These options are also identical to the options for referencing math typesets in sphinxcontrib-proof. They are made available through the std (Standard) domain which is where ref and numref roles reside. In order to control the behavior of ref for exercises and solution, it is my understanding that we'd have to override the ref role with a new one. I'm not sure if this can be done or whether it is a good idea.

If we would like to keep the behavior described in sphinxcontrib-prettyproof#18, I think the best way forward would be to create a new role specific to referencing exercise and solution directives.

Would appreciate suggestions and feedback on this one.

@najuzilu
Copy link
Member Author

najuzilu commented Oct 6, 2020

Decided to go with the default ref and numref instead. There's no need to go with a specific role since the behavior mentioned above has already been taken care of through the default roles.

@najuzilu najuzilu closed this as completed Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant