dartdoc 0.9.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • --

dartdoc #

Build Status

Use dartdoc to generate HTML documentaton for your Dart package.

If you want to contribute to the dartdoc project, see the contributor docs. This page contains information about using the dartdoc tool.

Installing dartdoc #

From the Dart SDK #

Download the Dart SDK, version 1.12-dev.5.10 or later. If not already added, add the SDK's bin directory to your PATH.

From pub.dartlang.org #

You can install the latest version of dartdoc with pub:

$ pub global activate dartdoc

Note: to ensure that this version is run when you type dartdoc on the command line, make sure that ~/.pub-cache/bin is on your PATH, and before the path to the Dart SDK.

Generating docs #

Run dartdoc from the root directory of package. For example:

$ dartdoc
Generating documentation for 'server_code_lab' into <path-to-server-code-lab>/server_code_lab/doc/api/

parsing lib/client/piratesapi.dart...
parsing lib/common/messages.dart...
parsing lib/common/utils.dart...
parsing lib/server/piratesapi.dart...
Parsed 4 files in 8.1 seconds.

generating docs for library pirate.messages from messages.dart...
generating docs for library pirate.server from piratesapi.dart...
generating docs for library pirate.utils from utils.dart...
generating docs for library server_code_lab.piratesApi.client from piratesapi.dart...
Documented 4 libraries in 9.6 seconds.

Success! Docs generated into <path-to-server-code-lab>/server_code_lab/doc/api/index.html

By default, the documentation is generated to the doc/api directory as static HTML files.

Run dartdoc -h to see the available command-line options.

Viewing docs #

You can view the generated docs directly from the file system, but if you want to use the search function, you must load them with an HTTP server.

An easy way to run an HTTP server locally is to use the dhttpd package. For example:

$ pub global activate dhttpd
$ dhttpd --path doc/api

Navigate to http://localhost:8080 in your browser; the search function should now work.

dartdoc produces static files with a predictable link structure.

index.html                          # homepage
index.json                          # machine-readable index
library-name/                       # : is turned into a - e.g. dart:core => dart-core
  ClassName-class.html              # "homepage" for a class (and enum)
  ClassName/
    ClassName.html                  # constructor
    ClassName.namedConstructor.html # named constructor
    method.html
    property.html
  CONSTANT.html
  property.html
  top-level-function.html

File names are case-sensitive.

Writing docs #

Check out the Effective Dart: Documentation guide.

The guide covers formatting, linking, markup, and general best practices when authoring doc comments for Dart with dartdoc.

Excluding from documentation #

dartdoc will not generate documentation for a Dart element and its children that has the <nodoc> tag in the documentation comment.

Older versions #

As of Dart 1.12, dartdoc is shipped with the Dart SDK and replaces the older docgen tool.

Issues and bugs #

Please file reports on the GitHub Issue Tracker.

License #

Please see the dartdoc license.

0.9.3 #

  • [enhancement] added support for URL-based search. If a query parameter named "search" is passed, the page navigates to the first search result for its value.
  • [enhancement] added support for passing more than one --header or --footer
  • [enhancement] added the ability to include libraries referenced by (but not directly inside) the project (--include-external)
  • [bug] rev the analyzer version used to fix an issue generating docs for Flutter

0.9.2 #

  • [bug] do not generate docs for dart:_internal and dart:nativewrappers, when defined in the _embedder.yaml file.
  • [enhancement] print message to run pub if dartdoc does not find any libraries to document.

0.9.1 #

  • [bug] fix generating docs for packages with _embedder.yaml

0.9.0 #

  • BREAKING works with Dart SDK 1.14.0 and above
  • [health] use package resource
  • [enhancement] add support for packages with _embedder.yaml
  • [bug] fix generating docs when input == '.'
  • [bug] modify showing constants so that there is no double const shown in value.

0.8.5 #

  • [enhancement] do not document if there is a <nodoc> in the doc comment.
  • [bug]link typdefs when used as parameters
  • [bug] fix issue with processing <pre> tags
  • [health] run tests only once on travis
  • [health] speed up dartdoc with caching and upgrade to latest analyzer package

0.8.4 #

  • [enhancement] Only include generator metadata in the package index.html file.
  • [bug] Fixed the display of deprecated properties.
  • [bug] show generics for typedefs
  • [bug] cleanly unzip docs on Mac
  • [health] upgrade to latest analyzer package

0.8.3 #

  • [enhancement] Added --[no-]include-source option.
  • [enhancement] Dimmed inherited members in the right sidebar.

0.8.2 #

  • [bug] fix exception due to change in analyzer, function types in parameters are no longer treated as typedefs.

0.8.1 #

  • [bug] No longer includes <base> element in the package root.
  • [bug] Eliminates a number of empty class attributes.
  • [bug] Show deprecated libraries the same way in both package and library view.
  • [bug] Process readme.md Markdown with the process that is used in document comments.

0.8.0 #

  • [bug] fix annotation shown as raw HTML in constructors
  • [bug] fix missing return type when Future
  • [enhancement] do not show "Not documented." message for members without doc comments
  • [enhancement] show constructors before properties in right side bar
  • [enhancement] sort names with embedded integers lexicographically
  • BREAKING initGenerators is now async. It returns Future<List<Generator>>.
  • BREAKING markdown_processor.dart and resource_loader.dart are no longer exposed as public libraries. Use of these libraries by third-party code is no longer supported.
  • BREAKING generator.dart is no longer exposed as a stand-alone library. You can access the Generator class by importing dartdoc.dart.

0.7.4 #

  • [bug] In class documentation, move constructors before instance properties
  • [bug] fix property pages to show documentation if not a setter/getter
  • [bug] show indented code blocks in comments as code

0.7.3 #

  • [bug] Add missing close span in accessor setter template
  • [enhancement] Print usage if an invalid argument is provided
  • [enhancement] Improve the output of asynchronous stack traces when an unhandled exception is thrown
  • [health] removed doc uploads to firebase
  • [bug] fixed incorrect 'link to Crossdart' links
  • [health] upgraded packages, modified pubspec.lock

0.7.2 #

  • [bug] do not show '///' in doc output

0.7.1 #

  • [enhancement] restore the method signature at the top of method/ctor/function/operator pages
  • [enhancement] search using fully qualified names
  • [enhancement] better messaging when library itself lacks comments
  • [enhancement] indicate when a class is an abstract class
  • [enhancement] indicate when a constructor is a factory constructor

0.7.0 #

  • [feature] --add-crossdart flag to add links to http://crossdart.info in the source code section
  • [bug] show type information for Map with generics
  • [bug] show methods/properties inherited from Object
  • [health] remove --url-mappings option, the analyzer picks up SDK extensions from the package
  • [style] changed how we display constant values

0.6.6 #

  • [style] reduce number of fonts and styles used on a page
  • [enhancement] do not show method signature for methods with source

0.6.5 #

  • [new] --rel-canonical-prefix to help with SEO for many versions of the same docs
  • [bug] fixed linking in the SDK docs
  • [enhancement] do not display comments with actual source code
  • [enhancement] show source code for constructors
  • [style] tweaks to the footer
  • [health] re-enable uploading dartdoc docs to firebase

0.6.4 #

  • [upgrade] markdown ^0.8.0
  • [health] clean up markdown files
  • [enhancement] change callable metadata to be the same as class
  • [enhancement] print annotations on separate lines

0.6.3 #

  • [bug] remove duplicate property entries
  • [enhancement] better distinction between getters and setters for properties
  • [enhancement] link inherited elements to superclass pages if available
  • [bug] fix README.md not rendering correctly on pub.dartlang
  • [health] resume testing on stable channel

0.6.2 #

  • Instructions on contributing moved to CONTRIBUTOR.md
  • Fixed bug with doc comment with name in both current and imported library might be incorrectly linked
  • Now linking to detail pages for inherited methods, operators, properties
  • Strike-through deprecated names more often (e.g. on the sidebar)

0.6.1 #

  • Removed the --package-root option. Dartdoc now uses the --input flag as the place to start looking for an analysis root. This better supports the .packages file and use cases where dartdoc is invoked from locations other than the project directory.
  • Search box displays message when it fails to load its index
  • Changed message printed when dartdoc finishes, pointing to path instead of URI
  • Reduced color saturation in header and links
  • Improved display of getters and setters on property pages

0.6.0+1 #

  • [bug] fix for getting URI for sources in lib folder

0.6.0 #

  • [enhancement] / key activates the search bar
  • [bug] combined getter/setter docs were mangled
  • [enhancement] exact matches in search now rank higher
  • [enhancement] search box starts with "Loading..."
  • [enhancement] provide a hint that there are more docs than the one-liner
  • [sdk] bundle dartdoc with SDK
  • [bug] links in right column of MapBase did not work
  • [enhancement] reorder details about a class, like inheritance
  • [sdk] fix links in SDK's front page README

0.5.0+3 #

  • [bug] fixed issue with duplicate docs for properties

0.5.0+1 #

  • [bug] fixed an issue running dartdoc as a pub global activated snapshot

0.5.0 #

  • [health] remove calls to deprecated methods
  • [health] remove workaround when sorting empty iterable
  • [sdk] now requires Dart SDK 1.12-dev or greater
  • [bug] homepage column widths now add up to 12
  • [enhancement] display ellipse when text overflows out the one-liners
  • [enhancement] section titles are larger, lighter
  • [health] testing on Windows + 1.12-dev SDK
  • [enhancement] property types are now on the right
  • [enhancement] other various style tweaks
  • [enhancement] main text is darker, links are more contrasty
  • [enhancement] include dartdoc version in generated docs, as HTML comment
  • [enhancement] remove empty-doc warnings for unnamed libraries
  • [enhancement] dartdoc understands "sdk extensions"
  • [enhancement] find-as-you-type search
  • [bug] doc references to names with multiple underscores now link correctly

0.4.0 #

  • Print the name of the thing above the right nav list
  • Numerous fixes, tests, and cleanups to the code
  • fix: top-level consts are linked correctly from doc references
  • fix: if a doc comment cannot be resolved, it is wrapped in a code element
  • fix: links generated on the Enum page
  • fix: background is dark when left drawer is open
  • fix: better error message when running dartdoc on empty directory
  • fix: don't show left drawer toggle on homescreen
  • fix: docs for a class that extends List showed double methods

0.3.0 #

  • new: left nav now animates in on mobile
  • new: white list certain libraries from the command line
  • fix: syntax highlighting of inline code
  • fix: exceptions and errors are not includes in the list of classes

0.2.2 #

  • new: show the source code for methods, functions, and constructors
  • fix: fixed an npe when generating docs for projects without readmes

0.2.1 #

  • fix: documentation for fields was sometimes null

0.2.0 #

  • fix: inconsistent heights in masthead
  • new: alphabetize lists of names
  • fix: fields w/ getters and setters were not displaying docs

0.1.0+5 #

  • show peers in left navigation bar
  • show inherited on a separate line
  • fix links to anchors
  • fix comments for properties

0.1.0+4 #

  • display only named constructor in left nav
  • do not show duplicates in implementors
  • add dart identity to page
  • left nav links to dedicated page for element

0.1.0+3 #

  • added top navigation bar
  • add left navigation section
  • package page lists libraries in left nav
  • bump version of grinder

0.1.0+2 #

  • bump version of pub_cache

0.1.0+1 #

  • remove unused dependencies (http and intl)

0.1.0 #

  • display a left-hand nav for classes and libraries
  • constants now display types in classes and libraries
  • types for properties now show on the left
  • files that act as indexes now use dash instead of underscores in their names
  • display tabs for major in-page sections

0.0.3 #

  • tweaks to margins, fonts and header
  • mobile ui improvements
  • support user defined library mapping using --url-mapping option
  • warning if library is undocumented
  • fixed linking for parameters

0.0.2+3 #

  • do not drop brackets in comments
  • replace ':' in library names with '-'
  • support multiple anonymous libraries
  • show generic information for classes
  • signature of method on same line as name
  • error if command line argument is not recognized
  • fixed href for property accesssor
  • fixed generation of docs for exported libraries

0.0.2+2 #

  • add a --package-root option
  • resource handler support for package root

0.0.2+1 #

  • handle packages that don't have a readme
  • fixed linking to references from other libraries in comments
  • resolve [new Constructor] in comments
  • link to exported library in comment references
  • visually show library is deprecated
  • fixed one liner documentation

0.0.2 #

  • documenation generated in doc/api directory
  • support for readme files in plain text
  • fixed resolving references in library comments
  • generate docs even when output directory exists
  • show inherited operators
  • visually indicate deprecated api

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate dartdoc

2. Use it

The package has the following executables:


$ dartdoc

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dartdoc: ^0.9.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dartdoc/dartdoc.dart';
  
Version Uploaded Documentation Archive
0.28.2 Feb 14, 2019 Go to the documentation of dartdoc 0.28.2 Download dartdoc 0.28.2 archive
0.28.1+2 Feb 5, 2019 Go to the documentation of dartdoc 0.28.1+2 Download dartdoc 0.28.1+2 archive
0.28.1+1 Feb 4, 2019 Go to the documentation of dartdoc 0.28.1+1 Download dartdoc 0.28.1+1 archive
0.28.1 Feb 4, 2019 Go to the documentation of dartdoc 0.28.1 Download dartdoc 0.28.1 archive
0.28.0 Jan 14, 2019 Go to the documentation of dartdoc 0.28.0 Download dartdoc 0.28.0 archive
0.27.0 Jan 3, 2019 Go to the documentation of dartdoc 0.27.0 Download dartdoc 0.27.0 archive
0.26.1 Dec 13, 2018 Go to the documentation of dartdoc 0.26.1 Download dartdoc 0.26.1 archive
0.26.0 Dec 4, 2018 Go to the documentation of dartdoc 0.26.0 Download dartdoc 0.26.0 archive
0.25.0 Nov 19, 2018 Go to the documentation of dartdoc 0.25.0 Download dartdoc 0.25.0 archive
0.24.1 Oct 18, 2018 Go to the documentation of dartdoc 0.24.1 Download dartdoc 0.24.1 archive

All 111 versions...

Awaiting analysis to complete.