Giter Club home page Giter Club logo

docs-cb4's Introduction

Couchbase Documentation

The Couchbase Documentation Repository for Couchbase 4+ DITA based Docs

Contributing

A guide for contributing to the Couchbase Server Documentation can be found here.

HTML ID tags

All major content within the documentation should be annotated with ID tags to allow linking to specific sections of content within the documentation. These ID tags should match the title of the section, they must use alpha-numeric lower-case characters only and any spaces must be replaced with underscores.

Code Samples

Inclusion of code samples is an important aspect of our documentation. Code-samples within our documentation should be commited to the devguide-examples repository, and then the same code should be included within the documentation directly as a code block. These code-blocks should have a comment on the first line indicating the source of the code (in the format of a link to the specific file and lines on github). It is the responsibility of the person who changes a code sample to update all links to that code sample file. Note that the devguide-examples has a branch per major.minor version of the documentation starting with 4.5.

Code samples typically come in three flavors:

  1. One-liners, for example

    cb.upsert(docid, {'key1': 'value1'})
    

    This kind of example hints at proper usage, but does not entirely reflect what the operation does. it is understood that the text surrounding the example provides sufficient explanation

  2. Contextual, for example

    rv = cb.upsert(docid, {'key1': 'value1'}
    print rv
    # <OperationResult>...
    

    This kind of example might provide some additional information at how a specified API or operation works, and how it might be used in application code. The example is syntactically correct, but may not include all the required components for making it functional.

  3. Standalone, for example

    from couchbase.bucket import Bucket
    cb = Bucket('couchbase://localhost/default')
    rv = cb.upsert(docid, {'key1': 'value1'}
    print rv
    # ...
    

    This is a fully functional, standalone example which can be executed by a user. This may contain a significant amount of boilerplate (such as imports and other initialization code) needed to make the example standalone.

Examples of the standalone kind will live inside the devguide-examples repository. These examples should be copied over to DITA where necessary, but should be modified to be contextual so as not to confuse the reader. A link to the standalone example should be placed near the contextual example, so that a user may be able to further execute and play with the code.

There are no strict rules for where to place examples and what type they should be.

One-liners do not need to be sourced in real code, and are more similar to pseudocode (but are syntactically correct for the language being used).

The content in the devguide-examples repository is versioned by server version (TODO: how to version by SDK version? or perhaps just version that inside the filename?).

Documentation authors (i.e. SDK maintainers) should ensure that in-dita links to the examples refer to the versioned branches, and that fixes in documentation are reflected in both standalone and contextual examples

Rules on Content

Make sure all topics have a short description, as that is used not only to inform the reader about what is in this document, but it also goes in the meta description in the HTML. Google may use this as the snippet under a link in a search result. They recommend "a page's description meta tag might be a sentence or two or a short paragraph"

An anti-example:

This section bootstraps knowledge on completely asynchronous computations using the SDK."

Replaced with:

The Couchbase Java SDK has a complete asynchronous API based in part on RxJava. This section provides information on how the asynchronous API can be used, how it works with Java platform and RxJava features and the kinds of error handling you will need to consider in application development.

That may even be a little long, but this was for a long page. Note that it gets in keywords like Java and RxJava.

Generating Documentation

Docs are generated with DITA OT. Technically, we have a forked version of DITA OT. As of this writing, we know this exists but we don't quite know why it was forked and it was done without history. That's a todo for later.

Generating docs is done like this:

dita -f html5 -i cb-docs.ditamap -o ~/tmp/output/ -Deditlink.remote.ditamap.url=https://github.com/couchbase/docs-cb4/edit/master/content/cb-docs.ditamap

docs-cb4's People

Contributors

1tylermitchell avatar amarantha-k avatar amy-kurtzman avatar avsej avatar benofben avatar brett19 avatar bsubhashni avatar cihanb avatar daschl avatar dnault avatar eric-schneider avatar griels avatar ingenthr avatar jamesnocentini avatar jeffrymorris avatar jflath avatar maheshnagarajcbase avatar malarky avatar mattcarabine avatar mikegoldsmith avatar mnunberg avatar nosqlknowhow avatar richardsmedley avatar shilpalele avatar simon-dew avatar simonbasle avatar tim020 avatar tonyjhillman avatar westmann avatar willgardella avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.