{"id":45579455,"url":"https://github.com/growler/go-slate","last_synced_at":"2026-02-23T11:34:06.321Z","repository":{"id":57498487,"uuid":"117457519","full_name":"growler/go-slate","owner":"growler","description":"A CLI tool to generate API documentation using Slate layout by Robert Lord","archived":false,"fork":false,"pushed_at":"2023-02-25T07:42:36.000Z","size":925,"stargazers_count":24,"open_issues_count":4,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-12T02:04:32.610Z","etag":null,"topics":["api","api-documentation","slate","static-site-generator"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/growler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-14T18:54:52.000Z","updated_at":"2025-02-20T13:35:56.000Z","dependencies_parsed_at":"2024-06-20T09:22:58.249Z","dependency_job_id":"2ccb6f2a-5cb3-41d3-8e26-6e1d7f2c5d7c","html_url":"https://github.com/growler/go-slate","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/growler/go-slate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growler%2Fgo-slate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growler%2Fgo-slate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growler%2Fgo-slate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growler%2Fgo-slate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/growler","download_url":"https://codeload.github.com/growler/go-slate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growler%2Fgo-slate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29741630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-documentation","slate","static-site-generator"],"created_at":"2026-02-23T11:34:05.794Z","updated_at":"2026-02-23T11:34:06.313Z","avatar_url":"https://github.com/growler.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-slate\n\ngo-slate is a CLI tool to generate API documentation using brilliant [Slate](https://github.com/lord/slate) layout \nby [Robert Lord](https://github.com/lord). go-slate contains bundled Slate (including Kittn API Example Documentation) \nand requires no additional software to install.\n\ngo-slate can also generate a Go package with embedded documentation to include into Go binary. \nA simple HTTP(S) server to serve rendered documentation is also provided.\n\n## Why\n\nSlate is arguably the best tool around to quickly hack an API documentation which\nwill look really good. However it uses Ruby `bundler` and brings loads of software\nwhich did not go well with my Mac. Besides, I really got used to Go _all you need is\na single binary_ way of things. \n\nThere were also [Hugo DocuAPI theme](https://github.com/bep/docuapi) (based on Slate, too), \nbut it has its own drawbacks, mostly because of different ways middleman and backfriday render \ncontents.  \n\nSo I quickly hacked go-slate.\n\n## Installation\n\n```text\n$ go get -u github.com/growler/go-slate\n```\n\n## How to start\n\nAssuming following source tree\n\n    src\n    └── service\n        ├── main.go\n        └── apidoc\n\nthe typical usage would be:\n\n1. Extract template content\n\n```bash\ngo-slate extract src/service/apidoc contents\n```\n\n2. Now edit `apidoc/index.html.md` and add following lines to your `main.go`:\n\n```go\n//go:generate go-slate package apidoc internal/apidoc\n\npackage main\n\nimport (\n    \"net/http\"\n    \"fmt\"\n    \"service/internal/apidoc\"\n)\n\nfunc main() {\n    http.HandleFunc(\"/help/\", apidoc.HTTPHandlerWithPrefix(\"/help\"))\n    //...\n    if err := http.ListenAndServe(\":8080\", nil); err != nil{\n        fmt.Println(err)\n    }\n}\n```\n\n3. Generate package with embedded documentation\n\n```bash\ngo generate service\ngo build service\n```\n\n3. Enjoy beautiful documentation at `http://service:8080/help/`\n\n## Usage\n\n```bash\ngo-slate [command]\n```\n\nAvailable commands:\n\n    help        Help about any command\n    extract     extracts slate files bundled with go-slate to specified directory\n    package     produces an embeddable package with rendered documentation content and HTTP handler\n    site        renders documentation from source directory to output directory\n    server      serves rendered API documentation over HTTP(S)\n    version     prints version\n\n## Extact \n\n```bash\ngo-slate extract [directory] [components to extract...]\n```\n\nExtracts Slate files bundled with go-slate to a specified directory.\nWith none components supplied, extracts only slate example documentation \nproject content (Markdown files). Otherwise, a specified list of components will be \nextracted. The component name might be either file name or one of\n\n- all\n- contents\n- layouts\n- stylesheets\n- javascripts\n- images\n\nTo list bundled Slate contents, use `go-slate extract -l`\n\n## Rendering commands options\n\nCommands `site`, `package` and `server` render content and share a set of options\n\n`--no-minify css|jss|html|all`\n\nDisables compact output for a specific type of content. Multiple options can be listed with comma.\n\n`--logo`\n\nDefines a logo file to use, overriding default or setting in [document preamble](#slate-preamble-options). \nUse word `none` to disable logo block completely.\n\n`--rtl` and `--no-rtl`\n\nEnables or disable Right-to-left scripts support, overriding default (no) or setting in [document preamble](#slate-preamble-options). \n\n`--search` and `--no-search`\n\nEnables or disable Slate search block, overriding setting in [document preamble](#slate-preamble-options). \n\n`--style file`\n\nLoads an SCSS style to adjust Slate styles. Note that this adds to, and not override [document preamble](#slate-preamble-options)\noption `style`.  A list of available variables can be obtained by `go-slate extract . stylesheets/_variables.scss`\n\n## Site\n\n```bash\ngo-slate site [source directory] [output directory] [flags]\n```\n\nRenders documentation to a destination.\n\n## Package\n\n```bash\ngo-slate package [source directory] [resulting package directory] [flags]\n```\n\nProduces an embeddable Go package using [go-imbed](https://github.com/growler/go-imbed)\n\n`--pkg name`\n\nBy default, `package` takes package name from the last path item of resulting package directory. This option\nsets package name explicitly.\n\n`--work-dir directory`\n\nBy default, `package` renders content in a temporary directory and removes it afterwards. This option tells\n`go-slate` to use specified directory and keep content afterwards.\n\n## Server\n\n```bash\ngo-slate server [source directory] [address to listen at] [flags]\n```\n\nStarts an HTTP server listening at the specified address and serving rendered content.\n\n`--tls-cert file` and `--tls-key file`\n\nIf both options are specified, server will serve HTTPS.\n\n`--monitor-changes`\n\nMonitor changes of source content and re-render if necessary. Any rendering error will be printed\nto stdout.\n\n(A neat trick: `go-slate server \u003cempty directory\u003e :8080` will serve the Slate example Kittn API Documentation)\n\n## Slate preamble options\n\n`go-slate` supports Slate preamble options:\n\n```yaml\n# document title\ntitle: API Reference \n\n# must be one of supported by https://github.com/alecthomas/chroma\nlanguage_tabs: \n  - shell\n  - ruby\n  - python\n  - javascript\n\n# a list of footers to place under TOC navigation menu\ntoc_footers:  \n  - \u003ca href='#'\u003eSign Up for a Developer Key\u003c/a\u003e\n  - \u003ca href='https://github.com/lord/slate'\u003eDocumentation Powered by Slate\u003c/a\u003e\n\n# a list of files to include from includes directory.\n# files must be named as includes/_\u003cname\u003e.md\nincludes:\n  - errors\n\n# enable search block\nsearch: true \n```\n\nIn addition, `go-slate` defines a few others:\n\n```yaml\n# a logo file to use. file must be located \n# in directory images. Use `none` to disable logo\nlogo: logo.png    \n\n# enable RTL support\nenable_rtl: true  \n\n# use code highlight style, must be supported by  https://github.com/alecthomas/chroma\nhighlight_style: monokai\n\n# plain html to add to html \u003chead\u003e _before_ all Slate stylesheets and javascripts references\nhtml_premble: |\n    \u003clink rel=\"stylesheet\" href=\"https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css\"\u003e\n\n# An SCSS header to adjust Slate CSS\n# A list of available variables can be obtained by go-slate extract . stylesheets/_variables.scss\nstyle: |\n    %default-font {\n      font-family: \"Fira Code\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n      font-size: 14px;\n    }\n    \n```\n\n## What go-slate is not\n\n`go-slate` solves a very basic task and tries to be as simple and unobtrusive as possible. It is not, by any \nmean, a generic site generator. Use [Hugo](https://gohugo.io/) for that.\n\n## License\n\nThe MIT License, see [LICENSE.md](LICENSE.md).\n\nThe embedded [Slate](https://github.com/lord/slate) is licensed under Apache 2.0 License, which can be\nextracted with `go-slate extract . LICENSE` command.\n\n# Special thanks\n\n- [Slate](https://github.com/lord/slate) for the great API documentation layout\n- [Hugo DocuAPI theme](https://github.com/bep/docuapi) for inspiration\n- [Blackfriday](https://github.com/russross/blackfriday) Mardown engine for Go\n- [Chroma](https://github.com/alecthomas/chroma) the syntax highlighter for Go\n- [go-libsass](https://github.com/wellington/go-libsass) the [LibSass](http://sass-lang.com/libsass) Go bindings\n- [Steve Francia](https://github.com/spf13) for cobra, pflags and afero\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrowler%2Fgo-slate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrowler%2Fgo-slate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrowler%2Fgo-slate/lists"}