github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/tools/cmd/present/doc.go (about)

     1  // Copyright 2011 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  /*
     6  Present displays slide presentations and articles. It runs a web server that
     7  presents slide and article files from the current directory.
     8  
     9  It may be run as a stand-alone command or an App Engine app.
    10  
    11  Usage of present:
    12    -base="": base path for slide template and static resources
    13    -http="127.0.0.1:3999": HTTP service address (e.g., '127.0.0.1:3999')
    14    -nacl=false: use Native Client environment playground (prevents non-Go code execution)
    15    -orighost="": host component of web origin URL (e.g., 'localhost')
    16    -play=true: enable playground (permit execution of arbitrary user code)
    17  
    18  The setup of the Go version of NaCl is documented at:
    19  https://golang.org/wiki/NativeClient
    20  
    21  To use with App Engine, copy the tools/cmd/present directory to the root of
    22  your application and create an app.yaml file similar to this:
    23  
    24      application: [application]
    25      version: [version]
    26      runtime: go
    27      api_version: go1
    28  
    29      handlers:
    30      - url: /favicon.ico
    31        static_files: present/static/favicon.ico
    32        upload: present/static/favicon.ico
    33      - url: /static
    34        static_dir: present/static
    35        application_readable: true
    36      - url: /.*
    37        script: _go_app
    38  
    39      # nobuild_files is a regexp that identifies which files to not build.  It
    40      # is useful for embedding static assets like code snippets and preventing
    41      # them from producing build errors for your project.
    42      nobuild_files: [path regexp for talk materials]
    43  
    44  Present then can be tested in a local App Engine environment with
    45  
    46      goapp serve
    47  
    48  Input files are named foo.extension, where "extension" defines the format of
    49  the generated output. The supported formats are:
    50  	.slide        // HTML5 slide presentation
    51  	.article      // article format, such as a blog post
    52  
    53  The present file format is documented by the present package:
    54  http://godoc.org/golang.org/x/tools/present
    55  */
    56  package main // import "golang.org/x/tools/cmd/present"