Skip to content

convenient system that easy to create to make people easy to publish their documents

License

Notifications You must be signed in to change notification settings

maple-leaf/happydoc

Repository files navigation

happydoc

convenient system that easy to create to make people easy to publish their documents

Quick Start

Install

  • Server side(use go to install as a system command): go get -u github.com/maple-leaf/happydoc
  • Client side(install as npm package): npm i happydoc -D

PS: If you want, you can also use go to install at client side as a system wide command

Run happydoc server at your server

After you install happydoc on server, run command happydoc server to install happydoc service and run it

Publish document on client side

  • npm
    • init: npx happydoc init

    • publish: say you have docs folder in your project which contains documents generated by, say esdoc, and apidocs folder which contains server api documents generated by, say swagger. (both should have index.html inside)

      • use npx: npx happydoc publish docs -v 0.0.1 -t frontend
      • [TODO] use npm script: npm run happydoc apidocs
       // package.json
       {
       	...
       	scripts: {
       		'happydoc': 'happydoc publish'
       	}
       }

config file - .happydoc.json

{
	"project": "myAwesomeProject",
	"server": "http://127.0.0.1:8000",
	"account": "your account name at server",
	"token":
}

Commands

  • happydoc init

generate config file .happydoc.json by answer questions. If project has file package.json, project will default to name field inside it.

  • happydoc publish

upload documents to server. It receives one argument to indicate path to document folder, and has four flags: - server: shorthand s, will override value inside .happydoc.json if used - project: shorthand p, will override value inside .happydoc.json if used - version: shorthand v, current version of documents - type: shorthand t, type of documents

```bash
happydoc publish docs/fontend -v 1.2.0 -t frontend
happydoc publish docs/backend -v 1.2.0 -t backend -s http://my-doc-server.com -p myAwesomeProject2
```
  • happydoc server

init and run happydoc server. This server will receives documents uploaded by happdoc client with publish command. And token used by happdoc client is also generated on it.

This command will ask you:

  • folder to init server
  • which port should be used by server
  • password set for postgresql running on docker container, NOT DB ON YOUR HOST

Build and Release

  • release using goreleaser, release require github token with repo, check doc

     git tag version
     export GITHUB_TOKEN='Your Github Token Here'
     goreleaser goreleaser release
    
     # dry run without publish to github etc.
     goreleaser release --skip-publish
  • publish release to npm using go-npm: npm publish

This project use

TODO

  • better UI
  • use https
  • fix output for subcommand server

About

convenient system that easy to create to make people easy to publish their documents

Resources

License

Stars

Watchers

Forks

Packages

No packages published