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

Roles with data / parameters #7

Open
rowanc1 opened this issue Aug 2, 2020 · 4 comments
Open

Roles with data / parameters #7

rowanc1 opened this issue Aug 2, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@rowanc1
Copy link
Collaborator

rowanc1 commented Aug 2, 2020

I am wondering what the best way to add roles that have multiple attributes that need to be set, but no content. For example, creating a simple example for reactive document like (variables, displays and sliders):

image

# Hello World

```{variable}
:name: x
:value: 2
```

The value of x is {display}`value:x format:.1f`.

{range}`value:x min:0 max:10`

I am looking to suggest a format for the internals of a role, which I don't think are suggested at all by MyST.

Something like: attribute:value attribute2:value2?

I think the only overlap in functionality would be the glue role, but I don't think it has any arguments at the moment?

@rowanc1 rowanc1 added the enhancement New feature or request label Aug 2, 2020
@choldgraf
Copy link
Collaborator

choldgraf commented Aug 3, 2020

That's a great question - I feel like this one we should make sure to get everybody's input on, and then agree on a standard for all of the EBP roles. @chrisjsewell @AakashGfude @mmcky what do you think?

(I also renamed the issue to include the word "parameters" because I think this fits in a similar category)

@choldgraf choldgraf changed the title Roles with data Roles with data / parameters Aug 3, 2020
@AakashGfude
Copy link

AakashGfude commented Aug 3, 2020

To add to this issue. Roles with multiple attributes that also have content , is also a necessary feature to have. As indicated by @choldgraf in this PR jupyter-book/jupyter-book#837

I thnk in rst, it is achieved by declaring it beforehand to create specialized roles? :- https://docutils.sourceforge.io/docs/ref/rst/roles.html#specialized-roles

@chrisjsewell
Copy link
Contributor

Linking executablebooks/MyST-Parser#69

@choldgraf
Copy link
Collaborator

choldgraf commented Aug 3, 2020

oi I can't believe it's been 6 months since those conversations, I totally forgot about that issue.

Looking through the ideas there, what about something like:

  • {role}`content <option option key=val key="val w spaces">`

And have anything in < > parsed like a Python function would parse its inputs?

It piggy-backs on the current rST convention of < > to define a link. More generally, do we like the idea of having some kind of syntax to explicitly separate the "content" parts of the role from the "options" part of the role? (above, it is < > but could be something else like || or something)

rowanc1 added a commit that referenced this issue Oct 28, 2022
* 💬  Inline comments work

* 💬  commentIdFromString

* Add container element

* blockIdFromString

* DTO for comment always has a context
rowanc1 pushed a commit that referenced this issue Oct 28, 2022
Error on invalid cell types while parsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants