snippet-extractor: Extracts labeled snippets of code to files.

[ bsd3, program, text ] [ Propose Tags ]

Snippet-extractor looks for snippets in files and places those snippets in their own files.

A snippet is defined as consecutive lines in a file delimited by "@snippet-start <filename>" and "@snippet-end", the extracted snippet is placed in the provided filename. If the desired filename contains spaces, put the filename in quotes.

Everything on the line with the start and end markers is discarded. Snippet-extractor should be agnostic to the syntax of the file you are extracting from.

Here is an example:

 /* @snippet-start snippet1.c */
 for(i = 0; i < 100; i++){
   printf("%d\n",i);
 }
 /* @snippet-end */

The above snippet would be extracted and placed in snippet1.c

Snippet-extractor is intended for use in documentation. For example, the snippets could be extracted from working code and then included in a text about the code.

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.2.0
Dependencies base (>=4 && <5), parsec (>=3.1 && <3.2) [details]
License BSD-3-Clause
Author Jason Dagit
Maintainer dagitj@gmail.com
Category Text
Source repo head: git clone git://github.com/dagit/snippet-extractor.git
Uploaded by JasonDagit at 2010-12-29T00:59:03Z
Distributions NixOS:0.2.0
Reverse Dependencies 1 direct, 0 indirect [details]
Executables snippet-extractor
Downloads 1774 total (10 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2016-12-28 [all 7 reports]