From: Tim Cross <theophilusx@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Intention of verbatim text?
Date: Wed, 04 Jan 2023 05:58:20 +1100 [thread overview]
Message-ID: <86ilhnbd6t.fsf@gmail.com> (raw)
In-Reply-To: <4NmYHp2V9Nz6tmJ@submission01.posteo.de>
<c.buhtz@posteo.jp> writes:
> Hi,
>
> in org you can have inline verbatim and code text elements like this.
>
> Example with =verbatim= and ~code~.
>
> I would like to understand what "verbatim" really means. What is the
> semantic behind it? What content should go in there?
>
>
> I'm aware of the separation of content and its presentation.
> I'm also aware of the different renderings in my Emacs. Booth are
> monotype but with different colors.
>
> The org html export to create both with <code> tag. So in HTML output
> there is no difference between verbatim and code anymore.
>
> I also read a lot about the HTML tags code, pre, kbd and samp.
>
> I wonder that maybe I totally misunderstand the intention of
> "verbatim"?
>
> The background of my question is that I have my own
> org-to-html-converter [1] and try to decide how to treat =verbatim=.
> Which HTML tag should I use.
>
> Thanks
> Christian
>
> [1] -- <https://codeberg.org/buhtz/hyperorg>
IMO (and it is just my opinion, not that of the org developers), the
main use of verbatim (i.e. =text=) is to escape any further
interpolation as org markup. It basically says, when exporting, export
'as is' with no further processing.
Consider a situation where you want to write A_B, but don't want it to
be interpreted as A with a subscript B. There are a number of ways to
handle this. One is to set the #+OPTION to ^:nil and turn off the
behaviour for the whole file or you can use =A_B= to just turn it off
for that use (though this does have other possibly unintended
side-effects, such as a font change, but I'm really just trying to
illustrate the point here).
I would have to look more closely at the output of the HTML export to
verify your assertion that both verbatim and code are rendered the
same. With respect to 'phrases', I guess there is no real difference in
outcome. However, the standard HTML code tag does not preserve line
breaks. Traditionally, for blocks of code, the code tag would also be
wrapped in the pre tag. However, things have evolved and now it is much
more common to see just the code tag with an additional CSS class which
is used to manage the preservation of line breaks and whitespace. From a
purely tecnical 'correctness' standpoint, I would argue that =text=
should be rendered as <pre>text</pre> and not <code>text</code>. When
exporting data, we don't have any semantic markers/information for
=textg=, so wrapping it in a semantic tag like <code> is IMO incorrect
as we are imposing a semantic interpretation without justification. .
next prev parent reply other threads:[~2023-01-03 20:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 13:20 Intention of verbatim text? c.buhtz
2023-01-03 17:32 ` Daniel Fleischer
2023-01-03 18:58 ` Tim Cross [this message]
2023-01-04 7:50 ` c.buhtz
2023-01-04 8:25 ` Tim Cross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ilhnbd6t.fsf@gmail.com \
--to=theophilusx@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.