sitebuilder.blogg.se

Codebox snippets
Codebox snippets








  1. #CODEBOX SNIPPETS HOW TO#
  2. #CODEBOX SNIPPETS CODE#
  3. #CODEBOX SNIPPETS SERIES#

#CODEBOX SNIPPETS CODE#

Add code to the snippet editorĪdd code in the snippet editor by typing or pasting. Obviously, which view you prefer is a matter of preference and has no bearing on the function of the code snippet. Clicking it gives you the option of the default text column width, a slightly expanded view, or a full-page width. Confluence calls this the “Go wide” button. In the upper-right corner of the code snippet editor is an icon that lets you widen the visual editor. Adjust the visual width of the code snippet editor You can see all the languages available in the official Confluence documentation. Once you’ve added the snippet, you’ll be presented with a code editor directly in your Confluence document, which includes line numbers and a dropdown menu allowing you to select a programming language for appropriate syntax highlighting. Select the programming language for syntax highlighting The code block macro can also be added with wiki markup syntax, like the following: Simply type: /code in your doc and you’ll see the “Code snippet” option pop up. You can also use a forward slash shortcut (or “slash command”) to trigger the in-editor context menu. Once you are in the edit mode for a page, you can click the “+” icon in the toolbar and select “Code snippet.”

#CODEBOX SNIPPETS HOW TO#

How to insert the code block macro in your pageĬonfluence’s page editor makes it easy to insert various types of content blocks, including a code snippet. They have a standardized template syntax to make them easy to use once they’re implemented. User macro access can be scoped for individual users or shared across the entire platform. They can be written and managed only by users with administrative privileges. User macros are built with custom code directly within the Confluence web app. Macros allow you to manipulate the formatting of your docs and add custom functionality.

codebox snippets

Writing user macrosĬonfluence can be extended with custom user macros beyond those provided by Atlassian. Various parameters can be used with the code block macro, including selecting the appropriate programming language, showing line numbers, and more. It can also be used to display command line interface actions and detailed logs from applications and services. The code block macro goes beyond source code. Pairing code directly with the documentation provides understanding beyond variables and classes, which is why the code block macro is a Confluence feature worth talking about. We believe context is king and that code is as much about the sum of the parts as it is about the parts themselves. Developers learn best when they can glean context from code and implementation details. Pages published with code snippets have the look and feel of a native IDE, including proper syntax highlighting, indentation, and presentation elements that can be customized with CSS.Ĭode blocks are a great way to provide context to readers and demonstrate using either hypothetical or real-world code fragments. The code block macro allows you to write or paste code directly into your Confluence pages.

codebox snippets

Macros can be repackaged into plugins, which include code bundles, resources, and configuration files that can either create new functionality or manipulate existing functionality within Confluence. They function like small applications that can accept parameters and change functionality based on those parameters. Macros can be written using HTML, proprietary XML tags, or the Java-based template engine, Apache Velocity. Popular built-in macros include Attachments, Google Drive, and the Table of Contents macro. When editing a document, macros are available via the “+” menu in the toolbar. What are Confluence macros?Ĭonfluence macros are extensions to the native functionality of Confluence pages.

#CODEBOX SNIPPETS SERIES#

This is part of our series of articles about Atlassian Confluence. There are several ways to add code to your Confluence docs. Inserting a code block is the best way to illustrate the what, how, and why of doing that. When writing technical documentation, it’s helpful to include code examples to provide meaningful context to the reader.įor example, you might want to show how a global variable is set and used throughout a particular flow in your code. Adding a code block or code snippet in Confluence is relatively quick and easy.










Codebox snippets