Re: Help with creating examples
Pontus Östlund <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
> 9 dec. 2016 kl. 19:27 skrev H. William Welliver III <[email protected]>: > > I agree with the notion that this is pretty basic stuff that ought to be referenced from the main Pike site, however my sense is that a top down approach to community building doesn’t generally work very well. Even the wiki, which is about as low friction as you can get, hasn’t gotten a lot of traction. Though, after a quick check, it has 560 versions across 100 pages, so perhaps its gotten more traction than I realized. > > Nothing would prevent taking content generated in the wiki for use on the official website later, and it’s available for use right now. In my mind it’s better to get going and see if the idea goes anywhere before making it an official effort. I totally agree with you! > Also, gists might be an interesting way to go about it, but gists aren’t great for generating mixed content with code examples… has anyone written a pike syntax highlighter to html converter in pike? There's a Pike to html converter in Tools.Standalone.pike_to_html (http://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/Tools/Standalone/pike_to_html/convert.html <http://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/Tools/Standalone/pike_to_html/convert.html>). pike -x pike_to_html file.pike > file.html It also has a public method so string code = "Some pike code..."; string hl = Tools.Standalone.pike_to_hml()->convert(code); will also do it. The colors aren't written directly to the output, instead you'd have to add that yourself via CSS classes. The classes used are documented in the refdoc page. # Pontus