Upcoming SlideShare
×

# OSSBarCamp Talk on Dexy

1,755 views

Published on

Published in: Technology, Education
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
1,755
On SlideShare
0
From Embeds
0
Number of Embeds
382
Actions
Shares
0
10
0
Likes
0
Embeds 0
No embeds

No notes for slide
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• ### OSSBarCamp Talk on Dexy

1. 1. 240 115260 126280 137300 1482.1 Right-Align DegreesPrefer right-aligning the columns.#include <stdio.h>/* print Fahrenheit-Celsius table * for fahr = 0, 20, ..., 300 */main(){ int fahr, celsius; int lower, upper, step; lower = 0; upper = 300; step = 20; fahr = lower; while (fahr <= upper) { celsius = 5 * (fahr-32)/9; printf( " % 4d t %4d n " , fahr, celsius); fahr = fahr + step; }} 0 -17 20 -6 40 4 60 15 80 26 100 37 120 48 140 60 160 71 180 82 Dexy Makes You Awesome 200 93 2 How Dexy can help you and your projects succeed.
2. 2. 10 Ways
3. 3. 1. Promote Your ProjectQUICKLY create a website and HTML documentationincluding tutorials and reference guides for your project.
5. 5. 3. Improve Your GameWrite about your code. Writing literate documentationimproves your code. If you can’t explain your code in words,or if it looks ugly on the page, you need to refactor it.
6. 6. 4. Get InvolvedWrite about other people’s code. This is the best way to learnabout a new library or language, and contributingdocumentation will get your foot in the door.
7. 7. 5. Contribute with Conﬁdence Nervous about starting to contribute to open source projects? Explain your patch in words, send this along with your patch. You’ll feel more conﬁdent, and so will the recipient.
8. 8. 6. Express YourselfBlog about what you do, share your experiences with the restof the community. Dexy supports WordPress, Tumblr andPosterous already and should be able to work with anyblogging API.
9. 9. 7. Write ProductivelyDexy helps you write reports and articles QUICKLY, writesource code using your favourite text editor or IDE, pull insnippets and transcripts, you’ll be amazed at how quickly itcomes together.
10. 10. 8. Keep it CurrentWriting your documentation in Dexy makes it easy toMAINTAIN in the long term. Don’t waste your time writingdocumentation that’s going to go out of date.
11. 11. 9. LearnKeep a coding journal as you learn new languages ortechniques, easily refer back to earlier examples and trackyour progress as you learn.
12. 12. 10. EarnUse Dexy to create marketable content like books, trainingcourses and consulting reports.
13. 13. 3 Ingredients
14. 14. Filters Textile .textile .html
15. 15. Filters clang .c .txt
16. 16. Filters LaTeX .tex .pdf
17. 17. Filters R .R .Rout
18. 18. Filters Jinja R Pygments .R .R .Rout .html
19. 19. CachingSource File Contents R Source File Name Filter Source CodePrevious Filter Steps 538d7311081c973640652e4a8d47b902.Rout
20. 20. Dependencies R Pygments Jinja .R .Rout .html .html .html Python Pygments .py .pyout .html
21. 21. Techniques
22. 22. TemplatingDynamic documents {{ a[‘ﬁrst’] }} a way to {{ a[‘second’]}}dynamic {{ a[‘third’] }}.a = {‘ﬁrst’ : ‘need’, ‘second’ : ‘insert’, ‘third’ : ‘data’}Dexy has support for Jinja2 for now, but more templatingsystems will be added.Probably will be a system of core utilities available totemplate systems (e.g. random ﬁlename generation).
23. 23. Sectioningboring boilerplate setup code and imports### @export “cool-stuff”really interesting cool stuff### @export “more-cool-stuff”even more cool stuff### @endboring teardown code
24. 24. JSONData written to JSON ﬁles is made available as a dict. Greatplace to store { ‘mean-of-population’ : 5.5, ‘stdev-of-population’ : 1.2} for easy {{ a[‘stats-data’][‘mean-of-population’] }} retrieval later.
25. 25. Filters
26. 26. Writing Filters Can be as easy as: def process_text(self, input_text): # do stuff return modiﬁed_input_text or as sophisticated as you need. It’s shockingly easy to do complex things with Dexy ﬁlters.
27. 27. SubprocessNon-Python code is handled using pexpect (linux/mac only).Working on subprocess() support in Windows.Windows users encouraged to run Dexy in Linux VM.
28. 28. Running Dexy
29. 29. Conﬁgure Dexy{ "index.html|jinja|wp" : { "allinputs" : true }, "index.txt|jinja|textile|wp" : { "allinputs" : true }, "post.json|dexy" : {}, "*.c|c" : {}, "*.c|pyg" : {}, "*.py|py" : {}, "*.py|pyg" : {}, "*.py|idio" : {}, "*.R|jinja|r|pyg" : {}, "*.R|pyg" : {}, "*.txt|dexy" : {},}
30. 30. Run Dexy dexy .
31. 31. Outputlogs/dexy.logartifacts/cache/
32. 32. Important Idea
33. 33. What documentation?What kind of documentation you are writing?Reference documentation is not the same as tutorials.Developer docs are not the same as user docs.Please do not document via source code comments.Dexy makes it easy to write many different kinds ofdocumentation, reusing the same code snippets if you want,so take advantage of this.
34. 34. Slides for talk given at OSSBarCamp on 26September 2010 by Ana Nelson.Slides are licensed as http://creativecommons.org/licenses/by/3.0/ so feelfree to re-use with attribution.Visit http://blog.dexy.it for more information, orcontact me ana@ananelson.com