{"id":18514014,"url":"https://github.com/daddye/documents","last_synced_at":"2025-05-14T13:09:51.419Z","repository":{"id":66186195,"uuid":"8994028","full_name":"DAddYE/documents","owner":"DAddYE","description":"Document nubble FS","archived":false,"fork":false,"pushed_at":"2013-05-15T05:05:03.000Z","size":732,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-17T03:35:49.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DAddYE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-24T22:01:03.000Z","updated_at":"2015-11-05T18:57:24.000Z","dependencies_parsed_at":"2023-02-20T00:00:49.888Z","dependency_job_id":null,"html_url":"https://github.com/DAddYE/documents","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DAddYE%2Fdocuments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DAddYE%2Fdocuments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DAddYE%2Fdocuments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DAddYE%2Fdocuments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DAddYE","download_url":"https://codeload.github.com/DAddYE/documents/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149977,"owners_count":22022852,"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-06T15:41:43.878Z","updated_at":"2025-05-14T13:09:46.400Z","avatar_url":"https://github.com/DAddYE.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Document\n\nDocument is dead simple `db` based on documents, currently **markdown**\nand **yaml**.\n\nYou can see **Document** as the logic behind projects like [jekyll](mojombo/jekyll)\n\n## Features\n\n* Simple Query Syntax\n* Possibility to add `Metadata` to documents\n* Validations (you can validate metadata)\n* Easy API (pre-process, post-process, highlighting easy configurable)\n* Sections (extracts for you `H2` elements)\n* Syntax Highlighting (Github Markdown + Fenced Code Blocks)\n* Integrated WebServer\n* Mapping, you can map a directory to a class\n* Sprockets\n* Slim\n* Coffee-Script\n\n## Usage\n\nThe first thing to setup is your `root` of documents (`default to 'docs'`).\n\n```rb\nDocument::BASE_DIR = './my_documents'\n```\n\nYour folder can looks like:\n\n    |~docs/\n    | |+guides/\n    | |+pages/\n    | |+posts/\n    | `-index.md\n\nYou can query for your documents in an **ActiveRecord** style api:\n\n```rb\nDocument.all                 # =\u003e [#\u003cDocument:0x007f851f7f2be0 ...\u003e, ...]\ndoc = Document.find('index') # =\u003e #\u003cDocument:0x007f851f7f2be0 ...\u003e\ndoc.html\ndoc.metadata\ndoc.title\ndoc.mtime\ndoc.exipred?\ndoc.whatever # whatever you provided in metadata section\n```\n\n### Rendering\n\nYou can render your document with a [Git Flavored Markdown](https://help.github.com/articles/github-flavored-markdown) style.\n\n_Note at the moment, no tasks_\n\n### Syntax Highlighting\n\nSyntax Highlighting is provided with [Pygments.rb](https://github.com/tmm1/pygments.rb), so\nbasically you can highlight any language using fenced code blocks like:\n\n    ```js\n    function(){mine}\n    ```\n\n### Mapping\n\nYou can map your directories to a specific class for example post can have different validations,\nthan simple pages.\n\nSo if you have:\n\n    docs/posts/first.md\n\nYou can create a model with:\n\n```rb\nclass Post \u003c Document\n  attr_reader :date, :tags, :categories\n\n  def validate!\n    raise Invalid, 'Title must be present' unless metadata.has_key?('title')\n    raise Invalid, 'Author must be present' unless metadata.has_key?('author')\n    raise Invalid, 'Date must be present' unless metadata.has_key?('date')\n    raise Invalid, 'Categories must be present' unless metadata.has_key?('categories')\n\n    @tags       = metadata_array('tags')\n    @categories = metadata_array('categories')\n    @date       = metadata_date('date')\n  end\nend\n```\n\nNow you can query:\n\n```rb\nPost.find(:first)\nPost.all\n```\n\n### Metadata\n\nTo be valid your post should looks like\n\n    ---\n    title: My Title\n    date: 2013-03-24\n    categories: Foo, Bar\n    tags: [mine, foo] # yep, also a vanilla array is fine\n    ---\n\n    Here my post\n\n## Copyright\n\nCopyright (C) 2013 Davide D'Agostino - [@daddye](http://twitter.com/daddye)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and\nassociated documentation files (the “Software”), to deal in the Software without restriction, including without\nlimitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,\nand to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaddye%2Fdocuments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaddye%2Fdocuments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaddye%2Fdocuments/lists"}