Skip to content

Commit

Permalink
Update docs generation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWilliams2 committed Mar 15, 2024
1 parent 13ac2b2 commit 8403071
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8403071

Please sign in to comment.