Confirmed users
376
edits
No edit summary |
No edit summary |
||
| Line 71: | Line 71: | ||
There is more information on [https://wiki.mozilla.org/Evangelism_Reps_Training_Program/How_to_prepare_a_screencast creating screencasts] available here. | There is more information on [https://wiki.mozilla.org/Evangelism_Reps_Training_Program/How_to_prepare_a_screencast creating screencasts] available here. | ||
===== | ==Code examples=== | ||
Last but not least let's talk about the thing that really makes a blog post a technical blog post - code examples. For detailed information about code examples and why they should be the best code you ever write you can [http://developer-evangelism.com/code.php check the Developer Evangelism Handbook entry on code examples], but here are a few very important points: | |||
*'''Link the original source''' - preferably on GitHub, also a working example or at least as a zip. People should never have to copy and paste code to make it work. | |||
*'''Embed readable code''' - there are a few options: | |||
**'''Use colour coding''' - our blog allows you to do that by adding <pre lang="$lang"> around your code where $lang can be xml (for HTML), javascript or css (and a few others). | |||
**'''Embed a Gist from GitHub''' - this has the benefit of your code being editable if needed. However, in most cases a change in code would also have to reflect in the text. | |||
**'''Embed an interactive code example''' - using [http://jsfiddle.net JSFiddle], [http://jsbin.com JSBin.com], [http://tinker.io Tinker.io], [http://dabblet.com/ Dabblet] or others. This is very cool as people can play with the code, but you are also dependent on these services to be up and running. The iframe embedding also doesn't work on RSS readers, so make sure to link the URL and do the embedding - much like you do with multimedia. | |||
*'''Make your code work''' - as explained on the Evangelism handbook, your code '''must''' work. Write very paranoid and defensive code as your example. It is very tempting to show the shortest code possible but we want to teach people good code, not how to cut corners. | |||