Code Blocks
The Theneo web editor's Code Block widget allows you to easily insert code snippets into your documentation. Syntax highlighting is supported for a wide range of programming languages, making your code snippets clear and easy to understand.
To insert a code snippet:
- Navigate to a new line in the Theneo web editor where you want the code block to appear.
- Type
/codeto trigger the widget selection menu. - Choose 'Code Block' from the list of widgets.
- Select the programming language from the drop-down menu to apply syntax highlighting.
- Paste or type your code into the code block.
Here's an example of a formatted code snippet in JavaScript:
JavaScript
// Theneo API Magic Elixir Mixerfunction createElixir(elixirName, ingredients) {
console.log(Creating ${elixirName} Elixir with the following ingredients:);
ingredients.forEach((ingredient, index) => {
console.log(${index + 1}. ${ingredient});
});
console.log(${elixirName} Elixir is ready to empower your API!);
}// Mix a 'Restful Rejuvenation' elixir for your API
createElixir('Restful Rejuvenation', ['REST', 'JSON', 'OAuth 2.0', 'CORS']);Was this section helpful?
What made this section unhelpful for you?
On this page
- Code Blocks