Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

797472 code sample models#645

Merged
groovecoder merged 6 commits intomdn:masterfrom
lmorchard:797472-code-sample-models
Oct 9, 2012
Merged

797472 code sample models#645
groovecoder merged 6 commits intomdn:masterfrom
lmorchard:797472-code-sample-models

Conversation

@lmorchard
Copy link
Contributor

Do merge this, if it seems good.

Going to try something different here: This PR consists of a series of commits, each a discrete change that should almost stand on its own and not break the site. Altogether, the PR implements most of a feature, but there are a few things left to wrap up.

What you should be able to spot-check on a dev VM, though, is this:

  • Add some code listings inside a container div (in source view, because there's no good editor yet), something like this:

    <ul id="s2">
        <li><span>HTML</span>
            <pre class="brush: html">
                &lt;div class="foo"&gt;
                    &lt;p&gt;Hello world!&lt;/p&gt;
                    &lt;p&gt;Unicode fun: Przykłady 例 예제 示例&lt;/p&gt;
                &lt;/div&gt;
            </pre>
        </li>
        <li><span>CSS</span>
            <pre class="brush: css">
                .foo p { color: red; }
            </pre>
        </li>
        <li><span>JS</span>
            <pre class="brush: js">
                window.alert("Hi there!");
            </pre>
        </li>
    </ul>
    
  • Take the URL of the page, add $samples/sample2, eg:

    https://developer-local.allizom.org/en-US/docs/User:lmorchard/TestCodeSamples$samples/s2

  • Upon visiting that URL, you should see the results of the code sample as a live page

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jinja2.escape is probably faster unless you need some behavior from sax.

@groovecoder
Copy link
Contributor

test and spot-check pass.

rebase, pep8 cleanup and jinja2.escape change (if you want to)

r+

@lmorchard
Copy link
Contributor Author

Rebased and did some code cleanup for pep8, but didn't address all the warnings. There's a lot to be done there, unrelated to this PR

groovecoder added a commit that referenced this pull request Oct 9, 2012
@groovecoder groovecoder merged commit f7448a6 into mdn:master Oct 9, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants