WordPress.org

Making WordPress.org

Changeset 5768


Ignore:
Timestamp:
08/07/2017 08:46:56 PM (3 years ago)
Author:
danielbachhuber
Message:

devhub/cli: Add "Contributing" section to bottom of command docs

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-command.php

    r5765 r5768  
    2020
    2121    <footer class="entry-meta">
    22         <p><em>Command documentation is regenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.</em></p>
    23 
    2422        <?php edit_post_link( __( 'Edit', 'wporg' ), '<span class="edit-link">', '</span>' ); ?>
    2523    </footer><!-- .entry-meta -->
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli.php

    r5767 r5768  
    267267        $content = str_replace( '&#045;&#8211;', '&#045;&#045;&#045;', $content );
    268268
    269         // Append subcommands if they exist
    270269        $children = get_children( array(
    271270            'post_parent'    => get_the_ID(),
     
    275274            'order'          => 'ASC',
    276275        ) );
     276        // Append subcommands if they exist
    277277        if ( $children ) {
    278278            ob_start();
     
    300300        }
    301301
     302        $contributing_bits = array();
     303        $repo_url = get_post_meta( get_the_ID(), 'repo_url', true );
     304        $cmd_slug = str_replace( 'wp ', '', get_the_title() );
     305        $open_issues = 'https://github.com/issues?q=label%3A' . urlencode( 'command:' . str_replace( ' ', '-', $cmd_slug ) ) . '+sort%3Aupdated-desc+org%3Awp-cli+is%3Aopen';
     306        $closed_issues = 'https://github.com/issues?q=label%3A' . urlencode( 'command:' . str_replace( ' ', '-', $cmd_slug ) ) . '+sort%3Aupdated-desc+org%3Awp-cli+is%3Aclosed';
     307        ob_start();
     308        ?>
     309        <div class="github-tracker">
     310            <?php if ( $repo_url ) : ?>
     311                <a href="<?php echo esc_url( $repo_url ); ?>"><img src="https://make.wordpress.org/cli/wp-content/plugins/wporg-cli/assets/images/github-mark.svg" class="icon-github" /></a>
     312                <a href="<?php echo esc_url( rtrim( $repo_url, '/' ) . '/issues/new' ); ?>" class="button">Create New Issue</a>
     313            <?php endif; ?>
     314            <div class="btn-group">
     315                <a href="<?php echo esc_url( $open_issues ); ?>" class="button">View Open Issues</a>
     316                <a href="<?php echo esc_url( $closed_issues ); ?>" class="button">View Closed Issues</a>
     317            </div>
     318        </div>
     319        <?php
     320        $issues = ob_get_clean();
     321        $contributing_bits[] = $issues;
     322        $contributing_bits[] = '<p>Command documentation is regenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.</p>';
     323        $contributing_bits[] = '<p>See <a href="https://make.wordpress.org/cli/handbook/contributing/">contributing guidelines</a> for full details on contributing.</p>';
     324
     325        $contributing = '<h3>CONTRIBUTING</h3>' . PHP_EOL . implode( PHP_EOL, $contributing_bits );
     326        $content .= $contributing;
     327
    302328        // Add 'Quick Links' across the top
    303329        $items = self::get_tags( 'h([1-4])', $content );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss

    r5767 r5768  
    18811881
    18821882    h2, h3 {
    1883         margin-top: 3rem;
     1883        margin-top: 4rem;
    18841884        margin-bottom: 2.5rem;
    18851885        font-size: 2.5rem;
     
    19431943    }
    19441944}
     1945
     1946.single-command {
     1947    .devhub-wrap *, .devhub-wrap *::before, .devhub-wrap *::after {
     1948        -moz-box-sizing: border-box;
     1949        -webkit-box-sizing: border-box;
     1950        box-sizing: border-box;
     1951    }
     1952
     1953    .devhub-wrap a.button, .devhub-wrap button, .devhub-wrap input[type="button"], .devhub-wrap input[type="reset"], .devhub-wrap input[type="submit"] {
     1954        border: 1px solid;
     1955        border-color: #ccc;
     1956        border-radius: 3px;
     1957        background: #f7f7f7;
     1958        color: rgba(0, 0, 0, 0.8);
     1959        cursor: pointer;
     1960        font-size: 1.2rem;
     1961        line-height: 1;
     1962        float: none;
     1963        height: auto;
     1964        padding: .8rem 1.2rem;
     1965        margin: .4rem 0;
     1966        text-decoration: none;
     1967        -webkit-appearance: button;
     1968
     1969        &:hover {
     1970            border-color: #ccc #bbb #aaa #bbb;
     1971            background: #eee;
     1972        }
     1973       
     1974        &:focus, &:active {
     1975            border-color: #bbb;
     1976            background: #eee;
     1977            -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
     1978            box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
     1979        }
     1980       
     1981        > span {
     1982            color: #757575;
     1983            line-height: 1;
     1984            font-size: .7rem;
     1985           
     1986            &.red {
     1987                color: #dc3232;
     1988            }
     1989            &.green {
     1990                color: #46B450;
     1991            }
     1992        }
     1993
     1994    }
     1995
     1996    .btn-group {
     1997        display: inline;
     1998       
     1999        > button {
     2000            position: relative;
     2001           
     2002            &:first-child {
     2003                @media(min-width: 571px) {
     2004                    right: -6px;
     2005                    border-radius: 3px 0 0 3px;
     2006                }
     2007            }
     2008            &:last-child {
     2009                @media(min-width: 571px) {
     2010                    border-radius: 0 3px 3px 0;
     2011                }
     2012            }
     2013        }
     2014    }
     2015
     2016    .github-tracker {
     2017        margin-bottom: 1.5em;
     2018        img.icon-github {
     2019            width: 23px;
     2020            position: relative;
     2021            top: 6px;
     2022            margin-right: 5px;
     2023        }
     2024    }
     2025}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css

    r5767 r5768  
    21952195
    21962196.single-command #content h2, .single-command #content h3 {
    2197   margin-top: 3rem;
     2197  margin-top: 4rem;
    21982198  margin-bottom: 2.5rem;
    21992199  font-size: 2.5rem;
     
    22562256  background: rgba(0, 0, 0, 0.025);
    22572257}
     2258
     2259.single-command .devhub-wrap *, .single-command .devhub-wrap *::before, .single-command .devhub-wrap *::after {
     2260  -moz-box-sizing: border-box;
     2261  -webkit-box-sizing: border-box;
     2262  box-sizing: border-box;
     2263}
     2264
     2265.single-command .devhub-wrap a.button, .single-command .devhub-wrap button, .single-command .devhub-wrap input[type="button"], .single-command .devhub-wrap input[type="reset"], .single-command .devhub-wrap input[type="submit"] {
     2266  border: 1px solid;
     2267  border-color: #ccc;
     2268  border-radius: 3px;
     2269  background: #f7f7f7;
     2270  color: rgba(0, 0, 0, 0.8);
     2271  cursor: pointer;
     2272  font-size: 1.2rem;
     2273  line-height: 1;
     2274  float: none;
     2275  height: auto;
     2276  padding: .8rem 1.2rem;
     2277  margin: .4rem 0;
     2278  text-decoration: none;
     2279  -webkit-appearance: button;
     2280}
     2281
     2282.single-command .devhub-wrap a.button:hover, .single-command .devhub-wrap button:hover, .single-command .devhub-wrap input[type="button"]:hover, .single-command .devhub-wrap input[type="reset"]:hover, .single-command .devhub-wrap input[type="submit"]:hover {
     2283  border-color: #ccc #bbb #aaa #bbb;
     2284  background: #eee;
     2285}
     2286
     2287.single-command .devhub-wrap a.button:focus, .single-command .devhub-wrap a.button:active, .single-command .devhub-wrap button:focus, .single-command .devhub-wrap button:active, .single-command .devhub-wrap input[type="button"]:focus, .single-command .devhub-wrap input[type="button"]:active, .single-command .devhub-wrap input[type="reset"]:focus, .single-command .devhub-wrap input[type="reset"]:active, .single-command .devhub-wrap input[type="submit"]:focus, .single-command .devhub-wrap input[type="submit"]:active {
     2288  border-color: #bbb;
     2289  background: #eee;
     2290  -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
     2291  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
     2292}
     2293
     2294.single-command .devhub-wrap a.button > span, .single-command .devhub-wrap button > span, .single-command .devhub-wrap input[type="button"] > span, .single-command .devhub-wrap input[type="reset"] > span, .single-command .devhub-wrap input[type="submit"] > span {
     2295  color: #757575;
     2296  line-height: 1;
     2297  font-size: .7rem;
     2298}
     2299
     2300.single-command .devhub-wrap a.button > span.red, .single-command .devhub-wrap button > span.red, .single-command .devhub-wrap input[type="button"] > span.red, .single-command .devhub-wrap input[type="reset"] > span.red, .single-command .devhub-wrap input[type="submit"] > span.red {
     2301  color: #dc3232;
     2302}
     2303
     2304.single-command .devhub-wrap a.button > span.green, .single-command .devhub-wrap button > span.green, .single-command .devhub-wrap input[type="button"] > span.green, .single-command .devhub-wrap input[type="reset"] > span.green, .single-command .devhub-wrap input[type="submit"] > span.green {
     2305  color: #46B450;
     2306}
     2307
     2308.single-command .btn-group {
     2309  display: inline;
     2310}
     2311
     2312.single-command .btn-group > button {
     2313  position: relative;
     2314}
     2315
     2316@media (min-width: 571px) {
     2317  .single-command .btn-group > button:first-child {
     2318    right: -6px;
     2319    border-radius: 3px 0 0 3px;
     2320  }
     2321}
     2322
     2323@media (min-width: 571px) {
     2324  .single-command .btn-group > button:last-child {
     2325    border-radius: 0 3px 3px 0;
     2326  }
     2327}
     2328
     2329.single-command .github-tracker {
     2330  margin-bottom: 1.5em;
     2331}
     2332
     2333.single-command .github-tracker img.icon-github {
     2334  width: 23px;
     2335  position: relative;
     2336  top: 6px;
     2337  margin-right: 5px;
     2338}
Note: See TracChangeset for help on using the changeset viewer.