Re: Verbatim content (inline-special-block)

2024-04-12 Thread Ihor Radchenko
Max Nikulin  writes:

>> It may be enough to have @kbd{@code{...}} - it is not like Texinfo has a
>> concept of truly verbatim text like in Org.
>> 
>> Alternatively, we may allow two classes of inline markup:
>> @foo{parsed *text* inside}
>> and
>> @foo={verbatim *text* inside}/@foo~{verbatim *text* inside}
>> 
>> This way, instead of @code{}, we should use @code~{...} or even
>> @~{...}/@={...} (mnemonics for ~...~ and =...=)
>
> I consider @foo={}-like variants as unnecessary complications of the 
> inline special block feature. The idea of composition is better from my 
> point of view. With this approach it is enough to have non-conflicting 
> syntax for non-parsed fragments. I am against making @code{} a special 
> name with suppressed markup parsing. The price of composition in 
> comparison with @foo={} is more verbose markup.

Then, do you have an idea about such syntax?

One option I thought of was making @foo{=...=} a special type of boundary
delimiting non-parsing contents. However, it is not very elegant IMHO.

> By the way, Org has src_lang{...} syntax for almost non-parsed fragments 
> (neglecting requirement of balanced curly brackets that is an issue).

Yes, but it is handled differently by exporters from =verbatim=/~code~.
In fact, even the idea with @foo{@code{...}} may be problematic in this
regard - @code{...} inside, if we treat it as an equivalent of ~code~,
may be problematic if some export backends do something unusual about
code markup.

> Actually "=" in @foo={} is a kind of special argument distinct from ones 
> specified inside [] and {}.

Yes, but it is much easier to parse. If we use a proper attribute, we
run into all kind of issues with how consistent it should be with the
parsing rules for other attributes (should it be inherited? may it
appear in arbitrary place in [...]?). And if we make it special, we will
run in various special cases in the parser...

>>>   @code{def calculate(@param{expr}, @param{env})}
> [...]
>> Also, the reason why Texinfo users do @param in @code is the lack of
>> automatic syntax highlighting, unlike in Org mode.
>
> Is ox-texinfo able to convert syntax highlighting to native texinfo markup?

No.

> So if @markup{} is not allowed in verbatim content then it is another 
> feature loosely related to custom inline blocks.

May you elaborate?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Verbatim content (inline-special-block)

2024-04-12 Thread Max Nikulin

On 11/04/2024 19:58, Ihor Radchenko wrote:

Max Nikulin writes:

   @code{ unlike =code=, we can have leading and trailing spaces }
   @code{ @foo{is not interpreted inside}}


I think, it should be controlled by some optional parameter like

  @kbd[:verbatim t]{ unlike =code=, ... }


I do not like this idea - this will make the attribute list a part of
the Org markup spec,


I see you point and I agree that it is valid concern. On the other hand 
I do not have strong opinion what variant is better.



It may be enough to have @kbd{@code{...}} - it is not like Texinfo has a
concept of truly verbatim text like in Org.

Alternatively, we may allow two classes of inline markup:
@foo{parsed *text* inside}
and
@foo={verbatim *text* inside}/@foo~{verbatim *text* inside}

This way, instead of @code{}, we should use @code~{...} or even
@~{...}/@={...} (mnemonics for ~...~ and =...=)


I consider @foo={}-like variants as unnecessary complications of the 
inline special block feature. The idea of composition is better from my 
point of view. With this approach it is enough to have non-conflicting 
syntax for non-parsed fragments. I am against making @code{} a special 
name with suppressed markup parsing. The price of composition in 
comparison with @foo={} is more verbose markup.


By the way, Org has src_lang{...} syntax for almost non-parsed fragments 
(neglecting requirement of balanced curly brackets that is an issue).


Actually "=" in @foo={} is a kind of special argument distinct from ones 
specified inside [] and {}.



  @code{def calculate(@param{expr}, @param{env})}

[...]

Also, the reason why Texinfo users do @param in @code is the lack of
automatic syntax highlighting, unlike in Org mode.


Is ox-texinfo able to convert syntax highlighting to native texinfo markup?

So if @markup{} is not allowed in verbatim content then it is another 
feature loosely related to custom inline blocks.





Re: Verbatim content (inline-special-block)

2024-04-11 Thread Ihor Radchenko
Max Nikulin  writes:

>> - We should be able to define special markup for code, where the
>>   contents is not parsed. Something like
>> 
>>   @code{ unlike =code=, we can have leading and trailing spaces }
>>   @code{ @foo{is not interpreted inside}}
>
> I think, it should be controlled by some optional parameter like
>
>  @kbd[:verbatim t]{ unlike =code=, ... }

I do not like this idea - this will make the attribute list a part of
the Org markup spec, which I would like to avoid if possible:

1. External parsers would be forced to understand the attribute syntax,
   which will complicate Org markup spec.
2. Our own parser may have to account for attribute inheritance while
   parsing, which will complicate the parser too much.

The question remains how to define custom verbatim markup, of course.

It may be enough to have @kbd{@code{...}} - it is not like Texinfo has a
concept of truly verbatim text like in Org.

Alternatively, we may allow two classes of inline markup:
@foo{parsed *text* inside}
and
@foo={verbatim *text* inside}/@foo~{verbatim *text* inside}

This way, instead of @code{}, we should use @code~{...} or even
@~{...}/@={...} (mnemonics for ~...~ and =...=)

> Certainly parsing of normal Org markup should be suppressed,
> however I am less sure concerning @markup{}. In the following example 
> text inside @param{} may be emphasized:
>
>  @code{def calculate(@param{expr}, @param{env})}
>
> "@" inside such object may be escaped as @{@}. An alternatively is a 
> parameter like :parse that can have values like "markup", "custom", 
> "verbatim". This case "verbatim" disabled parsing of @objects().

AFAIU, you are referring to how Texinfo handles its @code{...} command,
where other texinfo commands are allowed, which is _conceptually_
different from how Org handles the verbatim/code - as a general rule,
all the "code" in Org mode syntax is taken verbatim (with the only
exception of src blocks where we have no choice).

Also, the reason why Texinfo users do @param in @code is the lack of
automatic syntax highlighting, unlike in Org mode.

I think that Org mode's equivalent of Texinfo @code should be either

1. inline src block
2. if direct markup is unavoidable, use something like
   @fixedwidth{@code{def calculate(}@param{expr}@code{, }@param{env}@code{)}}
   Most of the @code{..} can be safely dropped. It is just to illustrate
   the idea that we still parse the contents.

   In practice, things like
   *def* calculate(expr, env) "foo\alpha"
   will become
   @fixedwidth{*def@code{*} calculate(@param{expr}, @param{env}) 
"foo@code{\}alpha"}
   or
   @fixedwidth{\star{}def* calculate(@param{expr}, @param{env}) "foo\@@{}alpha"}

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Verbatim content (inline-special-block)

2024-04-11 Thread Max Nikulin

Ihor Radchenko. Re: Experimental public branch for inline special
blocks. Tue, 09 Apr 2024 08:52:38 +.
https://list.orgmode.org/875xwqj4tl.fsf@localhost


- We should be able to define special markup for code, where the
  contents is not parsed. Something like

  @code{ unlike =code=, we can have leading and trailing spaces }
  @code{ @foo{is not interpreted inside}}


I think, it should be controlled by some optional parameter like

@kbd[:verbatim t]{ unlike =code=, ... }

Certainly parsing of normal Org markup should be suppressed,
however I am less sure concerning @markup{}. In the following example 
text inside @param{} may be emphasized:


@code{def calculate(@param{expr}, @param{env})}

"@" inside such object may be escaped as @{@}. An alternatively is a 
parameter like :parse that can have values like "markup", "custom", 
"verbatim". This case "verbatim" disabled parsing of @objects().