McFly Runtime: Embedded Package Documentation for Racket
(require (planet neil/mcfly:1:3)) |
1 Introduction
McFly is so-named due to users of McFly saying “doc” all the time.
1.1 Example
"main.rkt"
#lang racket/base (require racket/contract (planet neil/mcfly)) (provide/contract (celsius->fahrenheit (-> number? number?)) (fahrenheit->celsius (-> number? number?))) (doc (section "Introduction") (para "This package provides procedures for temperature conversion. The Wikipedia entries for " (hyperlink "http://en.wikipedia.org/wiki/Celsius" "Celsius") " and " (hyperlink "http://en.wikipedia.org/wiki/Fahrenheit" "Fahrenheit") " were used as authoritative references.")) (doc (section "Interface")) (doc procedure celsius->fahrenheit "Returns Celsius temperature " (racket c-degrees) " as Fahrenheit. For example:" (racketinput (celsius->fahrenheit 0) #,(racketresult 32)) "Celsius is named after the Swedish astronomer Anders Celsius. Sweden is historically part of the Vodka Belt, with high consumption of distilled beverages, and binge drinking. That is not to imply anything about validity of Swedish temperature units (cough, cough); just sayin'...") (define (celsius->fahrenheit c-degrees) (+ (* c-degrees 9/5) 32)) (doc procedure fahrenheit->celsius "Returns Fahrenheit temperature " (racket f-degrees) " as Celsius. ``Fahrenheit'' starts with `F'. You know what else starts with `F'? " (italic "Freedom") ". That's right: " (italic "America! Free-dom! Freedom is the only way!")) (define (fahrenheit->celsius f-degrees) (* (- f-degrees 32) 5/9)) (doc history (#:planet 1:1 #:date "2000-01-02" "Fixes Y2K bug.") (#:planet 1:0 #:date "1997-08-29" "Initial version. Judgment Day by Skynet."))
@doc[procedure foo @para{This is a @italic{bar}.}] |
(doc procedure foo (para "This is a " (italic "bar") ".")) |
2 Interface
3 Known Issues
Scribble is not linking identifiers. First assumption is that some information used by Scribble, perhaps lexical context from the syntax objects, is not preserved.
There is a kludge involving mcfly:para-if-pre-content that we’d like to get rid of.
The ability to infer information for turning (doc procedure ...) to defproc syntax is limited. Presently, McFly recognizes only a few forms, such as define...lambda and provide/contract. lambda is handled pretty well. The only procedure contract combinator handled at the moment is ->. The current internal representation and unification can support some other things with few changes, but we have not yet gotten to it.
It could use better testing.
4 History
- PLaneT 1:3 —
2012-07-14 #lang at-exp is now supported. (Thanks to Asumu Takikawa for suggesting.)
- PLaneT 1:2 —
2012-07-13 Made parse-planet-symbol-string/ignore-equals more permissive. (Thanks to Asumu Takikawa.)
Documentation fixes. (Thanks to Tim Brown.)
- PLaneT 1:1 —
2012-06-13 When mcfly-subtitle is used, the name is no longer put in boldface in generated titles by McFly. (That was an old PLT convention that was visible in the documentation index, but apparently is not used anymore.) Instead, if mcfly-subtitle is used, and name is exactly equal to the name part of the PLaneT package spec (sans .plt), then the name part is put in code in the title.
Documentation changes.
- PLaneT 1:0 —
2012-06-11 First alpha release. Not for general use.
5 Legal
Copyright 2012 Neil Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License,or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See http://www.gnu.org/licenses/ for details. For other licenses and consulting, please contact the author.