Code Snippets Review

Our lesson plans have code snippets. We’ve moved from storing the lesson plans on this team handbook to GitHubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ and then to Learn. As such, some bits of code may not be formatted correctly.

We are using the Edit Flow plugin to create administrative taxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies.. This will not display on the published view of the site.

When you visit Lesson Plans > All Lessons, you can view the columns where the taxonomy is available.

Within each lesson, look also at the Editorial Metadata. This may appear in the right sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme. under the document tab OR beneath the post editor content.

Proofreading Pass

Contributions are welcome to do a quick pass to ensure formatting has been established and for any obvious code conversion issues.

  1. Leave a message in the Training team Slack for the fastest access to the Learn siteLearn site The Training Team publishes its completed lesson plans at https://learn.wordpress.org/ which is often referred to as the "Learn" site. expressing interest in contributing.
  2. View Lesson Plans > All Lessons on Learn to locate which plans contain a code snippet.
  3. Edit a lesson that contains a snippet.

When converting posts to the BlockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. Editor mode, code snippets will default to a Code block. Modify this to the Syntax Highlighter block.

At this point, it may be beneficial to cross-check code with what appears on GitHub. A few cases of code not displaying in the editor but being live and inaccurate have occurred on published lesson plans. Copy/pasting from GitHub to Syntax Highlighter block usually works.

Then in the right sidebar, select the language with Line Numbers enabled.

When you’ve finished proofreading each lesson, check the Edit Flow box for
Code snippet proofread.

Top ↑

Code Snippet Testing

  1. Leave a message in the Training team Slack for the fastest access to the Learn site expressing interest in contributing.
  2. View Lesson Plans > All Lessons on Learn to locate which plans contain a code snippet.
  3. Edit a lesson that contains a snippet.

Many of these code snippets are rather dated. Run through the lesson and test the snippets displayed.

  • If you are able to confirm that it works, great! Check
    Code snippet passes
  • If the code does not work but you can provide new code that does work, great!
    Code provided
  • If the code in the lesson does not work and needs a different contributor to provide that, great.
    Code did not pass

Indicate in Edit Flow the status of the code snippets as you have reviewed each.

Top ↑

Let Us Know

We don’t have a great way to detect the progress made and do want to give props to those contributing.

After your pass through lesson plans, please leave a message in the Training team Slack indicating which plans you have updated.

Last updated: