{"id":19886539,"url":"https://github.com/dahie/caramelize","last_synced_at":"2025-07-10T15:38:13.186Z","repository":{"id":1537591,"uuid":"1838419","full_name":"Dahie/caramelize","owner":"Dahie","description":"Tool to migrate legacy wikis/documentation to markdown git-repository retaining history and syntax.","archived":false,"fork":false,"pushed_at":"2025-04-01T10:36:03.000Z","size":244,"stargazers_count":10,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T03:35:46.497Z","etag":null,"topics":["conversion","gollum","markdown","mediawiki","obsidian-notes","pandoc","redmine","wiki","wiki-migration"],"latest_commit_sha":null,"homepage":"","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/Dahie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2011-06-02T17:38:19.000Z","updated_at":"2025-03-20T19:47:15.000Z","dependencies_parsed_at":"2024-02-10T11:20:39.323Z","dependency_job_id":"cd255e0d-19f0-4533-81a8-c7dfa68b7f90","html_url":"https://github.com/Dahie/caramelize","commit_stats":{"total_commits":105,"total_committers":2,"mean_commits":52.5,"dds":0.05714285714285716,"last_synced_commit":"b861d625290fb31c44ec66b42a75c9fdd7bb932f"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dahie%2Fcaramelize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dahie%2Fcaramelize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dahie%2Fcaramelize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dahie%2Fcaramelize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dahie","download_url":"https://codeload.github.com/Dahie/caramelize/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252071941,"owners_count":21690125,"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":["conversion","gollum","markdown","mediawiki","obsidian-notes","pandoc","redmine","wiki","wiki-migration"],"created_at":"2024-11-12T17:38:56.418Z","updated_at":"2025-05-02T16:32:00.489Z","avatar_url":"https://github.com/Dahie.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caramelize\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/7fe3ef34e09ba8133424/maintainability)](https://codeclimate.com/github/Dahie/caramelize/maintainability)\n\nCaramelize is a compact and flexible wiki migration tool. It is intended for easy transfer of content from legacy wikis. With caramelize you can create your own export configurations and migrate your page revisions into a git repository of markdown files. This retains all your history and you gain the most flexible access to your wiki content available for use with git-based wikis like [gollum](https://github.com/github/gollum), [Otter Wiki](https://github.com/redimp/otterwiki), [Wiki.js](https://js.wiki/) or [Obsidian](https://obsidian.md/).\n\nBy default, it ships with configurations for [WikkaWiki](http://wikkawiki.org/) and [Redmine](http://www.redmine.org/).\n\n\n## Usage\n\n### Installation\n\n```sh\n$ gem install caramelize\n```\n\nInstall the latest release of caramelize using RubyGems.\nRequires pandoc to be installed.\n\n### Use\n\n```sh\n$ caramelize create\n```\n\nCreates a template configuration file \"caramel.rb\". This includes documentation on how to use the preset Wiki-connectors and how to write addition customized connectors. More about this below.\n\n```sh\n$ caramelize run\n```\n\nWill start the wiki migration based on the configuration file. These are either found in predefined paths (./caramel.rb, ./config.rb, …), or passed as argument, as below.\n\n```sh\n$ caramelize doctor\n```\n\nCan be used to assess the quality of your wiki conversion. It'll help you see\nhow many wiki links may be broken and how many pages were orphaned.\n\n```sh\n$ caramelize help\n```\n\nReturns help information.\n\n```sh\n$ caramelize version\n```\n\nReturns version and release information.\n\n### Options\n\n```sh\n$ caramelize create --config my_caramel_configuration.rb\n```\n\nCreates an example configuration by the given name.\n\n```sh\n$ caramelize run --config my_caramel_configuration.rb\n```\n\nExecutes the given configuration.\n\n```sh\n$ caramelize --verbose [command]\n```\n\nDisplays more verbose output to the command line.\n\n## Content migration\n\n### Wiki support\n\nCaramelize comes with direct support for [MediaWiki](https://www.mediawiki.org), [WikkaWiki](http://wikkawiki.org/) and [Redmine](http://www.redmine.org/)-Wiki.\nMore custom wikis can be supported by creating a suitable configuration file.\n\nThe wiki is exported to markdown files in a git-repository. This can be directly used as source for [gollum](https://github.com/github/gollum) wiki, [Otter Wiki](https://github.com/redimp/otterwiki), or if you don't care about the history even [Obsidian](https://obsidian.md/). \nThis gives you the flexibility of having all wiki pages exported as physical files, while keeping the history and having an easy and wide-supported way of access.\n\nSince wiki software may have special features, that are not common among other wikis, content migration may always have a loss of style or information. Caramelize tries to support the most common features.\n\n* Page meta data\n  * title\n  * content body\n  * author name\n  * author email address\n  * date\n  * revisions\n* Markup conversion to markdown\n  * limited to \"simple\" formatting, excluding complex formats such as tables\n  * conversion using regular expressions -\u003e somewhat easy to learn and extend\n\n### Configuration recipes\n\nThe `lib/caramelize/caramel.rb` configuration contains the settings on how to import the data of the existing wiki and how to convert it into the format required by caramelize to export to gollum.\nYou also find the predefined definitions for importing from WikkaWiki and Redmine and and example for a custom import.\n\nCustom import allows you to import data from wikis that are not natively supported by caramelize. Defining your own wiki import requires a bit of knowledge on Ruby and MySQL as you setup the access to your wiki database and need to define how the data is to be transformed. Depending on the database model of the wiki this can be one simple call for all revisions in the database, or it can get more complicated with multiple mysql-calls as the database becomes more complex.\n\nFor a custom wiki you need to create a `wiki` instance object, that receives the necessary database creditials.\n\n```ruby\nwiki = Caramelize::InputWiki::Wiki.new(host: \"localhost\",\n                                    username: \"user\",\n                                    database: \"database_name\",\n                                    password: 'monkey',\n                                    markup: :wikka})\n```\n\nThis example ignores custom markup conversion and assumes WikkaWiki-markup.\n\nOnce the object is established we need to hook in a method that defines how revisions are read from the database and how they are processed.\n\n```ruby\nwiki.instance_eval do\n    def read_pages\n        sql = \"SELECT id, tag, body, time, latest, user, note FROM wikka_pages ORDER BY time;\"\n        revisions, titles = [], []\n        results = database.query(sql)\n        results.each do |row|\n            titles \u003c\u003c row[\"tag\"]\n            author = authors[row[\"user\"]]\n            page = Page.new({id: row[\"id\"],\n                        title:   row[\"tag\"],\n                        body:    row[\"body\"],\n                        markup:  'wikka',\n                        latest:  row[\"latest\"] == \"Y\",\n                        time:    row[\"time\"],\n                        message: row[\"note\"],\n                        author:  author})\n            revisions \u003c\u003c page\n    end\n    # titles is the list of all unique page titles contained in the wiki\n    titles.uniq!\n    # revisions is the list of all revisions ordered by date\n    revisions\nend\n```\n\nIn the end the `wiki` instance needs the `titles` and `revisions` filled.\n\nSome wikis don't have all necessary metadata saved in the revision. In this case additional database queries are necessary. **The configuration recipe is pure ruby code, that is included on execution. This gives you a lot of freedom in writing your configuration, but also a lot of power to break things. Be advised.**\n\nI'm happy to give support on your recipes and I'd also like to extend caramelize with more wiki modules, if you send in your configurations (minus database credentials of course).\n\n### Building\n\nThis is how you can build caramelize, in case you'd like to develop it further. To get startered you'll need Bundler.\n\n```sh\n$ gem install bundler\n```\n\nClone or fork this repository and start building.\n\n```sh\n$ git clone git@github.com:Dahie/caramelize.git\n$ gem build caramelize.gemspec\n```\n\nNow to build and package the gem do\n\n```sh\n$ rake build\n```\n\nor\n\n```sh\n$ rake install\n```\n\nto install the new gem right to your system.\n\nTests run with\n\n```sh\n$ rspec\n```\n\n## Contributing to caramelize\n\n* Check out the latest main to make sure the feature hasn't been implemented or the bug hasn't been fixed yet\n* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it\n* Fork the project\n* Start a feature/bugfix branch\n* Commit and push until you are happy with your contribution\n* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.\n\n## Copyright\n\nCopyright (c) 2011-2024 Daniel Senff. See LICENSE.md for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdahie%2Fcaramelize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdahie%2Fcaramelize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdahie%2Fcaramelize/lists"}