Giter Club home page Giter Club logo

docs.buf.build's Introduction

dev-docs

To get started, make sure you have node installed:

brew install node
make install

Running locally

To run a local dev server, simply run:

make

or

make run

This command starts a local development server on localhost:3000. The dev server will serve content dynamically, and should pick up most changes live without having to restart the serve.

To view the fully built product, you can run:

make serve

This command generates static content into the build directory, and then serves the static files on localhost. This will not update dynamically, but it will be identical to the deployed docs.

About the docusaurus setup

We are using version 2.0.0-beta.3 of docusaurus.

Authoring code blocks

The project extends the capabilities of docusaurus to render code blocks:

  • sh is recognized as an alias for bash and shell and enables shell script highlighting
  • proto is recognized as an alias for protobuf and enables protocol buffers source highlighting
  • terminal will use shell script highlighting, and:
    • strip $ from every line of code copied to the clipboard
    • allow console output following a command to be separated by a line with three dashes ---, and not copy only the part above this line to the clipboard
  • adding the suffix -nocopy to any language identifier will hide the Copy button

Badges in the sidebar

The project extends the docusaurus sidebar with badges.

To add a badge to a category, add the property customProps as follows:

{
  "type": "category",
  "label": "Remote Generation",
  "customProps": {
    "badge": {
      "label": "experimental",
      "severity": "danger"
    }
  },

To add a badge to an item, change the string id to a doc object. I.e. for "bsr/authentication":

{
  "type": "doc",
  "id": "bsr/authentication",
  "customProps": {
    "badge": {
      "label": "beta",
      "severity": "warning"
    }
  }
},

The properties label and severity are mandatory. The severity can be one of:

  • danger (red badge)
  • warning (yellow badge)
  • neutral (gray badge)
  • info (blue badge)

Note that long badge labels in combination with long item labels might cause a line break, which should be avoided for best usability.

Styling

All styles live in src/css/custom.css and CSS module files in src/theme/. If a style cannot be manipulated in custom.css as required, theme components can be overridden and wrapped.

docs.buf.build's People

Contributors

mfridman avatar johanbrandhorst avatar bufdev avatar amckinney avatar doriable avatar snikch avatar

Watchers

 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.