<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2008-04-22:10</id>
  <title>Dreamwidth Development</title>
  <subtitle>Dreamwidth Open Source Development</subtitle>
  <author>
    <name>Dreamwidth Open Source Development</name>
  </author>
  <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom"/>
  <updated>2013-06-17T06:36:23Z</updated>
  <dw:journal username="dw_dev" type="community"/>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:143629</id>
    <author>
      <name>Cocoa</name>
    </author>
    <dw:poster user="momijizukamori"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/143629.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=143629"/>
    <title>Data and query structure for faceted styles search</title>
    <published>2013-06-17T05:31:40Z</published>
    <updated>2013-06-17T06:36:23Z</updated>
    <category term="styles"/>
    <dw:security>public</dw:security>
    <dw:reply-count>12</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='momijizukamori' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://momijizukamori.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://momijizukamori.dreamwidth.org/'&gt;&lt;b&gt;momijizukamori&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I have been researching this, and while I've found a lot of articles on how to set up faceted searching using existing search engines (mostly Solr, though a few with Sphinx), and a bunch of articles on frontend design for faceted search.... there is not a lot on optimizing data structure or queries that I can find. And I know basically nothing about code optimization so - tossing this out here!&lt;br /&gt;&lt;br /&gt;&lt;span class="cut-wrapper"&gt;&lt;span style="display: none;" id="span-cuttag___1" class="cuttag"&gt;&lt;/span&gt;&lt;b class="cut-open"&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class="cut-text"&gt;&lt;a href="https://dw-dev.dreamwidth.org/143629.html#cutid1"&gt;Data structures&lt;/a&gt;&lt;/b&gt;&lt;b class="cut-close"&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style="display: none;" id="div-cuttag___1" aria-live="assertive"&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="cut-wrapper"&gt;&lt;span style="display: none;" id="span-cuttag___2" class="cuttag"&gt;&lt;/span&gt;&lt;b class="cut-open"&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class="cut-text"&gt;&lt;a href="https://dw-dev.dreamwidth.org/143629.html#cutid2"&gt;Query Structure&lt;/a&gt;&lt;/b&gt;&lt;b class="cut-close"&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style="display: none;" id="div-cuttag___2" aria-live="assertive"&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Tragically the already existing options are 'use Solr', 'use something written on a Java server backend', or 'use a client-side Javascript library (which won't work with JS off and will probably not work on a 1300+ collection, but we didn't stress-test it to see)'&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=143629" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:143534</id>
    <author>
      <name>ninetydegrees (90d)☕</name>
    </author>
    <dw:poster user="ninetydegrees"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/143534.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=143534"/>
    <title>Styles have been moved!</title>
    <published>2013-06-15T09:39:39Z</published>
    <updated>2013-06-15T09:39:39Z</updated>
    <category term="styles"/>
    <dw:security>public</dw:security>
    <dw:reply-count>6</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='ninetydegrees' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://ninetydegrees.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://ninetydegrees.dreamwidth.org/'&gt;&lt;b&gt;ninetydegrees&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here are the new locations:&lt;br /&gt;&lt;br /&gt;bin/upgrading/s2layers/... =&amp;gt; styles/...&lt;br /&gt;bin/upgrading/s2layers.dat =&amp;gt; styles/s2layers.dat&lt;br /&gt;&lt;br /&gt;ext/dw-nonfree/bin/upgrading/s2layers/... =&amp;gt; ext/dw-nonfree/styles&lt;br /&gt;ext/dw-nonfree/bin/upgrading/s2layers.dat =&amp;gt; ext/dw-nonfree/styles/s2layers.dat&lt;br /&gt;&lt;br /&gt;If you're working on a styles bug, you may want to save your files, update your code and work on a new branch (or do what's necessary to update your current branch and reapply your changes).&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=143534" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:141299</id>
    <author>
      <name>Cocoa</name>
    </author>
    <dw:poster user="momijizukamori"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/141299.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=141299"/>
    <title>Bug 3459 - new styles categorization system (brainstorming + RFC)</title>
    <published>2013-05-14T20:07:34Z</published>
    <updated>2013-05-14T20:07:34Z</updated>
    <category term="styles"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='momijizukamori' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://momijizukamori.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://momijizukamori.dreamwidth.org/'&gt;&lt;b&gt;momijizukamori&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(Apologies to anyone seeing this twice, I posted it in &lt;span style='white-space: nowrap;'&gt;&lt;a href='https://dw-dev-training.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/comm_staff.png' alt='[site community profile] ' width='16' height='16' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://dw-dev-training.dreamwidth.org/'&gt;&lt;b&gt;dw_dev_training&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; but Mark and D suggested here was probably a better fit!)&lt;br /&gt;&lt;br /&gt;So, this is the gigantic project that's been kicking around my head the last few months, because I love our themes but right now, the organization is nooooot there. And I love organization. The &lt;a href="http://bugs.dwscoalition.org/show_bug.cgi?id=3459"&gt;full bugzilla listing&lt;/a&gt; has all the debates and links and what not, but I'm going to add the summary of UI implementation I ran by Denise below:&lt;br /&gt;&lt;br /&gt;&lt;span class="cut-wrapper"&gt;&lt;span style="display: none;" id="span-cuttag___1" class="cuttag"&gt;&lt;/span&gt;&lt;b class="cut-open"&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class="cut-text"&gt;&lt;a href="https://dw-dev.dreamwidth.org/141299.html#cutid1"&gt;quoted from Bugzilla&lt;/a&gt;&lt;/b&gt;&lt;b class="cut-close"&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style="display: none;" id="div-cuttag___1" aria-live="assertive"&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Because the scope of this runs through Perl, MySQL, BML, and Javascript, today I sat down and wrote out a vague work-flow for how looking at themes by category in /customize should run, and how adding themes as an admin should run, so I have an idea of what I need to do.&lt;br /&gt;&lt;br /&gt;&lt;span class="cut-wrapper"&gt;&lt;span style="display: none;" id="span-cuttag___2" class="cuttag"&gt;&lt;/span&gt;&lt;b class="cut-open"&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class="cut-text"&gt;&lt;a href="https://dw-dev.dreamwidth.org/141299.html#cutid2"&gt;very rough, mind you&lt;/a&gt;&lt;/b&gt;&lt;b class="cut-close"&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style="display: none;" id="div-cuttag___2" aria-live="assertive"&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;I'd really appreciate feedback on if I missed any important stuff, logistics of the UI implementation, and how exactly we should store this information in the databases. Or even on the list of categories I have so far, though there will probably be a bigger, more official RFC when things get far enough.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=141299" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:140484</id>
    <author>
      <name>ninetydegrees (90d)☕</name>
    </author>
    <dw:poster user="ninetydegrees"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/140484.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=140484"/>
    <title>The Great Big Styles Move</title>
    <published>2013-04-26T14:03:12Z</published>
    <updated>2013-04-26T14:03:12Z</updated>
    <category term="styles"/>
    <dw:security>public</dw:security>
    <dw:reply-count>12</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='ninetydegrees' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://ninetydegrees.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://ninetydegrees.dreamwidth.org/'&gt;&lt;b&gt;ninetydegrees&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Dear fellow devs,&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.dwscoalition.org/show_bug.cgi?id=4726"&gt;bug 4726&lt;/a&gt; will move all folders in /bin/upgrading/s2layers/ as well as /bin/upgrading/s2layers.dat to /bin/styles. I have this mostly patched so, if you're currently working on any of these files, please set your bug as blocking mine so I can keep my patch up-to-date and know when it's safe to push it.&lt;br /&gt;&lt;br /&gt;Thank you!&lt;br /&gt;&lt;br /&gt;P.S. baggyeyes, I've already done this for your bug as I know you're working on it. :)&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=140484" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:126188</id>
    <author>
      <name>ninetydegrees (90d)☕</name>
    </author>
    <dw:poster user="ninetydegrees"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/126188.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=126188"/>
    <title>Reminder: when making changes to Core2 check all styles please</title>
    <published>2012-09-30T14:28:31Z</published>
    <updated>2012-09-30T14:30:44Z</updated>
    <category term="styles"/>
    <dw:security>public</dw:security>
    <dw:reply-count>4</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='ninetydegrees' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://ninetydegrees.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://ninetydegrees.dreamwidth.org/'&gt;&lt;b&gt;ninetydegrees&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you make any change to Core2 --frontend but also backend, please check whether this also affects any of our official styles and open a bug for them if you don't want to update them as part of your own bug. It's the only way to make sure everything stays up-to-date and functional, and only requires a simple 'grep -ril'. :)&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=126188" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:123466</id>
    <author>
      <name>Simon</name>
    </author>
    <dw:poster user="swaldman"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/123466.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=123466"/>
    <title>Opinions sought: Too much info on tag usage available to styles?</title>
    <published>2012-09-10T16:35:40Z</published>
    <updated>2012-09-10T16:35:40Z</updated>
    <category term="styles"/>
    <dw:mood>geeky</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>14</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='swaldman' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://swaldman.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://swaldman.dreamwidth.org/'&gt;&lt;b&gt;swaldman&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I've been working on Bug 1723, and while doing that I've noticed something that I don't think is right.&lt;br /&gt;&lt;br /&gt;The following information on tag usage is exposed to the style system (via the TagDetail class):&lt;ol&gt;    &lt;li&gt;&lt;tt&gt;use_count&lt;/tt&gt;: The number of times that the tag in question is used in the journal (at present it's the total number of times, but bug 1723 will most likely change it to being an approximation of the number of times that it's used in posts that the current user can see. This isn't important now :-))&lt;/li&gt;    &lt;li&gt;&lt;tt&gt;visibility&lt;/tt&gt;: The most-relaxed security level that the tag is ever used in.&lt;/li&gt;    &lt;li&gt;&lt;tt&gt;security_counts&lt;/tt&gt;: How many times it is used at each security level, &lt;strong&gt;including security levels that the current user does not have access to&lt;/strong&gt;.&lt;/li&gt;&lt;/ol&gt;(1) is fine, and is used by all styles (there is a privacy leak at present, but bug 1723 is meant to fix that)&lt;br /&gt;(2) seems like info that styles don't really need to know, but it can't hurt&lt;br /&gt;(3) concerns me, because it exposes information that the current user shouldn't have.&lt;br /&gt;&lt;br /&gt;For example, let's say that user A has not been granted access by user B. User B posts a lot with the tag &amp;quot;hatemyboss&amp;quot;. Most of these posts are protected or private, but one of the posts is public. Because of the public post, user A is able to see the &amp;quot;hatemyboss&amp;quot; tag. If user A were to go away and write his own style that used the info in (3) above, he would be able to find out how often user B has used &amp;quot;hatemyboss&amp;quot; in protected, private and filtered posts.&lt;br /&gt;&lt;br /&gt;I'm told that none of DW's official styles use the info in (3). This doesn't mean that a custom style doesn't use it somewhere, on DW or another site using the code.&lt;br /&gt;&lt;br /&gt;I think that there are three options:&lt;br /&gt;(a) Leave things as they are&lt;br /&gt;(b) Stop exposing the security_counts variable to the styles system&lt;br /&gt;(c) Keep the variable, but force all the values to zero&lt;br /&gt;&lt;br /&gt;I prefer (c), because it deals with the privacy issue without totally breaking any custom styles that use this information. We could add a note in core2.s2 explaining what is going on, and &lt;em&gt;maybe&lt;/em&gt; remove the variable totally in a year's time or something.&lt;br /&gt;&lt;br /&gt;What are other peoples' opinions?&lt;br /&gt;&lt;br /&gt;If anybody wants to have a look for themselves, search for:&lt;ul&gt;    &lt;li&gt;&amp;quot;class TagDetail&amp;quot; in core2.s2&lt;/li&gt;    &lt;li&gt;&amp;quot;$t-&amp;gt;{security_counts}&amp;quot; in S2.pm&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=123466" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:113891</id>
    <author>
      <name>Cocoa</name>
    </author>
    <dw:poster user="momijizukamori"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/113891.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=113891"/>
    <title>Some tools for S2 patching</title>
    <published>2012-04-19T06:05:37Z</published>
    <updated>2012-04-19T06:39:01Z</updated>
    <category term="styles"/>
    <category term="scripts"/>
    <dw:security>public</dw:security>
    <dw:reply-count>4</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='momijizukamori' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://momijizukamori.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://momijizukamori.dreamwidth.org/'&gt;&lt;b&gt;momijizukamori&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;...mostly because as anyone who gets all the bugzilla and/or style notifs knows, I did a lot of that this week *g*&lt;br /&gt;&lt;br /&gt;First, preview images - I'd been doing them with Ubuntu's screenshot utility and photoshop, which is 1) really slow and 2) doesn't really adequately strip and compress images. So! Enter &lt;a href="https://chrome.google.com/webstore/detail/cpngackimfmofbokmjmljamhdncknpmg"&gt;Screen Capture&lt;/a&gt; for Google Chrome, which I've been using with the 'full page' setting, and set to skip pop-ups and save straight to a temp image directory, where I can then rename the screenshots. After that, &lt;span style='white-space: nowrap;'&gt;&lt;a href='https://geekosaur.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://geekosaur.dreamwidth.org/'&gt;&lt;b&gt;geekosaur&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; and &lt;span style='white-space: nowrap;'&gt;&lt;a href='https://exor674.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://exor674.dreamwidth.org/'&gt;&lt;b&gt;exor674&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; (with a little sideline ImageMagick input from &lt;span style='white-space: nowrap;'&gt;&lt;a href='https://www.dreamwidth.org/profile?user=tamouse_'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://www.dreamwidth.org/profile?user=tamouse_'&gt;&lt;b&gt;tamouse_&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; helped me write this handy little shell script, to process all the pngs in the directory you run them on - it resizes them, crops them, strips color profiles, and indexes them.&lt;br /&gt;&lt;br /&gt;&lt;textarea cols="50" rows="10"&gt;#!/bin/bash
for f in *.png; do
    convert -resize 150x114^ -gravity north -extent 150x114 -sharpen 25 +dither -type Palette "$f" png8:"out.png" &amp;&amp;
        pngnq -n 256 -s 1 -f out.png &amp;&amp;
        pngcrush -c 3 -bit_depth 8 -rem alla -brute out-nq8.png "$f" &amp;gt;/dev/null &amp;&amp;
        rm out.png out-nq8.png
done
&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;I've been using it on my own machine, as I run Ubuntu, but I believe all the appropriate packages are now on the Dreamhack server, too, for server-side use.&lt;br /&gt;&lt;br /&gt;Second, &lt;span style='white-space: nowrap;'&gt;&lt;a href='https://rb.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://rb.dreamwidth.org/'&gt;&lt;b&gt;rb&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; posted &lt;a href="http://dw-dev.dreamwidth.org/106347.html"&gt;a handy little script for sorting properties for color themes and generating appropriate headers&lt;/a&gt;. I updated it to match our current formatting for files, add sorting for a few more properties, and output more verbose instructions on what to do next at the end.&lt;br /&gt;&lt;br /&gt;&lt;textarea cols="50" rows="10"&gt;
#!/usr/bin/perl
#
#

my ( $theme_human, $author_name, $layout_human, $is_nonfree ) = @ARGV;

sub diehelp {
    warn "Syntax: newtheme ThemeName AuthorName LayoutName IsNonfree";
    exit;
}

if ( !$theme_human ) {
    warn "No theme name provided.";
    diehelp;
}
if ( !$layout_human ) {
    warn "No layout name provided.";
    diehelp;
}

( $layout_name = lc ( $layout_human ) ) =~ s/\s//g;
( $theme_name = lc ( $theme_human ) ) =~ s/\s//g;


my ( @dropped, @css, @set, $in_css );
while ( &amp;lt;STDIN&amp;gt; ) {
    my $line = $_;

    if ( $in_css ) {
        if ( $line =~ m/"""; }/ ) {
            $in_css = 0;
            next;
        }
        push( @css, $line );
    } elsif ( $line =~ m/function Page::print_theme_stylesheet/ ) {
        $in_css = 1;
    } elsif ( /^\.$/ ) {
        break;
    } else {
        next unless $line;
        if ( $line =~ m/^layerinfo / ) {
            push( @dropped, $line );
            next;
        }

        push( @set, $line );
    }
}

# process @set lines
my ( @unknown, @presentation, @page, @entries, @modules, @fonts, @images );
foreach ( @set ) {
    if ( /userlite_interaction_links = / || /_management_links = / || /module.*order/ || /module.*show/ ) {
        push( @dropped, $_ );
    } elsif ( /font/ ) {
        push( @fonts, $_ );
    } elsif ( /module/ ) {
        push( @modules, $_ );
    } elsif ( /entry/ ) {
        push( @entries, $_ );
    } elsif ( /comment/ ) {
        push( @entries, $_ );
    } elsif ( /links/ || /layout/ ) {
        push( @presentation, $_ );
    } elsif ( /color/ ) {
        push( @page, $_ );
    } elsif ( /image/ ) {
        push( @images, $_ );
    } else {
        push( @unknown, $_ );
    }
}

my $filename = "$ENV{LJHOME}/temp/$layout_name-$theme_name.s2";
open TMP_FILE, "&amp;gt; $filename";

print TMP_FILE &amp;lt;&amp;lt;"EOT";
#NEWLAYER: $layout_name/$theme_name
layerinfo type = "theme";
layerinfo name = "$theme_human";
layerinfo redist_uniq = "$layout_name/$theme_name";
layerinfo author_name = "$author_name";

set layout_authors = [ { "name" =&amp;gt; "$author_name", "type" =&amp;gt; "user" } ];
EOT

# print @set lines
sub print_section {
    my ( $name, @lines ) = @_;

    if (@lines) {
        print TMP_FILE&amp;lt;&amp;lt;"EOT";

##===============================
## $name
##===============================

EOT
        foreach ( @lines ) {
            print TMP_FILE $_;
        }
    }
}

print_section( "Presentation", @presentation );
print_section( "Page", @page );
print_section( "Entry", @entries );
print_section( "Module", @module );
print_section( "Fonts", @fonts );
print_section( "Images", @images );
if ( @css ) {
    print TMP_FILE "\n";
    print TMP_FILE 'function Page::print_theme_stylesheet() { """' . "\n";
    foreach ( @css ) {
        print TMP_FILE "    " . $_;
    }
    print TMP_FILE '"""; }' . "\n";
}
print_section( "Unknown - DELETE THIS SECTION after reclassifying lines", @unknown );
print_section( "Dropped - DELETE THIS SECTION after verifying none of it is needed", @dropped );
print TMP_FILE "\n";
close TMP_FILE;

print "Parsed theme now saved in file: $filename\n";
print "Be sure to check this for hardcoded font sizes and color codes that can be shortened.\n";
print "This new text needs to be put into the existing file named:\n";
print "$ENV{LJHOME}/bin/upgrading/s2layers/$layout_name/theme.s2\n\n";
if ( @images ) {
    print "This layout appears to have image(s). Change their url to $layout_name/$theme_name(_imagename, if multiple), rename the image to $theme_name(_imagename), and put in:\n";
    print "$ENV{LJHOME}/htdocs/stc/$layout_name/$theme_name.png\n\n";
    }
print "Theme also needs a preview screenshot. Resize to 150x114px and put in:\n";
print "$ENV{LJHOME}/htdocs/img/customize/previews/$layout_name/$theme_name.png\n\n";
print "(for additional reference on cleaning themes, see http://wiki.dwscoalition.org/notes/Newbie_Guide_for_People_Patching_Styles#Adding_a_New_Color_Theme )";
&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;This is written to be used server-side right now, with a command-line input like './newtheme.pl "Human-Readable Theme Name" user "Layout This Theme Is For" yes &amp;lt; inputfile' I've been running it client-side by changing line 74, 'my $filename = "$ENV{LJHOME}/temp/$layout_name-$theme_name.s2";' to 'my $filename = "temp_themes/$layout_name-$theme_name.s2";' (otherwise it tries to write to root, and That's Bad. And unnecessary)&lt;br /&gt;&lt;br /&gt;Third, for the tiny handful of people doing S2 work on gedit (shhh, I like it, okay), I made some &lt;a href="http://pastebin.com/MVdY2XRb"&gt;mods to the CSS syntax highlighting file (pastebin because the file is big)&lt;/a&gt;. I tried to get it to make a custom S2 language, but it was being fussy about parsing it, and a lot of the .s2 files are largely CSS anyway. So this adds highlighting for S2 variables and S2 keywords! It goes in a file called CSS.lang in home/.local/usr/share/gtksourceview-2.0/language-specs, which will probably not exist if you haven't made custom languages. If you're on newer versions that use GTK3, that 2.0 should be a 3.0. You may have to manually select the highlighting, for some reason it only registers the .s2 extension some of the time.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=113891" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:106645</id>
    <author>
      <name>Dre</name>
    </author>
    <dw:poster user="exor674"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/106645.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=106645"/>
    <title>Info gathering; S2 links that do not preserve style=</title>
    <published>2012-01-19T09:57:36Z</published>
    <updated>2012-01-19T09:57:36Z</updated>
    <category term="styles"/>
    <dw:security>public</dw:security>
    <dw:reply-count>3</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='exor674' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://exor674.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://exor674.dreamwidth.org/'&gt;&lt;b&gt;exor674&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I have noticed certain in-journal links such as next and previous do not preserve the style= setting and really should.&lt;br /&gt;&lt;br /&gt;Can people please look at links and compile a list of places that do &lt;strong&gt;not&lt;/strong&gt; preserve this option so I can open a bug.&lt;br /&gt;&lt;br /&gt;Thanks.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=106645" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:106347</id>
    <author>
      <name>Ricky Buchanan</name>
    </author>
    <dw:poster user="jeshyr"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/106347.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=106347"/>
    <title>S2 Patch Assist Script</title>
    <published>2012-01-07T10:27:12Z</published>
    <updated>2012-01-07T10:29:50Z</updated>
    <category term="styles"/>
    <category term="scripts"/>
    <dw:security>public</dw:security>
    <dw:reply-count>1</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='jeshyr' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://jeshyr.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://jeshyr.dreamwidth.org/'&gt;&lt;b&gt;jeshyr&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Right before my brain got refried by this stupid disease I was working on a script to turn the theme layers copied from DW  itself into the right format to paste into the s2 code in the sourcecode. I was doing it as I learned how so it's only been tested on about 5 different situations at the moment and I'm quite sure it doesn't do everything so check all output please!!&lt;br /&gt;&lt;br /&gt;And yes, my brain got fried (again) by this stupid disability so I'm on indefinite leave from developing for the mean time - and VERY disappointed about it.&lt;br /&gt;&lt;br /&gt;At the moment you want to pipe the theme layer through STDIN to the script, so something like&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$ ./newtheme.pl NewThemeName Rising "Tabula Rasa" yes &amp;lt; ~/file-with-theme-layer.txt&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;it will tell you what file it writes the output to, it will be something in $LJHOME/temp/&lt;br /&gt;&lt;br /&gt;Script&lt;br /&gt;&lt;br /&gt;&lt;textarea rows="15" cols="80"&gt;#!/usr/bin/perl
#
#

my ( $theme_human, $author_name, $layout_human, $is_nonfree ) = @ARGV;

sub diehelp {
    warn "Syntax: newtheme ThemeName AuthorName LayoutName IsNonfree";
    exit;
}

if ( !$theme_human ) {
    warn "No theme name provided.";
    diehelp;
}
if ( !$layout_human ) {
    warn "No layout name provided.";
    diehelp;
}

( $layout_name = lc ( $layout_human ) ) =~ s/\s//g;
( $theme_name = lc ( $theme_human ) ) =~ s/\s//g;


my ( @dropped, @css, @set, $in_css );
while ( &amp;lt;STDIN&amp;gt; ) {
    my $line = $_;

    if ( $in_css ) {
        if ( $line =~ m/"""; }/ ) {
            $in_css = 0;
            next;
        }
        push( @css, $line );
    } elsif ( $line =~ m/function Page::print_theme_stylesheet/ ) {
        $in_css = 1;
    } elsif ( /^\.$/ ) {
        break;
    } else {
        next unless $line;
        if ( $line =~ m/^layerinfo / ) {
            push( @dropped, $line );
            next;
        }

        push( @set, $line );
    }
}

# process @set lines
my ( @unknown, @presentation, @page, @entries, @modules, @fonts );
foreach ( @set ) {
    if ( /userlite_interaction_links = / || /_management_links = / || /module.*order/ || /module.*show/ ) {
        push( @dropped, $_ ); 
    } elsif ( /font/ ) {
        push( @fonts, $_ );
    } elsif ( /module/ ) {
        push( @modules, $_ );
    } elsif ( /entry/ ) {
        push( @entries, $_ );
    } elsif ( /comment/ ) {
        push( @entries, $_ );
    } elsif ( /links/ ) {
        push( @presentation, $_ );
    } elsif ( /color/ ) {
        push( @page, $_ );
    } else {
        push( @unknown );
    }
}

my $filename = "$ENV{LJHOME}/temp/$layout_name-$theme_name.s2";
open TMP_FILE, "&amp;gt; $filename";

print TMP_FILE &amp;lt;&amp;lt;"EOT";
#NEWLAYER: $layout_name/$theme_name
layerinfo "type" = "theme";
layerinfo "name" = "$theme_human";
layerinfo "redist_uniq" = "$layout_name/$theme_name";
layerinfo "author_name" = "$author_name";

set layout_authors = [ { "name" =&amp;gt; "$author_name", "type" =&amp;gt; "user" } ];
EOT

# print @set lines
sub print_section {
    my ( $name, @lines ) = @_;

    if (@lines) {
        print TMP_FILE&amp;lt;&amp;lt;"EOT";

##===============================
## $name
##===============================
EOT
        foreach ( @lines ) {
            print TMP_FILE $_;
        }
    }
}

print_section( "Presentation", @presentation );
print_section( "Page", @page );
print_section( "Entry", @entries );
print_section( "Module", @module );
print_section( "Fonts", @fonts );
if ( @css ) {
    print TMP_FILE "\n";
    print TMP_FILE 'function Page::print_theme_stylesheet() { """' . "\n";
    foreach ( @css ) {
        print TMP_FILE "    " . $_;
    }
    print TMP_FILE '"""; }' . "\n";
}
print_section( "Unknown - DELETE THIS SECTION after reclassifying lines", @unknown );
print_section( "Dropped - DELETE THIS SECTION after verifying none of it is needed", @dropped );
print TMP_FILE "\n";
close TMP_FILE;

print "Parsed theme now saved in file: $filename\n";
print "This new text needs to be put into the existing file named:\n";
print "$ENV{LJHOME}/bin/upgrading/s2layers/$theme_name/theme.s2\n\n";
print "Theme also needs a preview screenshot. Resize to 150x114px and put in:\n";
print "$ENV{LJHOME}/htdocs/img/customize/previews/$theme_name/$layout_name.png\n\n";
&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;Feedback, cases that break it, improvements, etc. would all be great.&lt;br /&gt;&lt;br /&gt;r&lt;br /&gt;&lt;br /&gt;Edit: Now with super bonus functioning HTML tags!&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=106347" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
