SALT-NLP/Design2Code
This dataset consists of 484 webpages from the C4 validation set, serving the purpose of testing multimodal LLMs on converting visual designs into code implementations. Each example is a pair of source HTML and screenshot ({id}.html and {id}.png). See the dataset in the huggingface format here. Note that all images in these webpages are replaced by a placeholder image (rick.jpg) Please refer to our project page and our paper for more information. Example Usage For example, you… See the full description on the dataset page: https://huggingface.co/datasets/SALT-NLP/Design2Code.
221.8k
1<!DOCTYPE html>2<html>3 <head>4 <style>5 body {6 margin: 0 auto;7 max-width: 800px;8 padding: 1rem;9}10 11h1 a {12 color: #000;13 text-decoration: none;14}15 16h2 small {17 font-size: 0.6em;18 margin-left: 3rem;19}20 21p {22 line-height: 2rem;23}24 25img {26 max-width: 100%;27}28 29li {30 margin: 1rem 0;31}32 33ul.none {34 list-style: none;35 padding-left: 0;36}37 38small {39 color: grey;40}41 42code {43 background: #f1f1f1;44 font-size: 0.8rem;45 padding: 2px 2px;46}47 48.highlight {49 max-width: 100%;50}51 52.highlight pre {53 background-color: #f6f8fa;54 border-radius: 6px;55 padding: 1rem;56 white-space: pre-wrap;57 word-break: break-word;58}59 60pre code {61 background: transparent;62}63 64blockquote {65 color: dimgrey;66 font-style: italic;67 margin-left: 1rem;68 padding-left: 1em;69 box-shadow: #e1e1e1 3px 0 0 0 inset;70}71 72hr {73 margin: 1.5rem auto;74}75 76article footer {77 margin-top: 2rem;78}79 80footer#mastfoot {81 border-top: 1px solid lightgrey;82 margin: 2rem auto;83 padding: 1rem 0;84}85 86#callout {87 background: #e9f5db;88 padding: 1rem 2rem;89}90 91#callout blockquote {92 color: #010101;93}94 95/* syntax.css generated with:96 hugo gen chromastyles --style=github > syntax.css97 and imported98 */99/* Background */ .chroma { background-color: #ffffff }100/* Other */ .chroma .x { }101/* Error */ .chroma .err { color: #a61717; background-color: #e3d2d2 }102/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }103/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }104/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc }105/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }106/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }107/* Keyword */ .chroma .k { color: #000000; font-weight: bold }108/* KeywordConstant */ .chroma .kc { color: #000000; font-weight: bold }109/* KeywordDeclaration */ .chroma .kd { color: #000000; font-weight: bold }110/* KeywordNamespace */ .chroma .kn { color: #000000; font-weight: bold }111/* KeywordPseudo */ .chroma .kp { color: #000000; font-weight: bold }112/* KeywordReserved */ .chroma .kr { color: #000000; font-weight: bold }113/* KeywordType */ .chroma .kt { color: #445588; font-weight: bold }114/* Name */ .chroma .n { }115/* NameAttribute */ .chroma .na { color: #008080 }116/* NameBuiltin */ .chroma .nb { color: #0086b3 }117/* NameBuiltinPseudo */ .chroma .bp { color: #999999 }118/* NameClass */ .chroma .nc { color: #445588; font-weight: bold }119/* NameConstant */ .chroma .no { color: #008080 }120/* NameDecorator */ .chroma .nd { color: #3c5d5d; font-weight: bold }121/* NameEntity */ .chroma .ni { color: #800080 }122/* NameException */ .chroma .ne { color: #990000; font-weight: bold }123/* NameFunction */ .chroma .nf { color: #990000; font-weight: bold }124/* NameFunctionMagic */ .chroma .fm { }125/* NameLabel */ .chroma .nl { color: #990000; font-weight: bold }126/* NameNamespace */ .chroma .nn { color: #555555 }127/* NameOther */ .chroma .nx { }128/* NameProperty */ .chroma .py { }129/* NameTag */ .chroma .nt { color: #000080 }130/* NameVariable */ .chroma .nv { color: #008080 }131/* NameVariableClass */ .chroma .vc { color: #008080 }132/* NameVariableGlobal */ .chroma .vg { color: #008080 }133/* NameVariableInstance */ .chroma .vi { color: #008080 }134/* NameVariableMagic */ .chroma .vm { }135/* Literal */ .chroma .l { }136/* LiteralDate */ .chroma .ld { }137/* LiteralString */ .chroma .s { color: #dd1144 }138/* LiteralStringAffix */ .chroma .sa { color: #dd1144 }139/* LiteralStringBacktick */ .chroma .sb { color: #dd1144 }140/* LiteralStringChar */ .chroma .sc { color: #dd1144 }141/* LiteralStringDelimiter */ .chroma .dl { color: #dd1144 }142/* LiteralStringDoc */ .chroma .sd { color: #dd1144 }143/* LiteralStringDouble */ .chroma .s2 { color: #dd1144 }144/* LiteralStringEscape */ .chroma .se { color: #dd1144 }145/* LiteralStringHeredoc */ .chroma .sh { color: #dd1144 }146/* LiteralStringInterpol */ .chroma .si { color: #dd1144 }147/* LiteralStringOther */ .chroma .sx { color: #dd1144 }148/* LiteralStringRegex */ .chroma .sr { color: #009926 }149/* LiteralStringSingle */ .chroma .s1 { color: #dd1144 }150/* LiteralStringSymbol */ .chroma .ss { color: #990073 }151/* LiteralNumber */ .chroma .m { color: #009999 }152/* LiteralNumberBin */ .chroma .mb { color: #009999 }153/* LiteralNumberFloat */ .chroma .mf { color: #009999 }154/* LiteralNumberHex */ .chroma .mh { color: #009999 }155/* LiteralNumberInteger */ .chroma .mi { color: #009999 }156/* LiteralNumberIntegerLong */ .chroma .il { color: #009999 }157/* LiteralNumberOct */ .chroma .mo { color: #009999 }158/* Operator */ .chroma .o { color: #000000; font-weight: bold }159/* OperatorWord */ .chroma .ow { color: #000000; font-weight: bold }160/* Punctuation */ .chroma .p { }161/* Comment */ .chroma .c { color: #999988; font-style: italic }162/* CommentHashbang */ .chroma .ch { color: #999988; font-style: italic }163/* CommentMultiline */ .chroma .cm { color: #999988; font-style: italic }164/* CommentSingle */ .chroma .c1 { color: #999988; font-style: italic }165/* CommentSpecial */ .chroma .cs { color: #999999; font-weight: bold; font-style: italic }166/* CommentPreproc */ .chroma .cp { color: #999999; font-weight: bold; font-style: italic }167/* CommentPreprocFile */ .chroma .cpf { color: #999999; font-weight: bold; font-style: italic }168/* Generic */ .chroma .g { }169/* GenericDeleted */ .chroma .gd { color: #000000; background-color: #ffdddd }170/* GenericEmph */ .chroma .ge { color: #000000; font-style: italic }171/* GenericError */ .chroma .gr { color: #aa0000 }172/* GenericHeading */ .chroma .gh { color: #999999 }173/* GenericInserted */ .chroma .gi { color: #000000; background-color: #ddffdd }174/* GenericOutput */ .chroma .go { color: #888888 }175/* GenericPrompt */ .chroma .gp { color: #555555 }176/* GenericStrong */ .chroma .gs { font-weight: bold }177/* GenericSubheading */ .chroma .gu { color: #aaaaaa }178/* GenericTraceback */ .chroma .gt { color: #aa0000 }179/* GenericUnderline */ .chroma .gl { text-decoration: underline }180/* TextWhitespace */ .chroma .w { color: #bbbbbb }181 </style>182 <meta charset="utf-8">183 <meta content="width=device-width,initial-scale=1" name="viewport">184 <meta content="interest-cohort=()" http-equiv="permissions-policy">185 <meta content="Running Liquibase against and existing database using LiquibaseServletListener | Tony Wolski" property="og:title">186 <meta content="I recently took on the task of integrating Liquibase into the project I’m working on at work. I’d played around with Liquibase before on small …" property="og:description">187 <meta content="" property="og:url">188 <meta content="Tony Wolski" property="og:site_name">189 <meta content="article" property="og:type">190 <meta content="summary" property="twitter:card">191 <title>192 Running Liquibase against and existing database using LiquibaseServletListener | Tony Wolski193 </title>194 <meta content="I recently took on the task of integrating Liquibase into the project I’m working on at work. I’d played around with Liquibase before on small …" name="description">195 <meta content="Tony Wolski" name="author">196 <meta content="IE=edge" http-equiv="x-ua-compatible">197 <meta content="no-referrer" name="referrer">198 </head>199 <body>200 <header id="masthead">201 <h1>202 <a title="Tony Wolski">203 Tony Wolski204 </a>205 </h1>206 </header>207 <main>208 <article class="post">209 <header>210 <h1>211 Running Liquibase against and existing database using LiquibaseServletListener212 </h1>213 <small>214 2013-10-14215 </small>216 </header>217 <p>218 I recently took on the task of integrating219 <a>220 Liquibase221 </a>222 into the project I’m working on at work. I’d played around with Liquibase before on small personal projects, but had never faced applying it to an existing, large and in-production database.223 </p>224 <p>225 I ran into a few problems when using the LiquibaseServletListener after having previously run changelogSync via the command line. Basically, Liquibase was trying to execute the changesets in my changelog files even though they had already been executed during changelogSync.226 </p>227 <p>228 I had executed Liquibase’s changelogSync from the command line in the same directory as the file generated by generateChangeLog, something along these lines:229 </p>230 <div class="highlight">231 <pre class="chroma"><code class="language-shell" data-lang="shell">liquibase --driver<span class="o">=</span>com.mysql.jdbc.Driver <span class="se">\232</span><span class="se"></span> --classpath<span class="o">=</span>mysql-connector-java-5.1.13-bin.jar <span class="se">\233</span><span class="se"></span> --changeLogFile<span class="o">=</span>accounts-changelog-schema.xml <span class="se">\234</span><span class="se"></span> --url<span class="o">=</span><span class="s2">"jdbc:mysql://localhost:3306/accounts"</span> <span class="se">\235</span><span class="se"></span> --username<span class="o">=</span>user --password<span class="o">=</span>password changelogSync236</code></pre>237 </div>238 <p>239 Afterwards, the rows in Liquibase’s DATABASECHANGELOG table indicated everything had worked, and each of the changesets had an EXECTYPE of EXECUTED, which should have meant when the servlet listener started up the changesets would be skipped over. But Liquibase was trying to execute the changesets and I was getting a log full of errors.240 </p>241 <p>242 Turns out that because I had defined my changelog file in a subdirectory:243 </p>244 <div class="highlight">245 <pre class="chroma"><code class="language-xml" data-lang="xml"><span class="nt"><context-param></span>246 <span class="nt"><param-name></span>liquibase.changelog<span class="nt"></param-name></span>247 <span class="nt"><param-value></span>db/changelog/accounts-changelog-schema.xml<span class="nt"></param-value></span>248<span class="nt"></context-param></span>249</code></pre>250 </div>251 <p>252 And had run changelogSync from the same directory as the generated changelog (which meant the FILENAME field for each changeset was ‘accounts-changelog-schema.xml’), the FILENAME field didn’t match. Hence Liquibase’s attempts to re-run the changesets.253 </p>254 <p>255 Fixing the problem was simply a matter of updating the database256 </p>257 <div class="highlight">258 <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="k">update</span> <span class="n">DATABASASECHANGELOG</span> <span class="k">set</span> <span class="n">FILENAME</span> <span class="o">=</span> <span class="s1">'db/changelog/accounts-changelog-schema.xml'</span><span class="p">;</span>259</code></pre>260 </div>261 <footer>262 «263 <a>264 Previous265 </a>266 ||267 <a>268 Next269 </a>270 »271 </footer>272 <br>273 <p>274 <strong>275 Your thoughts?276 </strong>277 I'd love to hear them. Please get in278 <a>279 contact280 </a>281 .282 </p>283 </article>284 </main>285 <footer id="mastfoot">286 <nav>287 <a title="Contact">288 Contact289 </a>290 </nav>291 </footer>292 </body>293</html>294 