GithubHelp home page GithubHelp logo

isabella232 / doc-templates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googleapis/doc-templates

0.0 0.0 0.0 508 KB

Templates for creating reference documentation

License: Apache License 2.0

CSS 23.14% JavaScript 14.47% Smalltalk 23.73% C# 25.87% Shell 10.01% Python 2.77%

doc-templates's Introduction

doc-templates

This repository contains templates used to create refernce documentation for developers.google.com, cloud.google.com, and other sites.

Contributing

Docs

See the docs directory for additional documentation, like a code of conduct and an overall contributing guide.

Testing

When you run the tests, the HTML generated for the test will be stored at testdata/python-small/site/api. You can inspect the output manually to verify changes and add additional tests to prevent regressions.

In a Docker container (recommended)

You can run the tests in a Docker container using Trampoline V2 with the following command:

TRAMPOLINE_BUILD_FILE=./ci/run_tests.sh TRAMPOLINE_IMAGE=gcr.io/cloud-devrel-kokoro-resources/docfx ci/trampoline_v2.sh

If you need to update the golden test files, add the UPDATE_GOLDENS env var:

UPDATE_GOLDENS=1 TRAMPOLINE_BUILD_FILE=./ci/run_tests.sh TRAMPOLINE_IMAGE=gcr.io/cloud-devrel-kokoro-resources/docfx ci/trampoline_v2.sh

The Dockerfile for the docfx image is in googleapis/doc-pipline. Any updates to the Dockerfile should be made there.

Without using Docker

If you want to run the tests in your normal environment, not in a container:

  1. Install DocFX and put a docfx executable (possibly a script that calls mono /path/to/docfx.exe) on your path.

  2. Create and activate a virtual environment:

    python3 -m venv venv
    . ./venv/bin/activate
    
  3. Install dependencies:

    python3 -m pip install -r requirements.txt
    
  4. Run linters and tests:

    black --check tests
    flake8 tests
    
    pytest tests
    

    To update goldens add the --update-goldens flag:

    pytest --update-goldens tests
    

    Warning: your local docfx version and the container image version may differ, which may cause differences in golden files. The container version is canonical.

Source Code Headers

Every file containing source code must include copyright and license information. This includes any JS/CSS files that you might be serving out to browsers. (This is to help well-intentioned people avoid accidental copying that doesn't comply with the license.)

Apache header:

Copyright 2020 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

doc-templates's People

Contributors

dandhlee avatar fhinkel avatar justinbeckwith avatar lesv avatar tbpg 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.