Small tool to create a theme from an exported customization


(Michael - DiscourseHosting.com) #1

We tend to create themes from within Discourse, editing them in the customize - themes section of the admin section of a forum, and converting them to a repository when we’re done.

To make the last part of this task a bit more easy, I made a small tool that takes a .dcstyle.json export and converts it to a repository with an about.json file and the common, mobile and desktop directories with HTML and CSS files.

The tool can be found here GitHub - discoursehosting/dcstyle-to-theme-repo
It can be run from the command line and takes one or two arguments.

The first argument is the name of the exported .dcstyle.json file. It will be converted to a theme with the same name (so example.dcstyle.json will create a directory called example)

The second argument is the URL of your forum. It will be used to download and store any assets your theme may contain. This argument is mandatory if your theme includes any uploaded files.

Usage: dcstyle-to-repo.rb <dcstyle-file> [forum URL]
  dcstyle-file is a theme file exported from Discourse
  forum-URL (optional) is the forum URL that can be used to download assets

(Jeff Atwood) #2

We still plan to do more work (by we I mean @sam plans to) on making theme sharing / exporting / importing easier than it is now, so do provide your feedback as you spend more time with the feature.