Example Page for Authoring Articles

By Ryan Florence, published 2011-07-01

If your article has assets, create a folder like this one and stick them there, and name the article index.

Markdown

Here’s a bulleted list:

Here’s a numbered list:

  1. item
  2. item

This is one paragraph. This sentence is part of that paragraph.

This is a new paragraph.

Google

Code Blocks

Include code blocks like this:

var foo = bar;

Or from a file like this:

var ClassNameSwapper = new Class({
  
  current: null,

  initialize: function(element){
    this.element = document.id(element);
    this.attach();
  },

  attach: function(){
    var self = this;
    this.element.addEvent('click', function(event){
      self.setCurrentTo(event.target);
    });
  },

  setCurrentTo: function(target){
    if (target == this.current) return;
    if (this.current) this.current.removeClass('current');
    this.current = $(target).addClass('current');
  }

});

// usage
var nav = new ClassNameSwapper('main-nav');

The path is relative to the article’s folder.

Images

Place your image in the article’s directory and …

Or just get the image path if you need to do something fancier:

/2011/example//burger.png

About the Author

Name:
Ryan Florence
Location:
West Jordan, UT
Github:
rpflorence
Twitter:
ryanflorence
Website:
http://ryanflorence.com

Ryan Florence is a front-end web developer from Salt Lake City, Utah and has been creating websites since the early 90's. He is especially interested in creating experiences that are pleasing to both the end user and the developer inheriting the project. Ryan is active in the JavaScript community writing plugins, contributing to popular JavaScript libraries, speaking at conferences & meet-ups, and writing about it on the web. He currently works as Software Engineer at Instructure.

About UtahJS.com

UtahJS is the website for the Utah JavaScript Users Group that meets to discuss and enjoy JavaScript!

JavaScript in the browser, on the server or just about anywhere else.

We love JavaScript but quite often talk about other topics such as CSS, HTML, cross browser coding, the internet… pretty much, anything that we find interesting.

Everyone is welcome. Please join us!