diff --git a/docs/daemon-rpc/core_rpc_server_commands_defs.h b/docs/daemon-rpc/core_rpc_server_commands_defs.h new file mode 120000 index 000000000..7d9b000d2 --- /dev/null +++ b/docs/daemon-rpc/core_rpc_server_commands_defs.h @@ -0,0 +1 @@ +../../src/rpc/core_rpc_server_commands_defs.h \ No newline at end of file diff --git a/docs/daemon-rpc/make-docs.sh b/docs/daemon-rpc/make-docs.sh new file mode 100755 index 000000000..a02402a36 --- /dev/null +++ b/docs/daemon-rpc/make-docs.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +set -e + +if [ "$(basename $(pwd))" != "daemon-rpc" ]; then + echo "Error: you must run this from the docs/daemon-rpc directory" >&2 + exit 1 +fi + +rm -rf api + +docsify init --local api + +rm -f api/README.md + +if [ -n "$NPM_PACKAGES" ]; then + npm_dir="$NPM_PACKAGES/lib/node_modules" +elif [ -n "$NODE_PATH" ]; then + npm_dir="$NODE_PATH" +elif [ -d "$HOME/node_modules" ]; then + npm_dir="$HOME/node_modules" +elif [ -d "/usr/local/lib/node_modules" ]; then + npm_dir="/usr/local/lib/node_modules" +else + echo "Can't determine your node_modules path; set NPM_PACKAGES or NODE_PATH appropriately" >&2 + exit 1 +fi + +cp $npm_dir/docsify/node_modules/prismjs/components/prism-{json,python}.min.js api/vendor + +./rpc-to-markdown.py core_rpc_server_commands_defs.h "$@" + +perl -ni.bak -e ' +BEGIN { $first = 0; } +if (m{^\s*\s*$}) { + if (not $first) { + $first = false; + print qq{ + \n}; + } +} else { + s{