Git Product home page Git Product logo

leafdoc's Introduction

Leafdoc

Leafdoc (or 🍂doc for short) is a NaturalDocs- and JSdoc-like documentation generator.

Leafdoc's goals are to help produce documentation which is:

  • Concise: If you need half a page to describe what a function does, then Leafdoc is probably not for you.
  • Non-intrusive: Allow devs to write the minimum possible amount of documentation lines. A two-line function shouldn't need 15 lines of docs.
  • Narrative: Forget about exhaustive code introspection, and focus into providing freeform human-readable explanations and per-class code examples using Markdown to do the heavy lifting.
  • Language-agnostic: Designed with Javascript in mind (and its dozens of ways of doing class inheritance or defining methods), Leafdoc doesn't parse your source code, just the comments.

Try

See Leafdoc's own documentation as generated by Leafdoc, or the Leaflet documentation as generated by Leafdoc.

Try it yourself

git clone [...]
npm install
npm test

You will find a Leafdoc.html file. Open that file in a web browser, and you'll see Leafdoc's own documentation.

Command-line usage

npm install leafdoc
node_modules/.bin/leafdoc -t node_modules/leafdoc/templates/basic -o documentation.html src

See Leafdoc's own documentation for a reference of available parameters.

Write

The syntax is pretty much the tried-and-true directives-in-comment-blocks from JSdoc, NaturalDocs and a gazillion others. But instead of an @ symbol, Leafdoc uses a leaf:

/*
 * 🍂method addDir: this
 * 🍂param dirname: String
 * 🍂param extension: String
 *
 * Recursively scans a directory, and parses any files that match the given `extension`
 */

Leafdoc was designed with compactness in mind, so it accepts comment blocks consisting of adjacent // comment lines, and a shorthand syntax for function/method parameters. This is equivalent to the example just above:

// 🍂method addDir (dirname: String, extension: String): this
// Recursively scans a directory, and parses any files that match the given `extension`

If you need to be even more compact, use a semicolon (;) to put several directives in the same line:

// 🍂namespace Math; 🍂method sum(a: Int, b: Int): Int ; Returns the sum of two numbers

Valid directives

  • 🍂class and 🍂namespace should be at the top of your files. They define the context of the rest of the directives. A namespace can be used in more than one file (for example, when plugging more functionality to an existing class).

  • 🍂example lets some space to demonstrate how the class / namespace is meant to be used.

  • 🍂section allows you to group several functions, events, methods or options together, thematically. You may need to have sections without an explicit name to add stuff to the default section.

  • Methods, functions, options, etc are a generic thing internally named "documentable":

    • 🍂method
    • 🍂function
    • 🍂factory
    • 🍂constructor
    • 🍂destructor
    • 🍂option
    • 🍂event
    • 🍂example
    • 🍂property
  • Functions/methods/factories can have parameters, specified with 🍂param (name), 🍂param (name): (type) or inline (see below).

  • Classes, namespaces and documentables can have 🍂aka (alternative name), (short for Also Known As). This allows to create links to the same thing using different names.

  • Anything can have several 🍂comments, explaining the thing. 🍂comment directives can be implicit, because any (non-empty) line without an explicit directive equals to a comment.

  • If a function (or any other documentable) has several alternative uses, use the 🍂alternative directive after to re-defining the documentable, e.g.:

    /*
    🍂method on(type: String, fn: Function): this
    Adds the function `fn` as an event handler for the `type` event.
    
    🍂alternative
    🍂method on(types: [String], fn: Function): this
    Given an array of event types (strings), attaches `fn` as an event handler to each of them.
    */
    

    In this example, the two alternatives are on(type, fn) and on(fnMap). They will be shown as two different documentables.

  • 🍂inherits [parent] means that a class or namespace inherits all documentables from another class or namespace.

  • 🍂relationship [relationshiptype] [namespace] () is specific to thegraphviz

  • 🍂uninheritable is applied only to sections, and hides them from the

  • 🍂miniclass [name] [(parentname)] defines a class/namespace that shall display inside the parent namespace (specified between parentheses); most useful for very concide classes/data structs that are useful only within the context of the parent namespace.

Shorthand syntax

Any documentable has the same syntax: name, optional required flag, optional parameters, optional type / return type/value, default value.

name[?] [ ( params ) ] [: type] [= default]

where params is

name[?] [ : type ]  [ , name[?] [ : type ]  [ , name[?] [ : type ] ...  ]   ]

and where name is a valid unicode identifier, or an ellipsis (). type and default are freeform and can have spaces.

Which means the following are possible:

An option usually has a type and a default value:
🍂option enabled: Boolean = true

But we can omit the default value:
🍂option enabled: Boolean

Or omit just the data type:
🍂option enabled = true

Or even just say there is an option:
🍂option enabled

A function with a return type:
🍂function get: String

A function with one parameter:
🍂function get(id: Int): String

Or two:
A function with one parameter:
🍂function sum(a: Int, b: Int): Int

The last function can also be written without the parameters shorthand:
🍂function sum: Int
🍂param a: Int
🍂param b: Int

Use an interrogation sign to specify a parameter as optional:
🍂function update(force? : Boolean): null

Use ellipsis to mark optional parameters:
🍂function update(…): null

You can specify everything (name, optional, params, type, default), but no documentable uses them all in the templates. The usual schema is:

Params Type Default
example
option X X
property X X
event X
method X X
function X X
factory X
constructor X
factory X

Relationships format

Relationships are meaningful for class diagrams. They correspond with the UML class diagram

The syntax is:

🍂relationship type namespace [ ,cardinalityFrom [ ,cardinalityTo [ ,label ]]]

The following relationship types are implemented for display in the graphviz-class-diagram templates:

  • associated
  • implements
  • dependsOn
  • aggregationOf
  • compositionOf

Note that class inheritance is a separate directive (🍂inherits) .

namespace must be an identifier; cardinalityFrom and cardinalityTo must not have commas in them.

Some examples of how 🍂relationship works:

🍂namespace ConcreteClass
🍂relationship implements AbstractClass
🍂namespace Classroom
🍂relationship aggregationOf Student, 0..n, 1..n
🍂relationship aggregationOf Teacher, 1, 0..n
🍂namespace Caller
🍂relationship associated Callee ,, calls

Output customization

The output relies on a set of handlebars templates. By default, the ones in templates/basic will be used. In order to use another set of templates, pass the templateDir` option to the Leafdoc constructor, like so:

var l = new Leafdoc({templateDir: 'leaflet'});

I will write no detailed docs on how to modify the templates. If you know some HTML and handlebars, just copy them and hack things away :-)

Custom documentables

Your code might have several things of the same kind, which you want to show in the same fashion as documentables. Maybe it's files, or icons, or you have 5 trivial sub-classes which only merit one line.

You can define custom documentables by doing so:

var l = new Leafdoc();
l.registerDocumentable('icon', 'Available icons');

Whenever you add a custom documentable, you'll need to create its handlebars template too! Failure to do so will throw an error when you are building your documentation.

Your custom documentable will accept parameters, type, and default as the rest of documentables, and can follow the shorthand syntax. You will have to map parameters, type and default to something that makes sense for that documentable. For example, the template might map an icon's filename to the documentable's default:

🍂icon happy = 'icons/happy.gif'
A happy face

Also documentables can be inheritable or not. For example you have some entities in namespace which can be inherited. Pass true to third argument of registerDocumentable to make documentable inheritable:

var l = new Leafdoc();
l.registerDocumentable('field', 'Fields', true);

And later in your documentation:

🍂field limit? = 5
A limit for query

Known gotchas

  • Leafdoc relies on some ugly per-module globals, so having more than one instance in your code (in the same process) might break things up. The use case for Leafdoc is to have just one instance when building docs for your code.

Legalese

Licensed under the GNU General Public License version 3 (or "GPL3"). Check the full text at https://www.gnu.org/licenses/gpl-3.0.html.

Troubleshooting

I'm using Debian and I cannot see the leaf character!

Run apt-get install fonts-symbola.

I cannot type 🍂 in my keyboard!

(Linux only) Write this into a plain text file:

keycode  46 = l L l L U1F342 Lstroke lstroke

Then run xmodmap name-of-the-file. Now 🍂 is mapped to AltGr+l.

Of course, you can always do leafdoc.setLeadingCharacter('@');, but that's boring.

leafdoc's People

Contributors

anru avatar cherniavskii avatar delawen avatar ejb avatar grantfree035 avatar ivansanchez avatar mondeja avatar perliedman avatar yohanboniface avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leafdoc's Issues

Automagically parse stuff without leading character

From a conversation with @mourner:

Is the 🍂really mandatory or can we just get rid of it in Leafdoc and do some simple heuristics to determine if a comment is a docs comment? Always hated rules that /** jsdoc one, this was is even harsher
e.g. if a comment looks like method foo(), it's probably a doc; if it's parsed like a doc and there's an error, we could just ignore it

Inline Unicode-7.0.0 regexes

@IvanSanchez Currently the unicode-7.0.0 dependency, which is required by the lines below, takes 124MB in Leaflet node_modules folder. To make Leafdoc leaner, I suggest either inlining those two regexps and removing the dependency (which should take just a dozen kilobytes), or doing Rollup magic and thus moving unicode-7.0.0 to devDependencies.

Leafdoc/src/regexps.js

Lines 42 to 43 in 6b7d38a

ID_Start: require('unicode-7.0.0/properties/ID_Start/regex'),
ID_Continue: require('unicode-7.0.0/properties/ID_Continue/regex')

Purpose of namespace

Hi there,

Namespace and Class directives are basically aliases for each other (regarding the implemenation), which is confusing, because a namespace may be considered as a construct which contains multiple classes. Kinda like a grouping feature.

The documentation (README.md)

A namespace can be used in more than one file (for example, when plugging more functionality to an existing class).

doesn't reflect that Namespace and Class are the same and the implementation doesn't enforce the documented behavior.

Also I think Namespace and Class should use different templates to help differentiating each other visually if desired.

Best regards

Can I describe mixins?

I'd like to document mixins. Is this possible with Leafdoc?

EDIT: Ah, looks like I'd need to make a custom documentable, mixin for example.

No need redirecting in running test.js

README.md says

js test.js > leafdoc.html

> leafdoc.html is unnecessary because of sander.writeFileSync('Leafdoc.html', out);.

Question:
Does js mean SpiderMonkey here? I think leafdoc is supposed to run with Node.js.

Lazily copied inheritances

In order to save room, inheritances should be able to be lazily copied within the DOM via JS whenever the user expands them.

This might not be the preferred solution (docs should work without JS). Maybe this can be done via clever templates (output only names of inherited stuff, let the main HTML template have the JS to lazily load everything).

Problems with nested comments

Consider the following:

/*
🍂class LoremIpsum

Lorem ipsum dolor sit amet.

 ```js
var l = new LoremIpsum(); // Instanciates a new LoremIpsum
 ```.
*/

In this case, the inline // comments will somehow screw up because they seem to be parsed twice.

  • Provide minimal working file with failing leafdoc comments
  • Debug parsing

No output

Alright, I'm attempting to get it to output something.

I tried opening up my src/index.ts file, and I copied the Leafdoc docs into it with @ symbols, so it looks like this:

import {Class, Mixin} from 'lowclass'
export {Class, Mixin}
export * from './core'
export * from './html'
export * from './components'
export * from './layout'

export const version = '21.0.6'

/*
@namespace Command-line usage

Leafdoc includes a small command-line utility, useful when running from a console or a shell script, accepting some of the Leafdoc options. The syntax is:

`leafdoc [options] [files]`

@example

`leafdoc -t templates/pretty -c '@' --verbose -o documentation.html src/*.js`

*/

// @option template: String='templates/basic'; Akin to [Leafdoc.templateDir](#leafdoc.templatedir)
// @option t; Alias of `template`
// @option character: String='@'; Akin to [Leafdoc.leadingCharacter](#leafdoc.leadingcharacter)
// @option c; Alias of `character`
// @option verbose: Boolean=false; Akin to [Leafdoc.verbose](#leafdoc.verbose)
// @option v; Alias of `verbose`
// @option output: String=undefined; File to write the documentation to. If left empty, documentation will be outputted to `stdout` instead.
// @option o; Alias of `output`
// @option json: Boolean=false; Write the internal JSON representation of the documentation instead of a templated HTML file.
// @option o; Alias of `output`

Then I tried to run leafdoc on it, like this:

npx leafdoc -c '@' -t node_modules/leafdoc/templates/basic -o documentation.html src/index.ts

and the resulting HTML file is empty:

<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
	<style>
	table {
		border-collapse: collapse;
	}
	table td, table th {
		border: 1px solid #888;
	}
	pre code {
		display: inline-block;
		background: #eee;
	}
	td:last-child code {
		background: #eee;
	}
	body {
		font-family: Sans;
	}
	</style>
</head>
<body>
	<h2>Leafdoc generated API reference</h2>

	

</body></html>

What am I missing?

Avoid links inside links

Some docstring blocks might generate links inside links. Specifically...

/**
 * @class KeyboardEvent
 * @inherits Event
 * @property originalEvent: DOMEvent
 * The original [DOM `KeyboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent) that triggered this Leaflet event.
 */

...turns DOM `KeyboardEvent` into DOM <a href='#keyboardevent`>KeyboardEvent</a> , breaking the outer link.

Hide Marker Icon until Map Is Clicked

Feature Request -

It would be helpful if we had an option to not show the Marker Icon until the map is clicked.

I was able to override this behavior in the L.Draw.Marker._onMouseMove Event by setting the opacity of the marker to 0.

L.Draw.Marker = L.Draw.Marker.extend({
    _onMouseMove: function (e) {
        var latlng = e.latlng;
        this._tooltip.updatePosition(latlng);
        this._mouseMarker.setLatLng(latlng);

        if (!this._marker) {
            this._marker = new L.Marker(latlng, {
                icon: this.options.icon,
                zIndexOffset: this.options.zIndexOffset,
                opacity: 0, //Override: Hide marker
            });
            // Bind to both marker and map to make sure we get the click event.
            this._marker.on('click', this._onClick, this);
            this._map
				.on('click', this._onClick, this)
				.addLayer(this._marker);
        }
        else {
            latlng = this._mouseMarker.getLatLng();
            this._marker.setLatLng(latlng);
        }
    }
});

However, it would seem more feasible to do something like changing:

if (!this._marker)

to

if (!this._marker && this.options.showMarkerOnMouseMove)

Use case here is quite simple...we don't see the marker until the map is clicked, similar to the polygon draw.

Implement 'static' and 'constructor' directives

Pretty much like method and function, but labelled as "Static methods" instead.

Also implement a constructor directive, pretty much like factory but allowing namespaces instead of identifiers (i.e. dots) and printing "new", e.g. new L.Draggable

Feature Request -Hide Marker Icon until Map Is Clicked

It would be helpful if we had an option to not show the Marker Icon until the map is clicked.

I was able to override this behavior in the L.Draw.Marker._onMouseMove Event by setting the opacity of the marker to 0.

L.Draw.Marker = L.Draw.Marker.extend({
_onMouseMove: function (e) {
var latlng = e.latlng;
this._tooltip.updatePosition(latlng);
this._mouseMarker.setLatLng(latlng);

    if (!this._marker) {
        this._marker = new L.Marker(latlng, {
            icon: this.options.icon,
            zIndexOffset: this.options.zIndexOffset,
            opacity: 0, //Override: Hide marker
        });
        // Bind to both marker and map to make sure we get the click event.
        this._marker.on('click', this._onClick, this);
        this._map
			.on('click', this._onClick, this)
			.addLayer(this._marker);
    }
    else {
        latlng = this._mouseMarker.getLatLng();
        this._marker.setLatLng(latlng);
    }
}

});

However, it would seem more feasible to do something like changing:

if (!this._marker)

to

if (!this._marker && this.options.showMarkerOnMouseMove)

Use case here is quite simple...we don't see the marker until the map is clicked, similar to the polygon draw.

Miniclass directive produces wrong html in some cases

Hi there,

I tried the following cases with the basic templates and the latest leafdoc (1.4.1).

test01.leafdoc

@miniclass MyMiniClass (MyParentClass)

A comment, lonely but its happy.

produces

<h2 id="myparentclass">MyParentClass</h2>
<h2 id="myminiclass"></h2>
A comment, lonely but its happy.

What is wrong: Name of the Miniclass is missing.

test02.leafdoc

@miniclass MyMiniClass (MyParentClass)
@section

A comment, lonely but its happy.

produces

<h2 id="myparentclass">MyParentClass</h2>
<h2 id="myminiclass"></h2>

What is wrong: Name of the Miniclass and Comment are missing.

test03.leafdoc

@miniclass MyMiniClass (MyParentClass)
@section

A comment, lonely but its happy.

@option foo : Boolean = true

produces

<h2 id="myparentclass">MyParentClass</h2>
<h2 id="myminiclass"></h2>
<h3 id="myminiclass-option">MyMiniClass</h3>
<section data-type="[object Object]">
A comment, lonely but its happy.
<table><thead>
	<tr>
		<th>Option</th>
		<th>Type</th>
		<th>Default</th>
		<th>Description</th>
	</tr>
	</thead><tbody>
	<tr id="myminiclass-foo">
		<td><code><b>foo</b></code></td>
		<td><code>Boolean</code>
		</td><td><code>true</code></td>
		<td></td>
	</tr>
</tbody></table>
</section>

What is wrong: Two headings for the Miniclass (h2 is empty, h3 is not and has the wrong string). Comment is in the wrong place (should be outside of the "section" element).

test04.leafdoc

@miniclass MyMiniClass (MyParentClass)

A comment, lonely but its happy.

@option foo : Boolean = true

produces

<h2 id="myparentclass">MyParentClass</h2>
<h2 id="myminiclass"></h2>
A comment, lonely but its happy.
<h3 id="myminiclass-option">MyMiniClass</h3>
<section data-type="[object Object]">
<table><thead>
	<tr>
		<th>Option</th>
		<th>Type</th>
		<th>Default</th>
		<th>Description</th>
	</tr>
	</thead><tbody>
	<tr id="myminiclass-foo">
		<td><code><b>foo</b></code></td>
		<td><code>Boolean</code>
		</td><td><code>true</code></td>
		<td></td>
	</tr>
</tbody></table>
</section>

What is wrong: Two headings for the Miniclass (h2 is empty, h3 is not and has the wrong string).

Also, maybe the Miniclass directive should have it's own template. And the miniclass feature is not documentated at all (README.md).

Best regards

Error when drawing polygon: Cannot read property 'x' of undefined

Hi guys, I'm trying to add the leaflet draw in VueJS 3 but when I create a drawing the leaflet returns the error Cannot read property 'x' of undefined

Uncaught TypeError: Cannot read property 'x' of undefined
    at Proxy.intersects (app.js:32431)
    at Proxy._clipPoints (app.js:39706)
    at Proxy._update (app.js:39751)
    at Proxy._reset (app.js:39250)
    at Proxy.onAdd (app.js:39195)
    at Proxy._layerAdd (app.js:37950)
    at Proxy.whenReady (node_modules_leaflet_dist_leaflet-src_esm_js.js:4512)
    at Proxy.addLayer (node_modules_leaflet_dist_leaflet-src_esm_js.js:6713)
    at Proxy.addVertex (app.js:31161)
    at Proxy._endPoint (app.js:31161)

I'm using the ready event to add the draw control


<l-map id="mapView" :zoom="zoom" @ready="onReady" ref="map" >
    <l-tile-layer :url="url"></l-tile-layer>
</l-map>

import "leaflet-draw";
import "leaflet-draw/dist/leaflet.draw.css";

onReady(mapObject) {
    mapObject.locate();

    this.drawControl = new L.Control.Draw({
        draw: {
            polyline: false,
            polygon: true,
            circle: false,
            marker: false,
            circlemarker: false,
            rectangle:false
        }
    });
    
    mapObject.addControl(this.drawControl);
},

Has anyone been through this, could you help me?

Idea: "relationship" directive for graphviz output

Generatinc pesudo-ULM class diagrams is cool. It could be improved by adding a "relationship" directive, to specify different kinds of relationships between classes/namespaces; these should show up in the graphviz output as different kinds of edges between namespaces.

Section directive won't print comment

Hi there,

I tried the following case with the basic templates and the latest leafdoc (1.4.1).

test.leafdoc

@class MyClass

A comment, lonely but it's happy.

@section MySection

A comment in MySection, lonely but it's happy.

produces

<h2 id="myclass">MyClass</h2>
A comment, lonely but it's happy.

What is wrong: The section is missing (and the comment of the section of course). A section should be printed even if it's empty.

Best regards

HTML Notation is not parsed correct

There is a issue Leaflet/Leaflet#6208 where the ' is not correct parsed, the regex have to be changed:

Doc

@option zoomOutText: String = '&#x2212;'

Regex:

\s*(?:)@(?:)((?:)\S+)(?:)(?:\s+(?:)((?:)[^;\n]+)){0,1}

When the ; is removed it works.

I tried do change it and select until the exact match ;\n with or without ; but the regex is to complicated for me.

env: js: No such file or directory

I'm trying to run leafdoc cli, and I get an error env: js: No such file or directory:

❯ npx leafdoc
env: js: No such file or directory

❯ npx leafdoc -h
env: js: No such file or directory

❯ npx leafdoc -t node_modules/leafdoc/templates/basic -o documentation.html src/**/*.ts
env: js: No such file or directory

Any idea about the error?

I must be a bad luck magnet with doc tools: every doc tool I try has some issue preventing me from getting started!

File handling logic

  • Allow parsing raw doc files (entire file are directives, without need for comments)
  • Recursively add all files in a directory
  • Cover the use case of using an "index" file with just namespace and section definitions to keep the wanted ordering

Enable use of directive leading character (:fallen_leaf: or @) within docstring content

Original issue: Leaflet/Leaflet#5668

Example (using "@" as the leading character like in Leaflet):

/*
 * @class TestLeafdoc
 *
 * this is my text
 * with another line
 * and now testing the "@" symbol
 * this should be after the "&commat;" symbol.
 */

The "and now testing the "@" symbol" line does not appear in the generated HTML output.

Might be interesting detecting the leading character (:fallen_leaf: or @ or whatever) only if it appears at the beginning of the line?

Or warn that it should not be used within the content?

Allow for custom leading characters

Some devs might not want to use 🍂 in the code. Some might want to use 📄 for docs, or 💩 or even -gasp- an ascii-7 character like @.

The leading character to be parsed should be passed as an option to the 🍂doc constructor.

Allow un-inheritable sections

Some sections don't make sense on the children classes - like extension methods in Leaflet's Layer or the static inheritance stuff in Leaflet's Class.

There should be a way, most likely in the build script (as a Leafdoc API) to switch off inheritance of some sections.

Rationale for that is that there might be a plugin developers API, or even several levels of API altogether, defined by which sections to show.

Please add a licence

Very short: Please add a licence to this project. :)

BTW: Great work!

Best regards

EDIT: Ah, nevermind, totally overlooked the legal notice in README.md. Sry, but you may consider adding a licence file. :)

Output multiple files (f.e. one doc file per source file)

Any thoughts on how to do it?

I am thinking of a few options:

  1. add ability to leafdoc to output to separate files, one per source file, so that it keeps context across all files.
  2. Write to a single file (or stdout), and have a secondary process split files based on some delimiter (maybe also the path/filename.ext included by the delimiter too, for outputting files in the same structure). This would also maintain context across files.
  3. Invoke leafdoc on each file separately, but this currently loses context (from what I can tell). We'd need a way to link across files. Maybe we can treat names as paths to other files, and have only a single class per file? That would be somewhat restrictive and performance heavy though. Hmmm 🤔

Formatting is hit or miss...

I'm in the process of transferring all the documentation to leafdocs style for Leaflet.Draw (to encourage documenting changes).

I find that formatting from tables, code blocks, and lists are all hit or miss. Sometimes they generate close enough html or don't pick up the formatting at all.

Example:

I have the following in docs-misc.leafdoc

@namespace CDN's
Several CDN's have Leaflet.Draw available.

| CDN and type   |   URI            |
| -------------- | ---------------- |
| unpkg css| https://unpkg.com/[email protected]/dist/leaflet.draw.css |
| unpkg js | https://unpkg.com/[email protected]/dist/leaflet.draw.js |
| cdnjs css| https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.4.0/leaflet.draw.css |
| cdnjs js | https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.4.0/leaflet.draw.js |

Obviously expect it to parse into...

CDN's

Several CDN's have Leaflet.Draw available.

CDN and type URI
unpkg css https://unpkg.com/[email protected]/dist/leaflet.draw.css
unpkg js https://unpkg.com/[email protected]/dist/leaflet.draw.js
cdnjs css https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.4.0/leaflet.draw.css
cdnjs js https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.4.0/leaflet.draw.js

but it formats as

| CDN and type | URI | | -------------- | ---------------- | | cdnjs css| https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.4.0/leaflet.draw.css | | cdnjs js | https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.4.0/leaflet.draw.js |

Note This may very well be an issue with the marked library but there are no issues attached to that library that fit this issue or issues. I've created a ticket with marked to describe the issue and link back to this ticket as a parent.

Allow several directives in one line

From a conversation with @mourner:

add the ability to separate docs directives with ; on the same line instead of line break, just to make things terser in some cases

/*
@class Control.Attribution
@aka L.Control.Attribution; @inherits Control
*/

@constructor vs @factory

Most leaflet classes have a factory function (@factory) that outputs to the Creation section of the class. Can we add @constructor functions there too? Some classes only have constructors, so their docs are missing.

Finish up miniclasses support

"Miniclasses" are being parsed, but rendered as normal classes/namespaces.

When stringifying a namespace, skip the class if it's a miniclass, and iterate through miniclasses after all sections have been outputted, to render miniclasses for a class.

leafDirective doesn't work

function redoLeafDirective(char) {
    leafDirective = XRegExp('  \\s* ' + char + ' (?<directive> \\S+ ) (\\s+ (?<content> [^;\\n]+ )){0,1} ', 'gnx');
    // I think we need this line
    module.exports.leafDirective = leafDirective;
}

Multiple inheritance breaks inherited documentables

Specifying more than one @inherits directive will break the inherited properties/methods/etc on the output. e.g. ...

@class foo
@inherits bar
@inherits quux

@class bar
@method barbar()

... the inherited method barbar will not show in the HTML Docs for the foo class.

Fix miniclasses in graphviz output

Right now miniclasses break the graphviz output (they are echoed as full node definitions, while being inside another node's HTML label).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.