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
- Open the story in the editor.
- Put the cursor where the code should go.
- Open the Insert menu and choose Vizuizi zaidi, then Kizuizi cha msimbo.
- Paste or type the code.
- Choose the language from the language list so the colours are right. Choose Maandishi ya kawaida if you do not want colours.
- 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.