Skip to content

ilikecoding-197/Snap-Doc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snap!Doc - Documentation Generator for Snap! Blocks

ALERT! THIS IS IN A VERY EARLY BETA STATE!

Snap!Doc is a documentation generator for Snap! blocks, designed to create structured documentation from a special set of blocks in each custom block.

How to use

Step 1: Create Custom Blocks

Really self explantory. You should have completed this step already.

Step 2: Add Documentation Blocks

Include the DocBlocks library from here to your project. Then, you can use the doc block, at the start of your block with the other documentation blocks. I dont't rellly know how to explain this, so here's an example:

Example

Do this will all of your blocks. If you dont do documenation for a block, the generator will do a really basic no documentation page for your block.

Step 3: Export Your Blocks

Open the Snap! project you want to document, and export it as a .xml file. This is done by clicking on the Snap! menu, then "Export Project", which will save the resulting blocks named something like [project name] blocks.xml.

Export

Step 4: Generate Script Pictures

If wanted, you can also generate block pictures to be displayed on their pages. This is really simple. Make sure, before you do this, JavaScript extensions are enabled in Snap!, like this:

Snap JavaScript

Then, go to the Docs category and click on the generate script pics block:

generate script pics

Now, a file named pictures.zip (or something like it) should've downloaded. Note the name down, you'll need it later.

Again, you don't need this; the generator will work fine without it, but its useful.

Step 5: Generate Documentation!

When you open index.html or the GitHub pages page, you should see something like this (taken from Firefox):

What you should see

There are a couple of options here. Here are what they mean:

  • Library name: The name of your library. Will be displayed in the index page, and the title of all of the pages.
  • Script pictures ZIP file: If you generate the script pictures in Step 4, you should select that downloaded zip file here. Again, not needed; but without it, readers wont be able to see your blocks!

Start by selecting the .xml file you exported in Step 3, and then press that Generate button! This will generate the documentation for your blocks.

Now the documentation will be generated, but you havent downloaded it yet.

Step 6: Download Documentation and View It!

After the documentation is generated, you will see that the Download button is no longer disabled. Press that, and it will download a zip file containing the documentation, in HTML. Extract this with your favorite archive extraction tool, and the folder extracted should look like this (taken on a Linux Mint system):

Documentation Files

Now, you can finally open the index.html file in your browser, and see the documentation you generated!

Documentation Index

Step 7: Explore!

You can now explore the documentation! Click on the links to see the documentation for each block. Heres a example page for the sum of (nums) block in the previous screenshot:

Block Documentation

Step 8: Host Your Documentation

You can host your documentation on GitHub pages, or any other static file hosting service. Just upload the contents of the extracted folder to your hosting service, and you should be able to access it via a URL. I'm going to add a section on how to do this later, but for now just search one up.

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue. Or, if you want to contribute code, feel free to open a pull request.

License

Licensed under the MIT License. See the LICENSE file for details.

Credits

First of all, well... me. ilikecoding-197 on GitHub, and CodingIsFun2831t on Snap. (The T was a typo. I dont know how to change it). Special thanks to Snap! for creating such a great visual programming language, of course.

About

Documentaton Generator for Snap! Blocks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published