{"id":19319709,"url":"https://github.com/hyperoslo/knowledge_base","last_synced_at":"2025-04-22T17:32:06.617Z","repository":{"id":14785414,"uuid":"17507319","full_name":"hyperoslo/knowledge_base","owner":"hyperoslo","description":"Knowledge Base is a bunch of models for Ruby on Rails that you probably need to build your own","archived":false,"fork":false,"pushed_at":"2015-05-09T17:03:54.000Z","size":1130,"stargazers_count":31,"open_issues_count":1,"forks_count":10,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-16T20:57:25.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperoslo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-07T08:15:40.000Z","updated_at":"2023-07-10T18:57:44.000Z","dependencies_parsed_at":"2022-09-11T09:41:02.806Z","dependency_job_id":null,"html_url":"https://github.com/hyperoslo/knowledge_base","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fknowledge_base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fknowledge_base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fknowledge_base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fknowledge_base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperoslo","download_url":"https://codeload.github.com/hyperoslo/knowledge_base/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250287678,"owners_count":21405659,"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":[],"created_at":"2024-11-10T01:24:54.205Z","updated_at":"2025-04-22T17:32:06.146Z","avatar_url":"https://github.com/hyperoslo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Knowledge Base\n\n[![Gem Version](https://img.shields.io/gem/v/knowledge_base.svg?style=flat)](https://rubygems.org/gems/knowledge_base)\n[![Build Status](https://img.shields.io/travis/hyperoslo/knowledge_base.svg?style=flat)](https://travis-ci.org/hyperoslo/knowledge_base)\n[![Dependency Status](https://img.shields.io/gemnasium/hyperoslo/knowledge_base.svg?style=flat)](https://gemnasium.com/hyperoslo/knowledge_base)\n[![Code Climate](https://img.shields.io/codeclimate/github/hyperoslo/knowledge_base.svg?style=flat)](https://codeclimate.com/github/hyperoslo/knowledge_base)\n[![Coverage Status](https://img.shields.io/coveralls/hyperoslo/knowledge_base.svg?style=flat)](https://coveralls.io/r/hyperoslo/knowledge_base)\n\nKnowledge Base is a bunch of models for Ruby on Rails that you probably need to build your own.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'knowledge_base'\n\n... and then execute:\n\n    $ bundle\n\nInstall and run the migrations:\n\n    $ rake knowledge_base:install:migrations\n    $ rake db:migrate\n\nConfigure your routes:\n\n```ruby\n# config/routes.rb\nRails.application.routes.draw do\n  [...]\n\n  mount KnowledgeBase::Engine, at: '/knowledge_base'\nend\n```\n\nThat's it, you're done!\n\n## Usage\n\nAt its core, Knowledge Base is categories and articles. Its categories can have many articles,\nand each article can be in many categories.\n\nArticles consist of sections. Sections can be text, images, links, attachments and just about\nanything else you can imagine. Knowledge Base ships with over a dozen kinds of sections already,\nand you can check them out in `app/models/knowledge_base/sectionables/`.\n\n### Seeds\n\nDevelopment seeds are a nice way to populate your database with dummy content for styling\nand presentation purposes. You seed your database with categories and articles with a rake task:\n\n```bash\n$ rake knowledge_base:seed\n```\n\n... or include them in your own development seeds:\n\n```ruby\n# db/seeds/development.rb\nrequire 'knowledge_base/seeds'\n```\n\n## Configuration\n\n### CarrierWave\n\nSome sections have images or files in them, and Knowledge Base uses [CarrierWave](https://github.com/carrierwaveuploader/carrierwave)\nto upload them. It defaults to saving images to disk, but if you'd rather save them to the cloud you'll\nhave to configure it:\n\n```ruby\n# config/initializers/carrierwave.rb\nCarrierWave.configure do |config|\n  storage :fog\nend\n```\n\n### ActiveAdmin\n\nKnowledge Base ships with pretty good configuration for [ActiveAdmin](activeadmin.info), and you\nshould probably install it instead of writing your own:\n\n```bash\n$ rails generate knowledge_base:active_admin\n```\n\n### Custom styles\n\nOftentimes we notice the need for sectionables of the same type with different\nstyles. E.g. some text sectionables with black text and other text sectionables\nwith orange text. It just so happens that you can add custom styles to your\nsectionables through the configuration. Considering the scenario with black and\norange text sectionables, you would write something like this:\n\n```ruby\nKnowledgeBase.configure do |config|\n  config.section_styles = {\n    text: [ :black, :orange ]\n  }\nend\n```\n\nNow each text sectionable can be given an orange or a black style, which can be\naccessed like any other attribute on the sectionable. Using this attribute, you\ncould give the element a CSS class to achieve the correct styling:\n\n```\n\u003cdiv class=\"text \u003c%= @text.style %\u003e\"\u003e\n  \u003c%= simple_format @text.body %\u003e\n\u003c/div\u003e\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Credits\n\nHyper made this. We're a digital communications agency with a passion for good code,\nand if you're using Knowledge Base we probably want to hire you.\n\n## License\n\nKnowledge Base is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2Fknowledge_base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperoslo%2Fknowledge_base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2Fknowledge_base/lists"}