Поиск в Поддержке

Избегайте мошенников, выдающих себя за службу поддержки. Мы никогда не попросим вас позвонить, отправить текстовое сообщение или поделиться личной информацией. Сообщайте о подозрительной активности, используя функцию «Пожаловаться».

Learn More

How to insert source code when composing message

  • 9 ответов
  • 1 имеет эту проблему
  • 5 просмотров
  • Последний ответ от Toad-Hall

more options

How does one insert a code block when composing a message in Thunderbird?

I'd like something like what you get in markdown using

~~~ code goes here ~~~

You get a fixed-width font, no wrap, and everything offset in a block with a different colored background.

Something like the code blocks shown at https://markdown-it.github.io/

Syntax highlighting is OK, as long as it can be disabled.

How does one insert a code block when composing a message in Thunderbird? I'd like something like what you get in markdown using ~~~ code goes here ~~~ You get a fixed-width font, '''no wrap''', and everything offset in a block with a different colored background. Something like the code blocks shown at [https://markdown-it.github.io/ https://markdown-it.github.io/] Syntax highlighting is OK, as long as it can be disabled.

Все ответы (9)

more options

You might try using HTML and highlight the code and click 'preformat' from the drop-down menu to the left of font selection. If you plan to write more text after the code block, press enter key a few times before entering the code block.

more options

That almost does what I want, but I can't figure out how to offset the code block from the rest of the message with a different colored background or some sort of frame.

more options

Try this: Insert/Table... make it 1x1, border = 3, bgcolor = <choose a color>, paste the text in the table, select the text, Format/Text Style, Code (see picture).

more options

It looks like the easiest option is to use some other tool (e.g. https://gitlab.com/saalen/highlight, or https://tohtml.com/, or emacs/markdown/preview, then copy/paste the result from the browser into thunderbird.

It would be cool if I could figure out how to get the output from an html-generating utility like highlight into the X11 selection/clipboard as HTML rather than plaintext (without having to preview it in a browser and copy it from the browser). I guess I need to figure out how X11 selection types work...

more options

For occasional use, I still think - highlighting the code - clicking preformat from menu - clicking a desired color

would work. However, if you do this frequently and have a preference on appearance, I would create a template that you could click to and then paste the code and see it appear exactly as desired. Include a section for text, one for code, and possibly one for following text. Basic HTML skills would do it. And sfhowe's example gives you a good start.

Изменено david

more options

> For occasional use, I still think > - highlighting the code > - clicking preformat from menu > - clicking a desired color

Any time I change the background color, it changes for the entire message. I can't get it to change for one paragraph.

> However, if you do this frequently and have a preference on appearance, I would create a > template that you could click to and then paste the code and see it appear exactly as desired. > Include a section for text, one for code, and possibly one for following text. Basic HTML skills > would do it. And sfhowe's example gives you a good start.

The documentation I've found about templates implies that the template is for an entire message.

How does one apply a template to a selected paragraph or to a paste operation?

more options

I meant setting the color for just the text, not the background.

On templates, yes, they are the entire message. You could set up multiple rows with formatting for text and one for code. Such entries expand automatically.

more options
I meant setting the color for just the text, not the background.

Ah I see.

On templates, yes, they are the entire message. You could set up multiple rows with formatting for text and one for code. Such entries expand automatically.

I'll have to think about how that could work. I don't know ahead of time how many blocks of code there will be or where they will be in relation to blocks of "normal" text.

more options

If you use tables to organise the structure then set the table background colour which is bgcolor.

Select to insert table and then use 'Advanced Edit' button set attribute as bgcolor and choose colour value.

If you already have created the table structure which contains tables or cells that hold paragraph Select the relevant table Format > Table > Table or cell background colour Select either table or cell as relevant. click on choose a colour box and select colour desired, click on ok to choose colour. Click on OK to insert colour into desired area.

Double clickon desired area of table/cell will also open the propertoes so you can use the Advanced edit. There are various options.

Изменено Toad-Hall