From 8403071afe4b647905977e5e928b0aafce7c317a Mon Sep 17 00:00:00 2001 From: NateWilliams2 Date: Fri, 15 Mar 2024 18:08:37 -0400 Subject: [PATCH] Update docs generation instructions --- README.md | 22 ++++++++-------------- docs/intro.md | 2 +- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 9db6ea159..9f818074a 100644 --- a/README.md +++ b/README.md @@ -42,33 +42,27 @@ yarn run re-gen ## Generate the SDK documentation -If you want to generate the SDK documentation for yourself, you can do so from the `vocdoni-sdk` project. -At the moment you may experience an running generating the following code which can be fixed by temporarily commenting-out this line in `vocdoni-sdk/tsconfig.json when running the typedoc generation script: -~~~json - // "rootDir": "./src", -~~~ +If you want to generate the SDK documentation for yourself, you can do so from inside the `docs` directory in the `vocdoni-sdk` project. ~~~bash npm install typedoc --save-dev -npx typedoc --plugin typedoc-plugin-markdown --categorizeByGroup --out reference +npm install typedoc-plugin-markdown --save-dev +yarn build ~~~ +This creates a temporary documentation folder `temp_docs`. Then you can replace the SDK documentation folder in your developer portal directory: ~~~bash # Delete existing SDK docs folder -rm -rf DEV_PORTAL_PATH/docs/sdk/reference +rm -rf ./docs/sdk/reference # Copy the new docs to the SDK folder -cp -R VOCDONI_SDK_PATH/reference/ DEV_PORTAL_PATH/docs/sdk/reference -# Remove the autogenerated library readme (this is not necessary) -rm DEV_PORTAL_PATH/docs/sdk/reference/README.md -# Copy changelog file to SDK reference directory -cp VOCDONI_SDK_PATH/CHANGELOG.md DEV_PORTAL_PATH/docs/sdk/reference/changelog.md +cp -R VOCDONI_SDK_PATH/docs/temp_docs/ ./docs/sdk/reference # Remove the now redundant docs folder in vocdoni-sdk -rm -rf VOCDONI_SDK_PATH/reference +rm -rf VOCDONI_SDK_PATH/docs/temp_docs # Clean-up the generated links to the readme file # Note this command was run on MacOS, the sed command may need to be tweaked on a linux system -find DEV_PORTAL_PATH/docs/sdk/reference -type f | xargs sed -i '' -r 's/\[\@vocdoni\/sdk\]\((\.\.\/)*README\.md\)/\[\@vocdoni\/sdk\]\(\/sdk\)/g' +find ./docs/sdk/reference -type f | xargs sed -i '' -r 's/\[\@vocdoni\/sdk\]\((\.\.\/)*README\.md\)/\[\@vocdoni\/sdk\]\(\/sdk\)/g' ~~~ Note that the SDK docs are tracked by git, and you should not need to do this if you are not a repo maintainer. diff --git a/docs/intro.md b/docs/intro.md index 98f90395a..5ee2ca573 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -17,7 +17,7 @@ Start with the [SDK Tutorial][tutorial] These components all come together in our [live demo][sdk-demo]. You can explore a basic Vocdoni implementation by creating some fake voters and starting a simple, single-question election. You will be able to cast a vote for each fake voter and see the results. -![Live preview](https://raw.githubusercontent.com/vocdoni/vocdoni-sdk/main/docs/images/cra.png) +![Live preview](/img/cra.png) This demo requires [Metamask][metamask] (or Walletconnect) to sign transactions. Metamask is a browser extension that holds custody of private keys and cryptocurrencies, but it is simple to install and use, and you need no prior knowledge of this technology. :::info No balance is needed