Coder Social home page Coder Social logo

domaindoc's Introduction

CircleCI codecov

🌊 Static site generator for Domain Models

domaindoc is a JavaScript CLI tool for creating documentation site of your domain models using markdown and yaml syntax.

Getting Started

First you need Node.js.

Then install it via npm:

npm install -g domaindoc

Then write markdown files for models like the below:

source/
β”œβ”€β”€ user.md
└── item.md

(source/user.md):

---
name: User
desc: The user model
props:
  - name: id
    type: string
    desc: The id of the user
  - name: name
    type: string
    desc: The name of the user
---

User represents an user account in the service.

(source/item.md):

---
name: Item
desc: The item model
props:
  - name: id
    type: string
    desc: The id of the item
  - name: name
    type: string
    desc: The name of the item
---

Item represents the item in the service. An user has 0 or more items.

Then run the command domaindoc serve like the below:

$ domaindoc serve
domaindoc [01:18:38] serving
domaindoc [01:18:38] Reading: source/**/*.md
domaindoc [01:18:38] Reading: source/**/*.md
domaindoc [01:18:38] Reading: source/**/*.css
domaindoc [01:18:38] Server started at: http://0.0.0.0:8011/
domaindoc [01:18:38] See debug info at: http://0.0.0.0:8011/__domaindoc__
domaindoc [01:18:38] Ready: source/**/*.css
domaindoc [01:18:38] Ready: source/**/*.md
domaindoc [01:18:38] Ready: source/**/*.md

Then access http://0.0.0.0:8011/index.html and you'll be seeing the documentation site:

And when you finish modifying the source files, then hit the command domaindoc build like the below:

$ domaindoc build
domaindoc [20:31:14] building
domaindoc [20:31:14] done

And then you get html documentation files in build/ directory.

YAML Properties

You can use properties in YAML front matter in the markdown sources.

name type description
name string The name of the model (required)
type string The type of the model. e.g. Entity, ValueObject etc
labels string[] The arbitrary labels of the model
desc string The description of the model (required)
src string The url of the source code of the model (optional)
edit string The url of the edit page of the model document
props Property[] The properties of the model (optional)

Each Property object has the following properties in it.

name type description
name string The name of the property (required)
type string The type of the property (required)
desc string The description of the property (optional)

Build Configuration

domaindoc is configurable by creating .domaindoc.yml. You can configure the following properties:

name type description
dest string The destination dir
source string The source directory
title string The document title
port number The dev server port number
basepath string The basepath of the site
loggerTitle string The title of the logger

Example .domaindoc.yml:

dest: doc/domain
source: src/domain
port: 50000
title: My App Domain Models
basepath: https://example.dom/domaindoc

Example

This is the demo document from an open-source accounting software moneybit.

Screenshots:

History

  • 2018-06-13 v3.0.0 Update bulma. Add tags.
  • 2017-06-10 v2.8.0 Show owners in document.
  • 2017-05-01 v2.5.0 Improve multiple documents.
  • 2017-05-01 v2.4.0 Multiple document roots.
  • 2017-04-30 v2.3.1 Fix watch.
  • 2017-04-30 v2.3.0 Add logger title option.
  • 2017-04-26 v2.0.0 Switch config file to yaml format.
  • 2017-04-23 v1.8.0 Serve index page at directory root.

License

MIT

domaindoc's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar kt3k avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

domaindoc's Issues

An in-range update of husky is breaking the build 🚨

The devDependency husky was updated from 1.2.0 to 1.2.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

husky is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 7 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

An in-range update of nunjucks is breaking the build 🚨

The dependency nunjucks was updated from 3.1.3 to 3.1.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

nunjucks is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 7 commits.

  • 11262e5 Release v3.1.4
  • bcd45fc Merge pull request #1165 from stigkj/master
  • 40480f0 Fix engine version for Node v11.1.0
  • 3512ca6 Merge pull request #1161 from jonathanchu/master
  • 9dc07dc Fix dependency version for node v11.0.0
  • 39bb716 Merge pull request #1126 from TheDancingCode/issue-126
  • 4d4dc40 Escape unicode newlines when compiling

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of nunjucks is breaking the build 🚨

The dependency nunjucks was updated from 3.1.4 to 3.1.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

nunjucks is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 3 commits.

  • 6a3872e Release v3.1.5
  • be3646b Merge pull request #1169 from duncand/master
  • fb3f443 Fix engine dependency version for Node versions > 11.1.0

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

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.