Skip to content

Commit

Permalink
Merge pull request #118 from DataHighway-DHX/jeff/updateDocusaurus
Browse files Browse the repository at this point in the history
Jeff/update docusaurus
  • Loading branch information
jeffstahlnecker authored Jun 22, 2021
2 parents 016d2e0 + 7e10012 commit e96c1c4
Show file tree
Hide file tree
Showing 217 changed files with 1,194 additions and 39,569 deletions.
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

2 changes: 2 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALGOLIA_API_KEY=
ALGOLIA_INDEX_NAME=
14 changes: 0 additions & 14 deletions .github/workflows/linkChecker.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/publish.yml

This file was deleted.

28 changes: 17 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
.DS_Store
# Dependencies
/node_modules

node_modules
# Production
/build

lib/core/metadata.js
lib/core/MetadataBlog.js
# Generated files
.docusaurus
.cache-loader

website/translated_docs
website/build
website/yarn.lock
website/node_modules
website/i18n/*
# Misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

output-markdown-toc.md
output-html-toc.html
npm-debug.log*
yarn-debug.log*
yarn-error.log*
9 changes: 9 additions & 0 deletions .idea/documentation.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

122 changes: 0 additions & 122 deletions LICENSE

This file was deleted.

64 changes: 22 additions & 42 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,41 @@
## Updating the Whitepaper

1. Modifying styles

It may be necessary to maintain duplicated styles that are in both ./style.css
(used for generating PDF of whitepaper for download with md-to-pdf program) and
website/static/css/custom.css (used for generating Whitepaper
in the DataHighway Developer Hub).

2. Updating diagrams
1. Updating diagrams

Most of the original diagrams that are included in the original v1.0.0 whitepaper were generated with Visual Paradigm, whose source file is .vpd format, and then converted to an image that was stored in the ./assets/images folder and embedded in the generated whitepaper. However some of the diagrams were modified by the MXC marketing team, and these were included in previous version [v1.1.0 whitepaper](https://github.com/DataHighway-DHX/documentation/releases). If you need to update any of the diagrams then please coordinate with the MXC marketing team.

3. Run the following to create a new release in PDF format. Replace `v1.2.0` below with the desired version:

```
nvm use v10.16.0 &&
npm install &&
node ./node_modules/.bin/md-to-pdf ./docs/whitepaper.md \
--config-file ./config.json \
./docs/whitepaper.pdf &&
mkdir -p ./versions/v1.2.0 &&
cp ./docs/whitepaper.pdf ./versions/v1.2.0/whitepaper.pdf
```

Note: It is important to use Node.js v10.16.0 and version simonhaenisch/md-to-pdf#v2.7.0 otherwise you will get an error like `ListrError: Something went wrong`). If there are issues running the following, then run `npm init &&
npm install --save simonhaenisch/md-to-pdf#v2.7.0`.
1. Install Node.js v16.3.0

Important: Check it generated the latest PDF to reflect the Markdown changes you made correctly in ./docs/whitepaper.pdf and the copy of it ./versions/v1.2.0/whitepaper.pdf.
2. Start your development environment

External links may reference the static location of the latest whitepaper in ./docs/whitepaper.pdf. A copy of each version is stored in a directory with the version name to make it easier for users to find older versions.
```terminal
npm install && \
npm install -g [email protected] && \
npm start
```

Note: `headerIds` must be `true` in config.json otherwise TOC links do not work.
2. Change into folder `./static/whitepapers/economic` folder and run the following to create a new release in PDF format. Replace `v1.2.0` or `v1_2_x` below with the desired version:

4. Update the Whitepaper Table of Contents (TOC)
```terminal
cd ./static/whitepapers/economic
Generate the TOC of the Whitepaper and save to a file in Markdown format using [markdown-toc](https://github.com/jonschlinkert/markdown-toc):
mr-pdf --initialDocURLs="http://localhost:3000/docs/whitepaper" \
--contentSelector="article" \
--paginationSelector=".pagination-nav__item--next > a" \
--pdfMargin="50,50,50,50" \
--pdfFormat="A4" \
--outputPDFFilename="whitepaper_latest.pdf"
```bash
cd website &&
cd ./node_modules/markdown-toc/ && node cli.js --bullets "*" --no-firsth1 ../../../docs/whitepaper.md > ../../../output-markdown-toc.md && cd ../../../
cp ./whitepaper_latest.pdf ./whitepaper_v1_2_x.pdf
```

Convert the Markdown version of the TOC into HTML using [pandoc](https://pandoc.org/)

```bash
brew install pandoc
pandoc output-markdown-toc.md --from=gfm -t html -o output-html-toc.html
```

Copy the contents of output-html-toc.html into ./docs/whitepaper.md as indicated here:
Important:
* Remove the first few including page 1 that generates text "untitled" and the Table of Contents pages, so the first page starts with "DataHighway's Whitepaper"
* Check it generated the latest PDF to reflect the Markdown changes you made correctly in ./docs/whitepaper.mdx and the copy of it ./static/whitepapers/economic/v1.2.0/whitepaper.pdf.

```bash
<div class="pdf-only">
<span style="font-size: 1.5em; font-weight: 700;!important" class="pdf-only">Table of Contents</span>
<!-- INSERT TOC BELOW HERE -->
</div>
```
External links may reference the static location of the latest whitepaper in ./whitepapers/economic/whitepaper_latest.pdf. A copy of each version is stored in a directory with the version name to make it easier for users to find older versions.

### Troubleshooting

Expand Down
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
11 changes: 11 additions & 0 deletions blog/2021-05-31-welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
slug: welcome
title: Welcome
author: Jeff Stahlnecker
author_title: DataHighway Contributor
author_url: https://github.com/jeffstahlnecker
author_image_url: https://avatars.githubusercontent.com/u/45363541?v=4
tags: [welcome]
---

Welcome! We'll be posting some development updates here as the development continues. :)
20 changes: 0 additions & 20 deletions config.json

This file was deleted.

53 changes: 0 additions & 53 deletions crowdin.yaml

This file was deleted.

Loading

0 comments on commit e96c1c4

Please sign in to comment.