{"id":18910008,"url":"https://github.com/jonasbn/docker-cheatset","last_synced_at":"2025-04-15T06:31:04.177Z","repository":{"id":37934803,"uuid":"262763536","full_name":"jonasbn/docker-cheatset","owner":"jonasbn","description":"Docker encapsulation of the cheatset command for generating Docsets for the Dash.app","archived":false,"fork":false,"pushed_at":"2025-04-08T04:42:44.000Z","size":196,"stargazers_count":6,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T04:48:37.023Z","etag":null,"topics":["cheatset","dashapp","docker","docker-encapsulation","docker-image","dockerhub","docsets","ruby"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/jonasbn/cheatset","language":"Ruby","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/jonasbn.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","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":"2020-05-10T10:36:03.000Z","updated_at":"2025-04-08T04:42:47.000Z","dependencies_parsed_at":"2024-01-29T17:07:45.017Z","dependency_job_id":"a46622c6-1403-48ca-9a95-0c9fc9cf4e18","html_url":"https://github.com/jonasbn/docker-cheatset","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fdocker-cheatset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fdocker-cheatset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fdocker-cheatset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fdocker-cheatset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonasbn","download_url":"https://codeload.github.com/jonasbn/docker-cheatset/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249020719,"owners_count":21199606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cheatset","dashapp","docker","docker-encapsulation","docker-image","dockerhub","docsets","ruby"],"created_at":"2024-11-08T09:38:57.233Z","updated_at":"2025-04-15T06:31:03.851Z","avatar_url":"https://github.com/jonasbn.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker encapsulation of cheatset\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/jonasbn/cheatset.svg?style=flat)](https://hub.docker.com/r/jonasbn/cheatset/)\n\n`cheatset` ([GitHub][cheatsetgithub]) is a Ruby application for generating documentation sets (Docsets) for **[Dash.app][dashapp]**, primarily focused on cheat sheets.\n\nThis repository is a Docker encapsulation for `cheatset` for those of us, who generate Docsets, but do not have a Ruby toolchain available or want the hassle of maintaining one.\n\nBased on this repository you can either:\n\n- Download a prebuilt image from DockerHub, based on the contents of this repository\n- Or you can build your own based on the contents of this repository (please skip to the Build the image section)\n\n## Specification\n\nThe Docker image is based on [the official Ruby Docker image][dockerhubruby], using the latest 2.5 version available of this image. See the `Dockerfile` for details.\n\nIt is based on the _larger_ image, not the _slim_ version since the dependencies of `cheatset` require compilation of C-based libraries.\n\n### A note on DockerHub\n\nThe images are build from the GitHub repository master branch.\n\nThe recommended use is to use the latest release with a version tag. See `Changelog.md` for details. Whereas the tag `latest` just reflect the latest build based on the master branch.\n\nThe master branch might contain changes not tagged as released yet and can be regarded as _unstable_ or _experimental_. Changes such as corrections to documentation etc. will not be tagged until separately as a general rule, unless the changes are significant, but the aim is to keep the documentation relevant and up to date.\n\n## Run the Image\n\nThe prebuilt `cheatset` Docker image is [available on DockerHub][dockerhubcheatset], or you can build it yourself based on this repository, see the section below on building.\n\n```bash\n$ docker pull jonasbn/cheatset:0.16.0\n$ docker run --rm --volume $PWD:/tmp jonasbn/cheatset:0.16.0\n```\n\nAnd if you are want the latest build:\n\n```bash\n$ docker pull jonasbn/cheatset:latest\n$ docker run --rm --volume $PWD:/tmp jonasbn/cheatset:latest\n```\n\nAs mentioned `latest` can be considered _unstable_ or _experimental_. Development is kept in branches, but new experimental features might make into master for wider evaluation.\n\nWith a single argument:\n\n```bash\n$ docker run --rm --volume \"$PWD\":/tmp -it --name cheatset jonasbn/cheatset help\nCommands:\n  cheatset generate FILE   # Generates cheat sheet out of a file\n  cheatset help [COMMAND]  # Describe available commands or one specific command\n```\n\nWith two arguments:\n\n```bash\n$ docker run --rm  -it --name cheatset jonasbn/cheatset help generate\nUsage:\n  cheatset generate FILE\n\nGenerates cheat sheet out of a file\n```\n\nNow lets generate something:\n\n```bash\ndocker run --rm  -it --volume $PWD:/tmp --name cheatset jonasbn/cheatset generate sample.rb\n```\n\nAnd in our directory a `Sample.docset` directory appears.\n\nDo note the `Sample.docset` was lifted from the [cheatset GitHub repository][cheatsetgithub] and is under respective copyright under the referenced repository and available under the MIT license.\n\nThis can be imported into **Dash.app**:\n\n1. Open **Dash.app**\n1. If you have the \"Manage Docsets\" available click that (or open a tab by clicking `+`)\n1. Click `+` below the docsets\n1. Pick \"Add Local Docset\" and navigate to the directory of you recently generated `Sample.docset`\n1. Open it and it should now be listed in your left column, click on it a you should be good to go\n\nRemember that upon regenerating you have to repeat the above steps, since changes are not automatically detected and imported, which mean that you can evaluate changes, without changing your other additions, which is also a good thing.\n\n### Using an alias\n\nThe Docker invocation is a bit tedious, so it is recommended to either create a shell wrapper or a shell alias.\n\n```bash\n# run cheatset docker image in current directory and cleanup the image afterwards\n$ alias cheatset='docker run --rm --volume \"$PWD\":/tmp -it --name cheatset jonasbn/cheatset'\n```\n\nTry it out:\n\n```bash\n$ cheatset\nCommands:\n  cheatset generate FILE   # Generates cheat sheet out of a file\n  cheatset help [COMMAND]  # Describe available commands or one specific command\n```\n\n## Build the image\n\n```bash\n$ docker build -t jonasbn/cheatset .\n```\n\nNow that you have build the image, you can skip back to the \"Run the image\" section, which demonstrates how to use it.\n\n## Incompatibilities\n\n### Return status indicating success when unable to parse arguments\n\n`cheatset` uses the Ruby Gem [`thor`](https://rubygems.org/gems/thor) for command line argument parsing.\n\n`thor` returns `0` when not able to parse the provided arguments.\n\nThere is hope that this might get addressed since `0` normally would indicate error. With the introduction of the warning from: `thor`.\n\n```text\nDeprecation warning: Thor exit with status 0 on errors. To keep this behavior, you must define `exit_on_failure?` in `Cheatset::CLI`\nYou can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.\n```\n\nSee also the related [issue on GitHub](https://github.com/rails/thor/issues/244).\n\n## Diagnostics\n\n### `ERROR: \"cheatset generate\" was called with no arguments`\n\nThe complete error:\n\n```text\nERROR: \"cheatset generate\" was called with no arguments\nUsage: \"cheatset generate FILE\"\nDeprecation warning: Thor exit with status 0 on errors. To keep this behavior, you must define `exit_on_failure?` in `Cheatset::CLI`\nYou can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.\n```\n\n1. You have to specify a Docset file (Ruby), eg. `sample.rb`\n\n```bash\ndocker run --rm  -it --volume $PWD:/tmp --name cheatset jonasbn/cheatset generate sample.rb\n```\n\nSee also the Incompatibilities section.\n\n### `No such file or directory`\n\n```text\nTraceback (most recent call last):\n        10: from /usr/local/bundle/bin/cheatset:23:in `\u003cmain\u003e'\n         9: from /usr/local/bundle/bin/cheatset:23:in `load'\n         8: from /usr/local/bundle/gems/cheatset-1.4.0/bin/cheatset:6:in `\u003ctop (required)\u003e'\n         7: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'\n         6: from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'\n         5: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'\n         4: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'\n         3: from /usr/local/bundle/gems/cheatset-1.4.0/lib/cheatset/cli.rb:26:in `generate'\n         2: from /usr/local/bundle/gems/cheatset-1.4.0/lib/cheatset/cli.rb:26:in `new'\n         1: from /usr/local/bundle/gems/cheatset-1.4.0/lib/cheatset/dsl/context.rb:5:in `initialize'\n/usr/local/bundle/gems/cheatset-1.4.0/lib/cheatset/dsl/context.rb:5:in `read': No such file or directory @ rb_sysopen - dzil.rb (Errno::ENOENT)\n```\n\n1. Due to the mounting of a volume, You cannot specify an arbitrary path to the Docset file.\n1. You have to work directly in the directory containing the Docset file\n\n```bash\ndocker run --rm  -it --volume $PWD:/tmp --name cheatset jonasbn/cheatset generate sample.rb\n```\n\nYou can _possibly_ adjust the Docker invocation accordingly.\n\n## Acknowledgements\n\n- Jun Xiong (@suredream), indirect contributor\n\n- Jakub Holý (@holyjak), contributor\n\n- Bogdan Popescu (@kapeli), author of `cheatset` and **Dash.app**\n\n## Resources and References\n\n- [GitHub: cheatset][cheatsetgithub]\n- [Dash.app][dashapp]\n- [DockerHub: cheatset][dockerhubcheatset]\n- [DockerHub: Ruby][dockerhubruby]\n- [Blog post by Andrew Lock: \"Packaging CLI programs into Docker images to avoid dependency hell\"](https://andrewlock.net/packaging-cli-programs-into-docker-images-to-avoid-dependency-hell/)\n\n[cheatsetgithub]: https://github.com/Kapeli/cheatset\n[dashapp]: https://kapeli.com/dash\n[dockerhubcheatset]: https://hub.docker.com/r/jonasbn/cheatset\n[dockerhubruby]: https://hub.docker.com/_/ruby\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbn%2Fdocker-cheatset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonasbn%2Fdocker-cheatset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbn%2Fdocker-cheatset/lists"}