npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bentley/ecjson2md

v0.7.6

Published

Markdown generation from ECSchema JSON

Downloads

65

Readme

ecjson2md

Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.

ecjson2md is a CLI tool that takes an ECSchema JSON and path to referenced schemas and generates a Markdown file based on it at a specified location.

Change Log

Installation


Install globally (recommended)

npm install -g @bentley/ecjson2md

Install locally

npm install @bentley/ecjson2md

Usage


Generate a markdown file from ECSchema JSON via command line

ecjson2md -i <path to ECSchema JSON> -r <comma, semicolon, or space separated search dirs> -o <directory to output markdown>

Note: If no search directories are needed, you don't need to include the -r option Note: When using multiple search paths, enclose them in single quotes

Generate a markdown file from ECSChema JSON file programmatically

import { ECJsonMarkdownGenerator } from "@bentley/ecjsom2md";

mdGenerator = new ECJsonMarkdownGenerator(<array of search directories>);

mdGenerator.generate(<path to ECSchema JSON>, <output markdown file path>);

Note: Additional static methods are also available for more specific use

Updating


If installed globally

npm update -g @bentley/ecjson2md

If installed locally

npm update @bentley/ecjson2md

Use with Bemetalsmith


Bemetalsmith with plugin called addRemarks which can be used to splice human written notes into the files that are generated by ecjson2md. In most cases, Bemetalsmith will do this out-of-the-box without additional configuration.

Notes about use with Bemetalsmith

  • The "-n" option in ecjson2md will generate short code for bemetalsmith to include an alert stating that the documentation is for an unreleased schema
  • Human-written remarks must be contained in markdown files alongside the generated docs
  • Each schema must have a separate remarks file if it has any remarks
  • The name of the remarks file does not matter
  • The front matter of the remarks file must point to the schema doc that it corresponds to (see below examples)
  • The remarks are spliced in "as is" including any markdown tags

Schema doc structure after remarks are merged in

# <Name of schema>
.
.
.
## Classes
### <Name of class1>
.
.
.
**Base class: ** [link_to <schema name>/#<class name> text="<base class name>"]
.
.
.
<---- Human-written remark for class1 will go here
### <Name of class2>
.
.
.
<---- Human-written remark for class2 will go here
### <Name of class3>
.
.
.

How to create a remarks file

  • At the top of the remarks file, include:
    ---
    remarksTarget: <name of target file>
    ---
  • Add a remark after each ### header

Example

| target.md || remarks.md | | --------- |----| ---------- | |...### Texture...### TypeDefinitionElement...### TypeDefinitionHasElement || ---remarksTarget: target.md---### Texture More information at docs.example### TypeDefinitionElement*ready for release*|

⇩ addRemarks ⇩

| target.md || remarks.md | | --------- |----| ---------- | |...### Texture...More information at docs.example### TypeDefinitionElement*ready for release*...### TypeDefinitionHasElement || ---remarksTarget: target.md---### Texture More information at docs.example### TypeDefinitionElement*ready for release*|

Notes


  • When using the CLI tool, providing a list of directories that are separated by comma + space such as: -r ./one, ./two, /three will only add the first directory to the locator. Use only a comma or quotes instead, e.g. -r ./one,./two,./three or -r './one, ./two, ./three'

Known issues


  • None currently (as of 7/25/2018)