Coder Social home page Coder Social logo

zodsoft / protoc-gen-doc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pseudomuto/protoc-gen-doc

0.0 2.0 0.0 442 KB

Documentation generator plugin for Google Protocol Buffers

License: BSD 2-Clause "Simplified" License

Shell 0.66% Makefile 0.04% QMake 4.24% C++ 68.74% HTML 26.32%

protoc-gen-doc's Introduction

protoc-gen-doc

Travis Build Status Appveyor Build Status

This is a documentation generator plugin for the Google Protocol Buffers compiler (protoc). The plugin can generate HTML, DocBook or Markdown documentation from comments in your .proto files.

Installation

Writing Documentation

Use /** */ or /// comments to document your files. Comments for files go at the very top of the the file. Comments for enumerations, messages and services go before the message, enumeration or service definition. Comments for fields, enum values, extensions and service methods can go either before or after the definition. If a documentation comment begins with @exclude, the corresponding item will be excluded from the generated documentation.

Invoking the Plugin

The plugin is invoked by passing the --doc_out option to the protoc compiler. The option has the following format:

--doc_out=docbook|html|markdown|<TEMPLATE_FILENAME>,<OUT_FILENAME>[,no-exclude]:<OUT_DIR>

The format may be one of the built-in ones ( docbook, html or markdown) or the name of a file containing a custom Mustache template. For example, to generate HTML documentation for all .proto files in the proto directory into doc/index.html, type:

protoc --doc_out=html,index.html:doc proto/*.proto

The plugin executable must be in PATH or specified explicitly using the --plugin option in order for protoc to find it. If you need support for a custom output format, see Custom Templates. If you just want to customize the look of the HTML output, put your CSS in stylesheet.css next to the output file and it will be picked up. If the optional no-exclude flag is given, all @exclude directives are ignored.

Output Example

With the input .proto files

the plugin gives the output

Look in examples/Makefile to see how these outputs were built.

protoc-gen-doc's People

Contributors

arceye avatar estan avatar guozheng avatar mhaberler avatar murph0 avatar

Watchers

 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.