Ruka hadi maudhui kuu

Tafuta

Andika neno au swali ili kutafuta makala za msaada.

Jinsi ya kuweka kodi yenye rangi na kitufe cha kunakili kwenye makala

Kwenye makala hii

Wapi: Stories → All stories → The story editor

Open this page: admin.<your-site>/articles (replace <your-site> with your site address). Then open the one you want.

Hatua

  1. Open the story in the editor.
  2. Put the cursor where the code should go.
  3. Open the Insert menu and choose Vizuizi zaidi, then Kizuizi cha msimbo.
  4. Paste or type the code.
  5. Choose the language from the language list so the colours are right. Choose Maandishi ya kawaida if you do not want colours.
  6. Publish the story.

For the full list of block options, see Code and maths.

Muhimu kujua

  • Languages you can pick: Plain text, Bash, C, C++, C#, CSS, Dart, Diff, Dockerfile, Go, GraphQL, HTML, INI, Java, JavaScript, JSON, Kotlin, Less, Lua, Makefile, Markdown, Objective-C, Perl, PHP, PowerShell, Python, R, Ruby, Rust, SCSS, Shell session, SQL, Swift, TOML, TypeScript, XML and YAML.
  • Nakili msimbo. On the website, each code block has a Nakili msimbo button. It shows up when the reader's browser allows copying.
  • Msimbo wa ndani. For one word or a short command inside a sentence, use the Msimbo wa ndani mark in the toolbar instead.
  • You can put a code block inside a Callout, a Toggle or a Column.
  • Don't paste secrets. Never put passwords, keys or tokens in a story. Readers can see everything you publish.

Maswali

Maswali yanayoulizwa mara kwa mara

Can readers run the code?

No. The block only shows and copies code.

Can I keep the code out of search snippets?

Yes. Blocks have a "no snippet" choice in the block actions. See Story SEO.

Zinazohusiana

Maoni

Je, hii imekusaidia?

Inapatikana pia katika

Bado unahitaji usaidizi?