Skip to content

Documentation generator #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
liquidev opened this issue Dec 20, 2019 · 0 comments
Open

Documentation generator #15

liquidev opened this issue Dec 20, 2019 · 0 comments

Comments

@liquidev
Copy link
Owner

liquidev commented Dec 20, 2019

It would be nice to have a doc generator for euwren modules. Syntax example:

import macros, os
const Docs = getProjectPath()/"docs"

wren.foreign("myModule"):
  # output is markdown for easy piping to pandoc or other renderers
  # (open to consideration, may use html or rst in the end)
  {.doc: Docs/"myModule.md".}
  MyClass:
    ## This class implements some methods.
    sayHello # doc comment is inherited from the proc
    printNumber ## This proc prints a number.
    # ↑ doc comment is specified explicitly
    *newMyClass -> new
    ?someField

Example of generated output:

## module `myModule`

### index
 - class `MyClass` (with a link to the class)

### class `MyClass`

#### `sayHello()`

Prints hello to the console.

#### `printNumber(x: number)`

This proc prints a number.

#### static `new()`

> no documentation provided

#### `someField`

> no documentation provided

A macro specifying generation options could be provided.

euwren.docOpt:
  format = "html"
  stylesheet = slurp("docStyle.css")
  # etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant