Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-5172

Automatically handle shell prompt for shell/console code blocks

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Won't Fix
    • Major
    • None
    • None
    • docs-site-ui
    • 1

    Description

      After discussing it with Simon Dew and Richard Smedley, we tentatively agreed that writers should document commands that are intended to be copied and run by the user by placing them in source blocks with the shell or console language e.g. [source,shell].

      When commands use source blocks with the shell or console language, we want we want to apply the following rule:

      IF a code block is [source,shell/console] AND IF the [source,shell/console] code block starts with a prompt character ($, %, #, etc) THEN style the command using CSS in such a way that the prompt character cannot be selected (or copied by the copy-to-clipboard feature).

      This helps the user copy and paste a valid command.

      We have also considered adding an AsciiDoctor extension to strip any prompt character that begins a code block, AND IF the [source,shell/console] code block does not start with a prompt character ($, %, #, etc) THEN display the default $ character using the CSS style. An example of a similar behavior is given in the AsciiDoctor manual: https://asciidoctor.org/docs/user-manual/#tree-processor-example.

      However, see discussion below as to why this (stripping the prompt character, then adding it again using CSS) might not be a good idea.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              eric.schneider Eric Schneider (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty