How to format codes in a "fashion/terminal" style

Hi everyone, I am trying to move from OneNote to joplin as today OneNote seems to have deleted all of my work notes (luckily I had a backup).

I have used an application to make the export and then the import from Joplin, but the format of every yaml / code has been lost, is there a way to copy and paste for example with this format?

Thank you everyone

In the markdown editor, you can use three backticks to create a code fence, and paste the code inside and it will be formatted as a code block.

In a code block, all indentation will be maintained and it will be rendered with monospace font and syntax highlighting):

```yaml
certificates:
	caDuration: 8760h
	caRenewBefore: 720h
	leafDuration: 720h
	leafRenewBefore: 360h
contour:
	listenIPFamily: IPv6
	logLevel: info
	pspNames: vmware-system-restricted
	replicas: 2
	resources:
		contour:
		limits:
		cpu:
		memory:
		requests:
		cpu:
		memory:
	service:
		ipFamilies: []
		ipFamilyPolicy:
	useProxyProtocol: false
envoy:
	hostNetwork: false
	hostPorts:
		enable: true
		http: 80
		https: 443
	listenIPFami1y: IPv6
	logLeve1: info
	pspNames :
	service:
		aws :
		LBType: classic
```

thank you very much, it works like a charm but It is only in markdown editor, I was using the other editor on the right because with markdown I can not see the images.
Is it not possible to have both of them I guess?

In the Rich text editor you can click the code block button on the formatting toolbar and paste the code inside the code block dialogue that appears:

The code blocks should appear in either editor, backtick code blocks will appear as code blocks in both the markdown viewer and rich text editor, and when you create a code block in the rich text editor (as in the above screenshots) they will be saved as markdown backtick code blocks behind the scenes (so they are really the same thing)

Thank you again bwat, I see I have to switch to markdown when I want to interact with words etc, and to rich when I want to interact with images. I feel really dumb I have to study more into it.

1. You can edit the content code of blocks in the rich text editor, but you have to double click on the code block to open the modal code block edit dialogue (this confused me at first as well lol)

2. If you want to see images in the markdown editor (without having to use the split view, or switch between the markdown edit/view modes, or switch to the rich text editor), you can use the rich markdown plugin: GitHub - CalebJohn/joplin-rich-markdown: Helping you ditch the markdown viewer for good.

NOTE: You'd need to go into the rich markdown plugins settings and check the box to "render images below their markdown source"

The rich markdown plugin also has an option to fade the markdown formatting characters

3. There's also the extra markdown editor settings plugin: GitHub - personalizedrefrigerator/joplin-plugin-extra-editor-settings: Adds additional settings to the Joplin note taking app's Markdown editor.

This one can completely hide most of the markdown formatting characters if you set the hide markdown setting to "some" or "more". It also allows image rendering in the markdown editor if you set the hide markdown setting to "more".

I use both of the above plugins (I use extra markdown editor settings to hide the markdown formatting, but I use rich markdown for image rendering because its image rendering works better)

yeah ahah it’s not very “easy” to be honest but I am liking It. Thank you I have tried your spec and it’s much better.
I still have to see all my notes again to clean many formatting characters and to format many other yaml, I will take my time