Code

Inline code

Monospace text formatting is typically used to represent text shown in computer terminals or code editors (often referred to as a codespan).

Like other inline text formatting, you can add multiple emphasis styles to monospace text as long as the syntax is placed in the correct order.

Code blocks

Basic code block (console)

A code block with [source,console].
Optional title
A code block with a title.

Language code block

{
  "name": "module-name",
  "version": "10.0.1",
  "description": "An example module to illustrate the usage of package.json",
  "author": "Author Name <author@example.com>",
  "scripts": {
    "test": "mocha",
    "lint": "eslint"
  }
}
Language code block w/ title
{
  "name": "module-name",
  "version": "10.0.1",
  "description": "An example module to illustrate the usage of package.json",
  "author": "Author Name <author@example.com>",
  "scripts": {
    "test": "mocha",
    "lint": "eslint"
  }
}
Language code block w/ hidden language
public class CurrentDateTime {
    public static void main(String[] args) {
        LocalDateTime current = LocalDateTime.now();

        System.out.println("Current Date and Time is: " + current);
    }
}
// Language code block with no title and hidden language name
public class CurrentDateTime {
    public static void main(String[] args) {
        LocalDateTime current = LocalDateTime.now();

        System.out.println("Current Date and Time is: " + current);
    }
}

Line wrapping

Line wrapping is turned off by default
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Code block w/ forced wrapping
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Text formatting (variables)

DESCRIBE KEYSPACE_NAME.TABLE_NAME

Replace the following:

  • KEYSPACE_NAME: The name of the keyspace that contains the table you want to migrate.

  • TABLE_NAME: The name of the table that contains the data you want to migrate.

Callouts

vfs
  .src('js/vendor/*.js', { cwd: 'src', cwdbase: true, read: false })
  .pipe(tap((file) => { (1)
    file.contents = browserify(file.relative, { basedir: 'src', detectGlobals: false }).bundle()
  }))
  .pipe(buffer()) (2)
  .pipe(uglify())
  .pipe(gulp.dest('build'))
1 The tap function is used to wiretap the data in the pipe.
2 Wrap each streaming file in a buffer so the files can be processed by uglify. Uglify can only work with buffers, not streams.

Listing and literal blocks

Listing blocks and literal blocks display the text you write exactly as you see it in the source. Literal text is treated as preformatted text. The text is presented in a fixed-width font and endlines are preserved. Only special characters and callouts are replaced when the document is converted.

The only meaningful difference between a listing block and a literal block is that you can turn a listing block into a code block and apply syntax highlighting.

Listing block

When a line begins with one or more spaces it is displayed as a listing block.
This is a delimited _listing_ block.

The content inside is displayed as <pre> text.
Optional title
This is a delimited _listing_ block with a title.

Literal block

This is a delimited _literal_ block.
Optional title
This is a delimited _literal_ block with a title.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com