McFly Runtime: Embedded Package Documentation for Racket
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 mcfly racket/contract) (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.") (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!")) (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
syntax
(doc history history-entry ...) (doc scribble pre-flow ...) (doc pre-flow ...)
history-entry = (maybe-version planet date pre-flow ...) maybe-version =
| #:version string planet = #:planet number-colon-number-symbol date = #:date yyyy-mm-dd-string
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
- Version 2:2 —
2016-02-26 Commented out some tests to fix builds.
- Version 2:1 —
2016-02-25 Fixed deps.
- Version 2:0 —
2016-02-21 Kludging to support the new package system, hopefully without disrupting the PLaneT support too much.
- Version 1:3 —
2012-07-14 #lang at-exp is now supported. (Thanks to Asumu Takikawa for suggesting.)
- Version 1:2 —
2012-07-13 Made parse-planet-symbol-string/ignore-equals more permissive. (Thanks to Asumu Takikawa.)
Documentation fixes. (Thanks to Tim Brown.)
- Version 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.
- Version 1:0 —
2012-06-11 First alpha release. Not for general use.
5 Legal
Copyright 2012, 2016 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.