(Obsolete) Small tool to create a theme from an exported customization

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 - communiteq/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
13 Likes

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.

3 Likes

Discourse now natively supports import and export of themes in a .tar.gz format, following exactly the same file/folder structure as git themes. So after the next stable release, this conversion tool should no longer be required :slight_smile: .

https://github.com/discourse/discourse/commit/afd449089f471c7e849d97e192414b0f03bc1e18

13 Likes

:tada: :clap: :tada: :clap: :tada: :clap: :tada: :clap:

5 Likes