Code snippets in documentation
See original GitHub issueCould we maybe get the code required under the examples in the docs. Would really help to get up and running with this library quickly. For example <ui-alert>Hi everybody! This is the default alert</ui-alert>
under the alerts section.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to include code in docs - Contributor guide
The preferred way to include code snippets for programming languages in docs is by reference to a code file. This method gives you...
Read more >Code snippets - Tech.io Documentation - CodinGame
Explore this playground and try new concepts right into your browser.
Read more >How To Add Code Blocks To Google Docs
How To Add Code Blocks To Google Docs · Open Google Docs (make sure you log into your Google account). · Click on...
Read more >Snippets in Visual Studio Code
Snippets in Visual Studio Code. Code snippets are templates that make it easier to enter repeating code patterns, such as loops or conditional-statements....
Read more >Code Snippets - CKEditor 4 Documentation
Inserting Code Snippets Documentation ... The optional Code Snippet plugin, introduced in CKEditor 4.4, supports inserting beautiful code snippets into the editor ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Gday @JosephusPaye
Well I’ve had an initial first shot at putting this together for a single component - http://rowanwins.github.io/keenUIdocs/
I had a brief go with the idea of a playground/code snippet area just because I was a bit intrigued as to how hard it would be, short answer is it’s certainly not too tricky especially once we get one or two set up, they’ll provide nice templates to cut and paste. I found a neat syntax highlighting thing called prism.js (used on the getmdl.io site hence how I found it!) which is pretty cool for whacking classes for presentation around html syntax.
Github was being a bit weird so I have seperate repos at the moment but you can see here my approach that I’ve used for the src-docs https://github.com/rowanwins/Keen-UI/tree/master/src-docs/components/UiAlert , basically I have one main vue file and then a vue file for each tab. It’s not super tidy at the moment and lots of the css could be moved in the app.styl but I figured I’d just start the ball rolling.
Cheers Rowan
PS Let me know if you want to continue this discussion outside of github and I can ping you my email via twitter or something
Gday @JosephusPaye (cc @adamturtle )
I took a bit of a look at this and while the code snippets are fairly simple it started me thinking about how to best structure the docs. Some of the pages are already quite long so I wondered if it was worth considering a bit of an overhaul of the docs so they are a bit easier to navigate…
I did up a rough mockup to create something inline with the material design approach, basically the primary change is introducing a navbar/tab thingy for each component, the three tabs being ‘examples’, ‘API’ and ‘playground’ (or some other name). The playground area would contain the code snippet builder similar to what vue mdl offers.
Anyway this was just an quick photoshop mockup of an idea, if people like the idea I’m happy to pursue it (of course feedback welcome). Or if it stinks I’m happy to add some plain snippets to the existing pages 😃
Regards, Rowan