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

[Request] SCDoc modal tag: post #6304

Open
prko opened this issue May 9, 2024 · 4 comments
Open

[Request] SCDoc modal tag: post #6304

prko opened this issue May 9, 2024 · 4 comments
Labels
comp: SCDoc scdoc syntax, parser, and renderer. for changes to schelp files, use "comp: help" enhancement

Comments

@prko
Copy link
Contributor

prko commented May 9, 2024

Motivation

There is currently no built-in way to display coloured text as in the Post window when including the Post window return in Help documents. The only way is to use images, which is unproductive.

Description of Proposed Feature

The block code shows the colour of the code:

code::
SinOsc.ar
::

Like this, it would be good to have a post tag.

Plan for Implementation

Unfortunately I do not know C++. If someone gives me instructions I could try it, otherwise we should wait for a developer who feels the same need.

@telephon
Copy link
Member

The coloring in the post window is currently quite inconsistent. So we need to fix that first. When you post something that has several lines, it will highlight the first line only, because it starts with a "->". I also find it inconvenient that the "->" is appended, because when you copy the code, you have to get rid of it in an extra step.

@capital-G
Copy link
Contributor

capital-G commented May 10, 2024

I really like this idea, and IMO it would be a good way to add an even more general div tag, which the current documentation lacks. This lack makes it difficult/impossible to create truly new designs for the docs, as the placement and appearance of individual blocks cannot be accessed or changed in a consistent way.

If we manage to introduce some kind of div wrapper with a class variable, any kind of visual or interactive could be handled in a traditional css or js way, as it seems less a matter of generating code from within scdocs, but an enhancement of the already generated output.

Myst has something like this as well: https://myst-parser.readthedocs.io/en/v0.17.1/syntax/optional.html#syntax-admonitions

@prko
Copy link
Contributor Author

prko commented May 10, 2024

@telephon

... So we need to fix that first. ....

Yes, even though I am used to it, the inconsistency sometimes confuses me. If the order of development is as you say, there is no other way but to wait...


@capital-G

IMO it would be a good way to add an even more general div tag, which the current documentation lacks.

The easiest way to do this is to enable the necessary HTML tags directly in SCDoc, without having to create SCDoc modal tags, which is done in cooperation between C++ (SCDoc.y, SCDoc.l, etc) and SCClasslibrary (SCDoc.sc and SCDocRenderer.sc) as in my recent PR:

SCDoc improvements: 3. Some HTML tags are enabled

However, I think none of the developers would see this as positive, as the SCDoc syntax will be ruined....

My PR #6265 may be based on my amateur experience of programming skills, but it is flexible. Also, considering that sclang is not the only syntax style, the direct use of HTML in SCDoc does not seem so bad.... Also, considering the speed of maintenance and development of SC..., hm...

@JordanHendersonMusic JordanHendersonMusic added the comp: SCDoc scdoc syntax, parser, and renderer. for changes to schelp files, use "comp: help" label May 10, 2024
@smoge
Copy link
Contributor

smoge commented May 10, 2024

If we manage to introduce some kind of div wrapper with a class variable, any kind of visual or interactive could be handled in a traditional css or js way, as it seems less a matter of generating code from within scdocs, but an enhancement of the already generated output.

A new syntax element that allows custom classes or IDs would require some change in the grammar (bison/flex files), but that could be minimal.

This could look something like "div::" classlist body "::", where classlist is a list of CSS classes or an ID.

divwrapper        ::= "DIV::" classlist body "::"
classlist         ::= { anyword COMMA } anyword
classlist ::= classname { COMMA classname }
classname ::= [a-zA-Z_][a-zA-Z0-9_-]*

Maybe something like this?

div:: special-style3
This is the content of the div element, which will be styled accordingly.
::

(sorry if I misunderstood)

EDIT: if we touch those files again, it would also be good to reintroduce the math:: tag.

@prko prko mentioned this issue May 19, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: SCDoc scdoc syntax, parser, and renderer. for changes to schelp files, use "comp: help" enhancement
Projects
None yet
Development

No branches or pull requests

5 participants